Image determination method and apparatus, electronic device, and storage medium
By calculating the influence value and feature information of unlabeled images, representative unlabeled images are selected for labeling, which solves the problem of low image recognition accuracy caused by random selection and achieves more efficient model training and recognition results.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- MASHANG CONSUMER FINANCE CO LTD
- Filing Date
- 2022-03-02
- Publication Date
- 2026-06-23
AI Technical Summary
In existing technologies, randomly selecting unlabeled images for image recognition model training may result in low image recognition accuracy. This may be due to reasons such as poor quality or skewed distribution of labeled images, which affects the semi-supervised training effect of the model.
By acquiring feature information from the unlabeled image set, calculating the influence value of each unlabeled image, selecting representative unlabeled images as images to be labeled, and optimizing the image selection process using feature extraction models and clustering algorithms.
It improves the accuracy of image recognition models, ensures the representativeness and balanced distribution of labeled images, and enhances the training effect of the models.
Smart Images

Figure CN116758602B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of machine learning technology, and more specifically, to an image determination method, apparatus, electronic device, and storage medium. Background Technology
[0002] With the development of science and technology, more and more models are being trained for image recognition. Currently, when training image recognition models, a subset of unlabeled images is first randomly selected from a set of unlabeled images. These selected images are then labeled before being used for model training. However, randomly selected unlabeled images may be of poor quality or exhibit a skewed distribution, resulting in low accuracy in image recognition. Summary of the Invention
[0003] In view of the above problems, this application proposes an image determination method, apparatus, electronic device, and storage medium to solve the above problems.
[0004] In a first aspect, embodiments of this application provide an image determination method, the method comprising: acquiring an unlabeled image set and feature information corresponding to each unlabeled image in the unlabeled image set, wherein the unlabeled image set includes multiple unlabeled images; determining the influence value of each unlabeled image in the unlabeled image set based on the feature information corresponding to each unlabeled image in the unlabeled image set; and determining at least one unlabeled image from the unlabeled image set as an image to be labeled based on the influence value of each unlabeled image in the unlabeled image set and the feature information corresponding to each unlabeled image in the unlabeled image set.
[0005] Secondly, embodiments of this application provide an image determination apparatus, the apparatus comprising: a feature information acquisition module, configured to acquire an unlabeled image set and feature information corresponding to each unlabeled image in the unlabeled image set, wherein the unlabeled image set includes multiple unlabeled images; an influence value determination module, configured to determine the influence value of each unlabeled image in the unlabeled image set based on the feature information corresponding to each unlabeled image in the unlabeled image set; and an image determination module, configured to determine at least one unlabeled image as an image to be labeled from the unlabeled image set based on the influence value of each unlabeled image in the unlabeled image set and the feature information corresponding to each unlabeled image in the unlabeled image set.
[0006] Thirdly, embodiments of this application provide an electronic device, including a memory and a processor, wherein the memory is coupled to the processor, the memory stores instructions, and when the instructions are executed by the processor, the processor performs the above-described method.
[0007] Fourthly, embodiments of this application provide a computer-readable storage medium storing program code, which can be invoked by a processor to execute the above-described method.
[0008] Fifthly, embodiments of this application provide a computer program product, including a computer program / instructions that, when executed by a processor, implement the steps of the above-described method.
[0009] In this embodiment, when selecting unlabeled images from the unlabeled image set as images to be labeled, the selection is based on two dimensions: the influence value of each unlabeled image in the unlabeled image set and the feature information corresponding to each unlabeled image. The influence value of each unlabeled image in the unlabeled image set can be used to determine the representativeness of each unlabeled image in the unlabeled image set. Thus, more representative unlabeled images can be selected from the unlabeled image set as images to be labeled, thereby making the accuracy of image recognition higher when the model trained with the selected images to be labeled is subsequently used. Attached Figure Description
[0010] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0011] Figure 1 A flowchart illustrating the image determination method provided in an embodiment of this application is shown;
[0012] Figure 2 A flowchart illustrating an image determination method according to an embodiment of this application is shown;
[0013] Figure 3 A flowchart illustrating an image determination method according to an embodiment of this application is shown;
[0014] Figure 4 This illustration shows a first comparative schematic diagram of unlabeled image distribution adjustment in an image determination method provided in one embodiment of this application;
[0015] Figure 5 This illustration shows a second comparative schematic diagram of unlabeled image distribution adjustment in an image determination method provided in one embodiment of this application;
[0016] Figure 6 This application shows Figure 3 The flowchart of step S340 of the image determination method shown is illustrated.
[0017] Figure 7 A flowchart illustrating an image determination method according to an embodiment of this application is shown;
[0018] Figure 8 A block diagram of an image determination apparatus provided in an embodiment of this application is shown;
[0019] Figure 9 A block diagram of an electronic device for performing an image determination method according to an embodiment of this application is shown;
[0020] Figure 10 A storage unit for storing or carrying program code implementing the image determination method according to an embodiment of the present application is shown. Detailed Implementation
[0021] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
[0022] In the process of semi-supervised training of the initial model to obtain an image recognition model, the training image set needs to include a small number of labeled images and a large number of unlabeled images. In real-world scenarios, the original image set consists entirely of unlabeled images. Therefore, to obtain labeled images, users need to select a portion of the unlabeled images from the original image set for annotation. Currently, users randomly select a portion of the unlabeled images from the original image set and then annotate them based on expert experience, thus forming labeled images for semi-supervised training of the initial model.
[0023] Understandably, the representativeness of labeled images has a significant impact on subsequent semi-supervised training of the model. Labeled images with higher overall value can provide valuable guidance for semi-supervised training, correctly directing the training process. However, low-representative labeled images will severely affect the effectiveness of semi-supervised training, primarily in two ways: First, poor-quality individual labeled images provide insufficient or inefficient supervisory information, and may even mislead the model. These images cannot provide adequate guidance for semi-supervised training, resulting in poor training performance and low image recognition accuracy of the trained model. Second, skewed image distribution means that randomly selecting labeled images can easily overlook a small number of images of a particular class, leading to a lack of guidance information. This results in the model missing learning opportunities for that class during semi-supervised training, or unevenly distributed learning results, ultimately leading to poor training performance and low image recognition accuracy of the trained model.
[0024] To address the aforementioned problems, the inventors, through long-term research, discovered and proposed the image determination method, apparatus, electronic device, and storage medium provided in the embodiments of this application. These methods can filter out more representative unlabeled images from a set of unlabeled images as images to be labeled, thereby improving the accuracy of image recognition when using a model trained on the determined images to be labeled. The specific image determination method will be described in detail in the following embodiments.
[0025] Please see Figure 1 , Figure 1 A flowchart illustrating the image determination method provided in an embodiment of this application is shown. In a specific embodiment, the image determination method is applied to, for example... Figure 8 The image determining device 200 and the electronic device 100 equipped with the image determining device 200 are shown. Figure 9 The following will use an electronic device as an example to illustrate the specific process of this embodiment. The following will address... Figure 1 The process shown will be described in detail. The image determination method may specifically include the following steps:
[0026] Step S110: Obtain an unlabeled image set and the feature information corresponding to each unlabeled image in the unlabeled image set, wherein the unlabeled image set includes multiple unlabeled images.
[0027] In some implementations, the unlabeled image set includes multiple unlabeled images, and the number of unlabeled images is not limited herein. Unlabeled images may include unlabeled human face images, unlabeled facial expression images, unlabeled text images, unlabeled animal images, and unlabeled object images, etc., and are not limited herein.
[0028] As one approach, for non-privacy images, such as publicly available images, electronic devices can automatically collect unlabeled image sets from the network or automatically acquire unlabeled image sets locally on the device. They can then perform calculations on each unlabeled image in the set to obtain its corresponding feature information. Alternatively, the electronic device can collect unlabeled image sets from the network or locally on the device based on user-issued task instructions, and perform calculations on each unlabeled image to obtain its corresponding feature information.
[0029] As another approach, for privacy-sensitive images, such as encrypted images, the electronic device can, with authorization, automatically collect a set of unlabeled images from the network, or automatically acquire the set of unlabeled images locally on the electronic device, and calculate the feature information corresponding to each unlabeled image in the set. Alternatively, with authorization, the electronic device can, according to user-issued task instructions, collect a set of unlabeled images from the network, or acquire the set of unlabeled images locally on the electronic device, and calculate the feature information corresponding to each unlabeled image in the set.
[0030] In some implementations, the unlabeled image can be augmented, thus the unlabeled image can be an augmented unlabeled image. One approach is to automatically acquire a set of unlabeled images from the network or automatically acquire it locally from an electronic device, then randomly augment multiple unlabeled images in the set to obtain the augmented unlabeled image. Another approach is to acquire a set of unlabeled images from the network or automatically acquire it locally from an electronic device according to user-issued task instructions, then randomly augment multiple unlabeled images in the set to obtain the augmented unlabeled image. Augmentation methods can include horizontal flipping, vertical flipping, rotation, scaling, cropping, shearing, translation, contrast adjustment, color dithering, and noise reduction, etc., and are not limited here.
[0031] In some implementations, the feature information of each unlabeled image can be obtained through a trained feature extraction model. The augmented unlabeled image can include positive and negative sample images. The indices of the positive sample images can be represented as i and j, meaning that the i-th and j-th unlabeled images are augmented versions of the same unlabeled image. The unlabeled images other than the positive sample images are the negative sample images, which can be determined using the formula... Calculate the feature information corresponding to each unlabeled image in the unlabeled image set, where z p The feature information of the unlabeled image, f θ Represented as a feature information extraction model, p m Represented as a projection algorithm, It is represented as an unlabeled image.
[0032] In some implementations, a contrastive learning framework can be trained based on the augmented unlabeled images and the feature information corresponding to each unlabeled image in the unlabeled image set to obtain a feature extraction model. We can use a feature extraction model to calculate the feature information of each unlabeled image in the unlabeled image set, and then use a loss function to perform the calculation. The feature extraction algorithm is optimized, among which, This represents the loss value for the unlabeled image when the feature extraction model training converges. The value represents the number of unlabeled images in the unlabeled image set, log represents the logarithm, exp() represents an exponential function with base e, τ represents a temperature influence factor hyperparameter, and z i Let z represent the feature information of the i-th unlabeled image in the unlabeled image set. j This represents the feature information of the j-th unlabeled image in the unlabeled image set. After the feature extraction model is trained, f is extracted. θ Part of it serves as the foundation model for subsequent feature extraction.
[0033] It's important to note that contrastive learning is a type of self-supervised learning method that learns feature information by measuring the similarity between positive and negative image pairs using contrastive loss. Specifically, contrastive learning trains the algorithm's representational ability by activating a feature that is similar to its corresponding positive image and dissimilar to all other negative images; this process does not require image label information. A relatively accurate feature extraction model is trained based on unlabeled images, serving as the foundation model for subsequent image determination methods.
[0034] Step S120: Based on the feature information corresponding to each unlabeled image in the unlabeled image set, determine the influence value of each unlabeled image in the unlabeled image set.
[0035] In this embodiment, after obtaining the feature information corresponding to each unlabeled image in the unlabeled image set, the influence value of each unlabeled image in the unlabeled image set can be determined based on the feature information corresponding to each unlabeled image in the unlabeled image set. The influence value of each unlabeled image in the unlabeled image set is used to determine the representativeness of each unlabeled image in the unlabeled image set. That is, the higher the influence value of an unlabeled image in the unlabeled image set, the more representative the unlabeled image is in the set; the lower the influence value, the less representative the unlabeled image is. The characteristics of a high influence value for an unlabeled image in the unlabeled image set include: the unlabeled image is similar to more unlabeled images in the set, meaning that a particular unlabeled image can represent more unlabeled images at the feature information level; and the unlabeled image plays an important role in the semi-supervised algorithm training, meaning that the unlabeled image can dominate the direction of the model's semi-supervised training in terms of loss.
[0036] In some implementations, after obtaining the feature information corresponding to each unlabeled image in the unlabeled image set, the loss value corresponding to each unlabeled image in the unlabeled image set when the feature extraction model training converges can be obtained, as well as the similarity between the feature information of each unlabeled image in the unlabeled image set and each unlabeled image other than the unlabeled image itself. Based on the loss value corresponding to each unlabeled image when the feature extraction model training converges, and the similarity between the feature information of each unlabeled image and each unlabeled image other than the unlabeled image itself, the influence value of each unlabeled image in the unlabeled image set can be determined.
[0037] In some implementations, based on the feature information corresponding to each unlabeled image, the loss value corresponding to each unlabeled image in the unlabeled image set during feature extraction model training, and the similarity of the feature information of each unlabeled image in the unlabeled image set with each unlabeled image other than the unlabeled image can be obtained. Then, the first preset algorithm can be used to calculate the loss value corresponding to each unlabeled image in the unlabeled image set during feature extraction model training, and the similarity of the feature information of each unlabeled image in the unlabeled image set with each unlabeled image other than the unlabeled image, to obtain the influence value of the unlabeled image in the unlabeled image set.
[0038] As one possible implementation, when the unlabeled image set includes unlabeled images that have not undergone image augmentation, the first preset algorithm may include... Then the electronic device can be based on Determine the influence value of each unlabeled image in the unlabeled image set, where S 1p Let represent the influence value of an unlabeled image within the unlabeled image set, l() represent the loss value of an unlabeled image when the feature extraction model training converges, and sim() represent the similarity of feature information between each unlabeled image in the unlabeled image set and every other unlabeled image except the given unlabeled image. f represents the feature information of an unlabeled image. θ Describing the feature extraction model, x p and x q This represents unlabeled images in the unlabeled image set. Understandably, since the unlabeled image set includes unlabeled images that have not undergone image augmentation, it indicates a smaller number of unlabeled images, thus reducing computational load and consequently lowering the power consumption of electronic devices.
[0039] As one possible implementation, when the set of unlabeled images includes unlabeled images for image augmentation, the first preset algorithm may include... Then the electronic device can be based on Determine the influence value of each unlabeled image in the unlabeled image set, where, and For positive sample image pairs, This represents the influence value of an unlabeled image within the set of unlabeled images. This represents the feature information of the i-th unlabeled image in the unlabeled image set. This represents the feature information of the j-th unlabeled image in the unlabeled image set. The loss value for unlabeled images is represented when the feature extraction model training converges; sim() represents the similarity of feature information between each unlabeled image in the set of unlabeled images and every other unlabeled image except the given unlabeled image; f θ Let x represent the feature extraction model, where N1 represents the total number of unlabeled images in the unlabeled image set, and x represents the number of unlabeled images in the set. p and x q This represents the augmented unlabeled image within the unlabeled image set. It's understandable that since the unlabeled image set includes unlabeled images that are not used for image augmentation, it indicates a large number of unlabeled images. Therefore, by increasing the number of unlabeled images, the accuracy of extracting feature information from unlabeled images is increased, thereby improving the accuracy of the determined influence value.
[0040] In some implementations, a preset model can be trained based on the feature information corresponding to each unlabeled image in the unlabeled image set, as well as the influence value of each unlabeled image in the unlabeled image set, to obtain a trained influence value calculation model. The influence value calculation model is then used to calculate the influence value of each unlabeled image in the unlabeled image set based on the feature information corresponding to each unlabeled image.
[0041] Step S130: Based on the influence value of each unlabeled image in the unlabeled image set and the feature information corresponding to each unlabeled image in the unlabeled image set, determine at least one unlabeled image from the unlabeled image set as an image to be labeled.
[0042] In this embodiment, at least one unlabeled image can be determined as a target image from the unlabeled image set based on the influence value of each unlabeled image in the unlabeled image set and the feature information corresponding to each unlabeled image in the unlabeled image set. The number of target images can be changed according to the requirements of the training model.
[0043] In some implementations, unlabeled images with influence values greater than a preset influence value can be determined from the unlabeled image set based on the influence value of each unlabeled image in the unlabeled image set. Then, based on the feature information corresponding to each unlabeled image, at least one unlabeled image can be determined as an image to be labeled from the unlabeled images with influence values greater than the preset influence value.
[0044] In some implementations, a preset number of unlabeled images can be determined from the unlabeled image set in descending order of influence value based on the influence value of each unlabeled image in the unlabeled image set. Then, based on the feature information corresponding to each unlabeled image, at least one unlabeled image can be determined from the preset number of unlabeled images as an image to be labeled.
[0045] In some implementations, each unlabeled image can be sorted according to its influence value in the unlabeled image set to obtain the arrangement order of each unlabeled image in the unlabeled image set. Then, based on the arrangement order of each unlabeled image and the feature information corresponding to each unlabeled image, at least one unlabeled image can be determined from the unlabeled image set as an image to be labeled.
[0046] One possible implementation is to sort each unlabeled image in descending order based on its influence value within the set of unlabeled images, thus obtaining the arrangement order of the unlabeled images. In other words, the unlabeled images with higher influence values within the set of unlabeled images are placed first. This can be achieved using the formula... Obtain the descending sort order and sort index of the unlabeled images, where R1 represents the order of the unlabeled images. This represents the influence value of the unlabeled image within the unlabeled image. It should be noted that the function y = Arg sort(x) sorts the elements in x in ascending order, extracts their corresponding indices, and outputs them to y; the function y = Arg sort(-x) sorts the elements in x in descending order, extracts their corresponding indices, and outputs them to y.
[0047] In some implementations, the electronic device may pre-set and store a preset arrangement order and preset feature information, and perform detection according to the arrangement order. When the arrangement order of the unlabeled images meets the preset arrangement order and the feature information of the unlabeled images meets the preset feature information, at least one unlabeled image is determined from the set of unlabeled images as an image to be labeled. When the arrangement order of the unlabeled images does not meet the preset arrangement order and / or the feature information of the unlabeled images does not meet the preset feature information, at least one unlabeled image is not determined from the set of unlabeled images as an image to be labeled.
[0048] In some implementations, the images to be labeled can be labeled to obtain labeled images. It should be noted that semi-supervised learning algorithms learn by studying a large number of labeled samples to build a model for predicting the labels of unseen examples. Therefore, at least one unlabeled image needs to be determined from the set of unlabeled images as the images to be labeled. Here, the label refers to the output corresponding to the example. In classification problems, the label is the category of the example, while in regression problems, the label is the true value output corresponding to the example.
[0049] In some implementations, the image to be labeled can be annotated. One approach is for the electronic device to pre-set and store labeling types. When labeling an image, the stored labeling type is selected, and the image is labeled to obtain a labeled image. Another approach is to create a new labeling type and then label the image according to the new type to obtain a labeled image. The model can be semi-supervised trained using both labeled and unlabeled images. During semi-supervised training, labeled images can be used alone to train the supervised algorithm; alternatively, unlabeled images can be added to the labeled images to enhance the performance of the supervised classification algorithm.
[0050] In this embodiment, when selecting unlabeled images from the unlabeled image set as images to be labeled, the selection is based on two dimensions: the influence value of each unlabeled image in the unlabeled image set and the feature information corresponding to each unlabeled image. The influence value of each unlabeled image in the unlabeled image set can be used to determine the representativeness of each unlabeled image in the unlabeled image set. Thus, more representative unlabeled images can be selected from the unlabeled image set as images to be labeled, thereby making the accuracy of image recognition higher when the model trained with the selected images to be labeled is subsequently used.
[0051] Please see Figure 2 , Figure 2 A flowchart illustrating an embodiment of the image determination method provided in this application is shown. The following will focus on... Figure 2 The process shown will be described in detail. The image determination method may specifically include the following steps:
[0052] Step S210: Obtain an unlabeled image set and the feature information corresponding to each unlabeled image in the unlabeled image set, wherein the unlabeled image set includes multiple unlabeled images.
[0053] Step S220: Based on the feature information corresponding to each unlabeled image in the unlabeled image set, determine the influence value of each unlabeled image in the unlabeled image set.
[0054] For a detailed description of steps S210-S220, please refer to steps S110-S120, which will not be repeated here.
[0055] Step S230: Based on the influence value of each unlabeled image in the unlabeled image set, determine the unlabeled images in the unlabeled image set whose influence value is greater than a preset influence value.
[0056] In this embodiment, after obtaining the influence value of each unlabeled image in the unlabeled image set, the unlabeled images with an influence value greater than a preset influence value can be determined from the unlabeled image set based on the influence value of each unlabeled image in the unlabeled image set.
[0057] In some implementations, the electronic device may pre-set and store preset influence values, which are used as the basis for selecting unlabeled images from the unlabeled image set. Therefore, in this embodiment, after obtaining the influence value of each unlabeled image in the unlabeled image set, the influence value of each unlabeled image in the unlabeled image set can be compared with the preset influence value to determine whether the influence value of each unlabeled image in the unlabeled image set is greater than the preset influence value, obtain the determination result, and then, based on the determination result, determine the unlabeled images with influence values greater than the preset influence value from the unlabeled image set.
[0058] For example, suppose the set of unlabeled images includes unlabeled image x1, unlabeled image x2, and unlabeled image x3, and the influence value corresponding to unlabeled image x1 is X1, the influence value corresponding to unlabeled image x2 is X2, the influence value corresponding to unlabeled image x3 is X3, and the preset influence value is X. Assuming that the influence values X1 and X2 of unlabeled image x1 are greater than X, and the influence value X3 of unlabeled image x3 is less than X, then it can be determined that unlabeled images x1 and x2 are unlabeled images with influence values greater than the preset influence value.
[0059] Step S240: Based on the feature information corresponding to each unlabeled image in the unlabeled image set, at least one unlabeled image is determined as the image to be labeled from the unlabeled images whose influence value is greater than the preset influence value.
[0060] In this embodiment, from the unlabeled images whose influence value is greater than the preset influence value that have been filtered, at least one unlabeled image is extracted as an image to be labeled based on the feature information corresponding to each unlabeled image in the unlabeled image set.
[0061] In some implementations, at least one unlabeled image with a high similarity to other unlabeled images in the unlabeled image set can be extracted from the selected unlabeled images whose influence value is greater than a preset influence value. This unlabeled image is then selected as the image to be labeled. For example, if there are two unlabeled images, x1 and x2, among the selected unlabeled images with influence values greater than the preset influence value, and the similarity between unlabeled image x1 and other unlabeled images in the unlabeled image set is greater than the similarity between unlabeled image x2 and other unlabeled images in the unlabeled image set, then unlabeled image x1 is extracted as the image to be labeled.
[0062] In this embodiment, when selecting unlabeled images as images to be labeled from the unlabeled image set, the selection is made from unlabeled images whose influence value is greater than a preset influence value in the unlabeled image set. The influence value of each unlabeled image in the unlabeled image set can be used to determine the representativeness of each unlabeled image in the unlabeled image set, so that the unlabeled images selected from the unlabeled image set as images to be labeled are all highly representative, thereby making the accuracy of image recognition higher when the model trained with the determined images to be labeled is subsequently used.
[0063] Please see Figure 3 , Figure 3 A flowchart illustrating an embodiment of the image determination method provided in this application is shown. The following will focus on... Figure 3 The process shown will be described in detail. The image determination method may specifically include the following steps:
[0064] Step S310: Obtain an unlabeled image set and the feature information corresponding to each unlabeled image in the unlabeled image set, wherein the unlabeled image set includes multiple unlabeled images.
[0065] Step S320: Based on the feature information corresponding to each unlabeled image in the unlabeled image set, determine the influence value of each unlabeled image in the unlabeled image set.
[0066] For a detailed description of steps S310-S320, please refer to steps S110-S120, which will not be repeated here.
[0067] Step S330: Based on the feature information corresponding to each unlabeled image in the unlabeled image set, cluster the multiple unlabeled images to obtain multiple sample sets, wherein each of the multiple sample sets includes at least two of the unlabeled images, and the similarity of the feature information of the at least two unlabeled images included in each sample set is greater than a preset similarity.
[0068] In this embodiment, based on the feature information corresponding to each unlabeled image in the unlabeled image set, multiple unlabeled images are clustered to obtain multiple sample sets. Each sample set includes at least two unlabeled images, and the similarity of the feature information of the at least two unlabeled images in each sample set is greater than a preset similarity. The number of unlabeled images in the multiple sample sets may be different or the same, and there is no limitation here.
[0069] Clustering methods can include k-means, density-based clustering of applications with noise (DBSCAN), etc., and are not limited here. It should be noted that the k-means algorithm is a hard clustering algorithm, a typical example of prototype-based objective function clustering methods. It uses a certain distance from data points to prototypes as the objective function for optimization, and uses the method of finding the extreme value of the function to obtain the adjustment rules for iterative calculation. The k-means algorithm uses Euclidean distance as the similarity measure. It seeks the optimal classification corresponding to a given initial cluster center vector, minimizing the evaluation index. The k-means algorithm uses the sum of squared errors as the clustering criterion function. DBSCAN is a density-based clustering algorithm. Unlike partitioning and hierarchical clustering methods, it defines a cluster as the largest set of density-connected points. It can divide regions with sufficiently high density into clusters and can discover clusters of arbitrary shapes in noisy spatial databases.
[0070] In some implementations, unlabeled images can be clustered using the k-means clustering method based on the feature information corresponding to each unlabeled image in the unlabeled image set. The specific clustering process is as follows: Step 1: Randomly select K unlabeled images from the unlabeled image set as centroids. Step 2: Measure the distance of each remaining unlabeled image to each centroid and assign it to the class of the nearest centroid. Step 3: Recalculate the centroids of each class that have been obtained. Step 4: Iterate from Step 2 to Step 3 until the new centroid is equal to or less than a specified threshold, thus obtaining multiple sample sets.
[0071] It should be noted that clustering unlabeled images using clustering methods is essentially adjusting the distribution of the unlabeled images. Please refer to [link / reference needed]. Figure 4 , Figure 4 This illustration shows a first comparative schematic diagram of unlabeled image distribution adjustment in an image determination method according to an embodiment of this application, wherein... Figure 4 In the example, (a) and (b) represent the same multiple unlabeled images, and, Figure 4 In the image (a), the distribution of multiple unlabeled images has not been adjusted. Figure 4In (b), the distribution of multiple unlabeled images has been adjusted, for example, Figure 4 In the image, (a) and (b) represent the same multiple unlabeled bird images. Because... Figure 4 In (a), no distribution adjustment was performed on the multiple unlabeled images. Therefore, when determining an unlabeled image as the target image based on its influence value within the unlabeled image set, all unlabeled images are treated as a whole for selection. Consequently, the type of unlabeled image selected may be relatively homogeneous, such as selecting only unlabeled image A as the target image. However, because... Figure 4 In (b), the distribution of multiple unlabeled images has been adjusted; therefore, it can be... Figure 4 In (b) of the model, multiple unlabeled images are clustered based on their corresponding feature information to obtain multiple sample sets. Unlabeled images with higher influence values are selected from each sample set. Therefore, when determining unlabeled images as to-be-labeled images based on their influence values within the unlabeled image sets, at least one unlabeled image is selected from each of the multiple sample sets. This results in a potentially richer variety of unlabeled images, leading to a more comprehensive selection and thus more accurate semi-supervised training of the model. For example, compared to... Figure 4 In (a), only the unlabeled image A is selected as the image to be labeled. Figure 4 (b) can also simultaneously filter out unlabeled image A and unlabeled image B as images to be labeled.
[0072] Please see Figure 5 , Figure 5 This illustration shows a second comparative diagram of unlabeled image distribution adjustment in an image determination method provided in one embodiment of this application, wherein... Figure 5 In the example, (a) and (b) represent the same multiple unlabeled images, and, Figure 5 In the image (a), the distribution of multiple unlabeled images has not been adjusted. Figure 5 In (b), the distribution of multiple unlabeled images has been adjusted, for example, Figure 5 In the image, (a) and (b) represent the same multiple unlabeled aircraft images. Because... Figure 5 In (a), no distribution adjustment was performed on the multiple unlabeled images. Therefore, when determining an unlabeled image as a candidate image based on its influence value within the unlabeled image set, all unlabeled images are treated as a whole for selection. Consequently, the type of unlabeled image selected may be relatively homogeneous, such as selecting only unlabeled image C as the candidate image. However, because... Figure 5In (b), the distribution of multiple unlabeled images has been adjusted; therefore, it can be... Figure 5 In (b) of the model, multiple unlabeled images are clustered based on their corresponding feature information to obtain multiple sample sets. Unlabeled images with higher influence values are selected from each sample set. Therefore, when determining unlabeled images as to-be-labeled images based on their influence values within the unlabeled image sets, at least one unlabeled image is selected from each of the multiple sample sets. This results in a potentially richer variety of unlabeled images, leading to a more comprehensive selection and thus more accurate semi-supervised training of the model. For example, compared to... Figure 5 In (a), only the unlabeled image C is selected as the image to be labeled. Figure 5 (b) can also simultaneously filter out unlabeled image C and unlabeled image D as images to be labeled.
[0073] Step S340: Based on the influence value of each unlabeled image in the unlabeled image set, determine at least one unlabeled image from the plurality of sample sets as the image to be labeled.
[0074] Please see Figure 6 , Figure 6 This application shows Figure 3 The diagram shows a flowchart of step S340 of the image determination method. The following will focus on... Figure 6 The process shown will be described in detail, and the method may specifically include the following steps:
[0075] Step S341: Obtain the number of unlabeled images included in each of the multiple sample sets.
[0076] In this embodiment, the number of unlabeled images included in each of the multiple sample sets can be obtained. For example, assuming there are C sample sets in total, the number of unlabeled images included in each of the C sample sets can be obtained, denoted as [T1, T2, ..., T...]. C ], where T1 represents that there are T1 unlabeled images in the first sample set of C sample sets, and T2 represents that there are T2 unlabeled images in the second sample set of C sample sets, T C Let T be the number of samples in the C-th sample set of C samples. C An unlabeled image.
[0077] Step S342: Based on the number of unlabeled images included in each sample set, obtain the preset value for sample extraction corresponding to each sample set.
[0078] In this embodiment, the preset value for sample extraction for each sample set can be obtained based on the number of unlabeled images included in each sample set.
[0079] In some implementations, it can be done through formulas For each sample set, the number of unlabeled images included is determined, and a preset sample extraction value is obtained for each sample set, where U e T represents the preset value for sample extraction corresponding to the e-th sample set. e Let T be the number of samples in the e-th sample set. e There are 1 unlabeled image set, where N2 represents the number of images to be labeled and N1 represents the number of unlabeled images in the set.
[0080] Step S343: Based on the influence value of each unlabeled image in the unlabeled image set and the preset sample extraction value corresponding to each sample set, determine at least one unlabeled image from the multiple sample sets as the image to be labeled.
[0081] In this embodiment, the electronic device can determine at least one unlabeled image as the image to be labeled from multiple sample sets based on the influence value of each unlabeled image in the unlabeled image set and the preset sample extraction value corresponding to each sample set.
[0082] In obtaining the preset sample extraction value for each sample set, the maximum number of unlabeled samples to be extracted from each sample set can be determined; that is, the maximum number of unlabeled samples to be extracted from each sample set is equal to the preset sample extraction value. As one approach, for each sample set, unlabeled images corresponding to the preset sample extraction value are sequentially extracted as images to be labeled, according to the order of influence values of the unlabeled images in the unlabeled image set from high to low. When the extraction of unlabeled images from multiple sample sets is completed using the above method, the unlabeled images extracted from multiple sample sets can be used as images to be labeled.
[0083] In some implementations, each unlabeled image can be sorted according to its influence value in the unlabeled image set, and multiple unlabeled images can be clustered according to the feature information corresponding to each unlabeled image in the unlabeled image set to obtain multiple sample sets and the number of unlabeled images included in each sample set. Based on the number of unlabeled images included in each sample set, a preset value for sample extraction corresponding to each sample set is obtained. Based on the preset value for sample extraction corresponding to each sample set and the arrangement order of each unlabeled image, at least one unlabeled image is determined from the multiple sample sets as the image to be labeled.
[0084] For example, suppose the unlabeled image set is divided into sample set M1 and sample set M2. The preset sampling value for sample set M1 is 3, and the order of the unlabeled images in sample set M1 is r1, r3, r5, r7, r8. The preset sampling value for sample set M2 is 2, and the order of the unlabeled images in sample set M2 is r2, r4, r6, r9, r8. 10 Then, r1, r3, and r5 can be extracted from the M1 sample set, and r2 and r4 can be extracted from the M2 image group. These 5 unlabeled images can be used as images to be labeled.
[0085] In this embodiment, multiple unlabeled images are clustered based on the similarity of their respective feature information to form multiple sample sets. This divides the multiple unlabeled images into multiple sample sets according to the similarity of their feature information. This allows for the extraction of unlabeled images with various feature information from multiple sample sets when selecting unlabeled images as labeled images based on their influence values in the sample image sets. In other words, the unlabeled images extracted as labeled images are more balanced, resulting in higher accuracy when the model trained on the determined labeled images performs image recognition.
[0086] Please see Figure 7 , Figure 7 A flowchart illustrating an embodiment of the image determination method provided in this application is shown. The following will focus on... Figure 7 The process shown will be described in detail. The image determination method may specifically include the following steps:
[0087] Step S410: Obtain an unlabeled image set and the feature information corresponding to each unlabeled image in the unlabeled image set, wherein the unlabeled image set includes multiple unlabeled images.
[0088] For a detailed description of step S410, please refer to step S110, which will not be repeated here.
[0089] Step S420: Obtain the loss value set corresponding to the unlabeled image set. The loss value set includes the loss value corresponding to each unlabeled image in the unlabeled image set when the feature extraction model training converges. The feature extraction model is used to extract the feature information corresponding to each of the multiple unlabeled images.
[0090] In this embodiment, the loss value corresponding to each unlabeled image in the unlabeled image set can be obtained when the feature extraction model training converges, thus obtaining a set of multiple loss values for the unlabeled image set. The feature extraction model is used to extract the feature information corresponding to each of the multiple unlabeled images.
[0091] In some implementations, after obtaining the feature information corresponding to each unlabeled image in each unlabeled image set, the feature information corresponding to each unlabeled image in the unlabeled image set can be calculated by a second preset algorithm to obtain the loss value corresponding to each unlabeled image in the unlabeled image set when the feature extraction model training converges. The feature information corresponding to each unlabeled image in the unlabeled image set is extracted by the converged feature extraction model.
[0092] As one possible implementation, the second preset algorithm may include After obtaining the feature information corresponding to each unlabeled image in the unlabeled image set, it is possible to... The feature information corresponding to each unlabeled image in the unlabeled image set is calculated to obtain the loss value corresponding to each unlabeled image in the unlabeled image set when the feature extraction model training converges.
[0093] Step S430: Obtain the similarity set corresponding to the unlabeled image set, the similarity set including the similarity of feature information between each unlabeled image in the unlabeled image set and each unlabeled image other than the unlabeled image itself.
[0094] In this embodiment, the similarity of feature information between each unlabeled image in the unlabeled image set and each unlabeled image other than the unlabeled image can be obtained to obtain multiple similarities as a similarity set corresponding to the unlabeled image set.
[0095] In some implementations, Euclidean distance and cosine similarity can be used to calculate the similarity between images, and this is not limited to any particular implementation. One approach is to calculate the similarity of feature information between any two unlabeled images by using Euclidean distance to analyze the feature information of each of the multiple unlabeled images. Another approach is to calculate the similarity of feature information between any two unlabeled images by using cosine similarity. It should be noted that Euclidean distance is the actual distance between two points in n-dimensional space. When calculating the similarity of unlabeled images using Euclidean distance, the smaller the Euclidean distance, the greater the similarity between the unlabeled images. Cosine similarity measures the cosine of the angle between two vectors; the more similar the two vectors, the smaller the angle and the closer the cosine value is to 1.
[0096] Step S440: Based on the loss value set and the similarity set, determine the influence value of each unlabeled image in the unlabeled image set.
[0097] In this embodiment, the influence value of each unlabeled image in the unlabeled image set can be determined based on the loss value set and the similarity set. That is, the influence value of each unlabeled image in the unlabeled image set can be determined based on the loss value corresponding to each unlabeled image in the unlabeled image set when the feature extraction model training converges, and the similarity of the feature information of each unlabeled image in the unlabeled image set with each other unlabeled image.
[0098] In some implementations, the influence value of each unlabeled image in the unlabeled image set can be obtained by calculating the loss value corresponding to each unlabeled image in the unlabeled image set when the feature extraction model training converges, and the similarity of the feature information of each unlabeled image in the unlabeled image set with each other unlabeled image, according to a first preset algorithm. As one implementable approach, the first preset algorithm can be... Then according to Determine the influence value of each unlabeled image in the set of unlabeled images.
[0099] Step S450: Based on the influence value of each unlabeled image in the unlabeled image set and the feature information corresponding to each unlabeled image in the unlabeled image set, determine at least one unlabeled image from the unlabeled image set as an image to be labeled.
[0100] For a detailed description of step S450, please refer to step S130, which will not be repeated here.
[0101] In this embodiment, the influence value of each unlabeled image in the unlabeled image set is determined based on the similarity of the feature information of each unlabeled image in the unlabeled image set with each unlabeled image other than the unlabeled image itself, as well as the loss value corresponding to each unlabeled image in the unlabeled image set when the feature extraction model training converges. This improves the efficiency of determining the influence value of each unlabeled image in the unlabeled image set, thereby improving the efficiency of subsequent unlabeled image selection based on influence value and the training efficiency of the model.
[0102] In some implementations, the unlabeled sample image set is used as an example of an unlabeled face image set.
[0103] When filtering unlabeled face images in an unlabeled face image set, the first step is to obtain the feature information of the face corresponding to each unlabeled face image in the set. For example, the number of organs, organ integrity, and organ clarity of each unlabeled face image in the set can be obtained.
[0104] Then, based on the feature information of the faces corresponding to each unlabeled face image in the unlabeled face image set, the influence value of each unlabeled face image in the unlabeled face image set is determined. It can be understood that when the feature information on the face is the number of organs, the influence value of an unlabeled face image with more organs is greater than that of an unlabeled face image with fewer organs; when the feature information on the face is the organ completeness, the influence value of an unlabeled face image with higher organ completeness is greater than that of an unlabeled face image with lower organ completeness; and when the feature information on the face is the organ sharpness, the influence value of an unlabeled face image with higher organ sharpness is greater than that of an unlabeled face image with lower organ sharpness.
[0105] Taking the number of organs on a human face as an example, assume that the set of unlabeled face images includes unlabeled face image 1, unlabeled face image 2, unlabeled face image 3, unlabeled face image 4... unlabeled face image N, and face image 1 includes two eyes, a nose, a mouth, and two ears; face image 2 includes two eyes, a nose, a mouth, and two ears; face image 3 includes a mouth; and face image 4 includes a nose and a mouth. In the example above, both unlabeled face image 1 and unlabeled face image 2 include complete face images. Assuming that unlabeled face image 1 has a greater influence among the N unlabeled face images and unlabeled face image 2 has a smaller influence among the N unlabeled face images, if the influence value of unlabeled face image 1 among the N unlabeled face images is greater than a preset influence value and the influence value of unlabeled face image 2 among the N unlabeled face images is less than the preset influence value, then unlabeled face image 1 can be selected as the face image to be labeled from the N unlabeled face images, instead of unlabeled face image 2. In the example above, both unlabeled face image 3 and unlabeled face image 4 only include a portion of the face images. Assuming that unlabeled face image 3 has a greater influence among the N unlabeled face images and unlabeled face image 4 has a smaller influence among the N unlabeled face images, if the influence value of unlabeled face image 3 among the N unlabeled face images is greater than a preset influence value and the influence value of unlabeled face image 4 among the N unlabeled face images is less than the preset influence value, then unlabeled face image 3 can be selected as the face image to be labeled from the N unlabeled face images, instead of unlabeled face image 4.
[0106] Finally, based on the feature information of each unlabeled face image in the unlabeled face image set and the influence value of each unlabeled face image in the set, more representative unlabeled face images can be selected as the face images to be labeled. These labeled face images can then be used to train face recognition models and other face image-related models. It is understandable that because the face images used for model training are representative, the face recognition model trained using these labeled face images can achieve higher recognition accuracy in subsequent application stages.
[0107] Referring to the above description of unlabeled sample images as a set of face images, this unlabeled sample image set can include an authentication dataset, which may include a large number of face images and ID photos. For this authentication dataset, the evaluation metrics proposed by the image determination method provided in this application embodiment can be used to evaluate each image in the authentication dataset, ultimately extracting several evenly distributed high-quality images for subsequent use. As one approach, a portion of the data in the authentication dataset can be used as training data, and another portion can be used as test data. The amount of data in each portion can be flexibly configured as needed and is not limited here. By using the image determination method proposed in this application, initial screening can be provided for subsequent work such as manual screening, cleaning, and annotation. Blurred samples and samples with weak representativeness can be effectively removed, resulting in a uniformly distributed sample set that covers a relatively comprehensive range of data types (such as various face shapes), making subsequent training more effective.
[0108] In some implementations, when the unlabeled sample image set is an unlabeled text image set, the text feature information corresponding to each unlabeled text image in the unlabeled text image set can be obtained. The text feature information may include features such as the stroke features and the strength features of the text. Based on the text feature information corresponding to each unlabeled text image in the unlabeled text image set, the influence value of each unlabeled text image in the unlabeled text image set is determined. Then, based on the text feature information corresponding to each unlabeled text image in the unlabeled text image set and the influence value of each unlabeled text image in the unlabeled text image set, at least one unlabeled text image is determined from the unlabeled text image set as a text image to be labeled. The text image to be labeled can be used for training font image-related models such as font recognition model training, and is not limited here.
[0109] In some implementations, when the unlabeled sample image set is an unlabeled animal image set, animal feature information corresponding to each unlabeled animal image in the unlabeled animal image set can be obtained. The animal feature information may include animal morphological features, animal skin features, and animal hair features, etc. Based on the animal feature information corresponding to each unlabeled animal image in the unlabeled animal image set, the influence value of each unlabeled animal image in the unlabeled animal image set is determined. Then, based on the animal feature information corresponding to each unlabeled animal image in the unlabeled animal image set and the influence value of each unlabeled animal image in the unlabeled animal image set, at least one unlabeled animal image is determined from the unlabeled animal image set as an animal image to be labeled. The animal image to be labeled can be used for training animal recognition models, animal image classification, and other animal image-related models, and is not limited here.
[0110] In some implementations, when the unlabeled sample image set is an unlabeled object image set, the object feature information corresponding to each unlabeled object image in the unlabeled object image set can be obtained. The object feature information may include the object's shape features, texture features, spatial relationship features, and color features, etc. Based on the object feature information corresponding to each unlabeled object image in the unlabeled object image set, the influence value of each unlabeled object image in the unlabeled object image set is determined. Based on the object feature information corresponding to each unlabeled object image in the unlabeled object image set and the influence value of each unlabeled object image in the unlabeled object image set, at least one unlabeled object image is determined from the unlabeled object image set as an object image to be labeled. The object image to be labeled can be used for training object recognition models, object image classification, and other object image-related models, and is not limited here.
[0111] Please see Figure 8 , Figure 8 A block diagram of an image determining apparatus according to an embodiment of this application is shown. This image determining apparatus 200 is applied to the aforementioned electronic device, and will be discussed below. Figure 8 The image determination device 200, illustrated in the block diagram, includes: a feature information acquisition module 210, an influence value determination module 220, and an image determination module 230, wherein:
[0112] The feature information acquisition module 210 is used to acquire an unlabeled image set and the feature information corresponding to each unlabeled image in the unlabeled image set, wherein the unlabeled image set includes multiple unlabeled images.
[0113] The influence value determination module 220 is used to determine the influence value of each unlabeled image in the unlabeled image set based on the feature information corresponding to each unlabeled image in the unlabeled image set.
[0114] Furthermore, the influence value determination module 220 includes: a loss value acquisition submodule, a feature information similarity acquisition submodule, and a first influence value determination submodule, wherein:
[0115] The loss value acquisition submodule is used to acquire the loss value set corresponding to the unlabeled image set. The loss value set includes the loss value corresponding to each unlabeled image in the unlabeled image set when the feature extraction model training converges. The feature extraction model is used to extract the feature information corresponding to each of the multiple unlabeled images.
[0116] The feature information similarity acquisition submodule is used to acquire the similarity set corresponding to the unlabeled image set. The similarity set includes the similarity of feature information between each unlabeled image in the unlabeled image set and each unlabeled image other than the unlabeled image itself.
[0117] The first influence value determination submodule is used to determine the influence value of each unlabeled image in the unlabeled image set based on the loss value set and the similarity set.
[0118] Furthermore, the first influence value determination submodule includes: an influence value determination unit, wherein:
[0119] Influence value determination unit, used for determining the value based on Determine the influence value of each unlabeled image in the set of unlabeled images, where S 1p The influence value of an unlabeled image in the set of unlabeled images is used to characterize the influence of the unlabeled image. The loss value representing the unlabeled image during the convergence of the feature extraction model training is sim(), and the similarity of the feature information of each unlabeled image with all other unlabeled images except itself is sim(). f represents the feature information of an unlabeled image. θ Characteristic feature extraction model, x p and x q The unlabeled image is represented among the plurality of unlabeled images.
[0120] The image determination module 230 is used to determine at least one unlabeled image as an image to be labeled from the unlabeled image set based on the influence value of each unlabeled image in the unlabeled image set and the feature information corresponding to each unlabeled image in the unlabeled image set.
[0121] Furthermore, the image determination module 230 includes: an unlabeled image determination submodule and a first image to be labeled determination submodule, wherein:
[0122] The unlabeled image determination submodule is used to determine unlabeled images with an influence value greater than a preset influence value from the unlabeled image set based on the influence value of each unlabeled image in the unlabeled image set.
[0123] The first unlabeled image determination submodule is used to determine at least one unlabeled image as an unlabeled image from the unlabeled images with an influence value greater than a preset influence value, based on the feature information corresponding to each unlabeled image in the unlabeled image set.
[0124] Furthermore, the image determination module 230 also includes: a clustering submodule and a second image to be labeled determination submodule, wherein:
[0125] The clustering submodule is used to cluster the multiple unlabeled images based on the feature information corresponding to each unlabeled image in the unlabeled image set to obtain multiple sample sets. Each of the multiple sample sets includes at least two of the unlabeled images, and the similarity of the feature information of the at least two unlabeled images included in each sample set is greater than a preset similarity.
[0126] The second unlabeled image determination submodule is used to determine at least one unlabeled image as the unlabeled image from the plurality of sample sets based on the influence value of each unlabeled image in the unlabeled image set.
[0127] Furthermore, the second image to be labeled determination submodule includes: a unit for acquiring the number of unlabeled images, a unit for acquiring preset values for sample extraction, and a third image to be labeled determination unit, wherein:
[0128] The unlabeled image quantity acquisition unit is used to acquire the number of unlabeled images included in each of the plurality of sample sets.
[0129] The sample extraction preset value acquisition unit is used to acquire the sample extraction preset value corresponding to each sample set based on the number of unlabeled images included in each sample set.
[0130] The third unlabeled image determination unit is used to determine at least one unlabeled image as the unlabeled image from the plurality of sample sets based on the influence value of each unlabeled image in the unlabeled image set and the sample extraction preset value corresponding to each sample set.
[0131] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the above-described device and module can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0132] In the several embodiments provided in this application, the coupling between modules can be electrical, mechanical, or other forms of coupling.
[0133] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.
[0134] Please see Figure 9 This diagram illustrates a structural block diagram of an electronic device 100 provided in an embodiment of this application. The electronic device 100 can be a smartphone, tablet computer, e-reader, or other electronic device capable of running applications. The electronic device 100 in this application may include one or more of the following components: a processor 110, a memory 120, a touchscreen 130, and one or more applications. The one or more applications may be stored in the memory 120 and configured to be executed by one or more processors 110. The one or more applications are configured to perform the methods described in the foregoing method embodiments.
[0135] The processor 110 may include one or more processing cores. The processor 110 connects to various parts within the electronic device 100 using various interfaces and lines, and performs various functions and processes data by running or executing instructions, programs, code sets, or instruction sets stored in the memory 120, and by calling data stored in the memory 120. Optionally, the processor 110 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 110 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the content to be displayed; and the modem handles wireless communication. It is understood that the modem may also not be integrated into the processor 110 and may be implemented separately using a communication chip.
[0136] The memory 120 may include random access memory (RAM) or read-only memory (ROM). The memory 120 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 120 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as touch functionality, sound playback functionality, image playback functionality, etc.), and instructions for implementing the various method embodiments described below. The data storage area may also store data created by the terminal 100 during use (such as phonebook data, audio and video data, chat log data, etc.).
[0137] The touchscreen 130 is used to display information input by the user, information provided to the user, and various graphical user interfaces of the electronic device 100. These graphical user interfaces can be composed of graphics, text, icons, numbers, video, and any combination thereof. In one example, the touchscreen 130 can be a liquid crystal display (LCD) or an organic light-emitting diode (OLED), without limitation.
[0138] Please see Figure 10This diagram illustrates a structural block diagram of a computer-readable storage medium provided in an embodiment of this application. The computer-readable medium 300 stores program code that can be called by a processor to execute the methods described in the above method embodiments.
[0139] The computer-readable storage medium 300 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM. Optionally, the computer-readable storage medium 300 includes a non-transitory computer-readable storage medium. The computer-readable storage medium 300 has storage space for program code 310 that performs any of the method steps described above. This program code can be read from or written to one or more computer program products. The program code 310 may be compressed, for example, in a suitable form.
[0140] A computer program product includes a computer program / instructions that, when executed by a processor, implement the steps of the above-described method.
[0141] In summary, the image determination method, apparatus, electronic device, and storage medium provided in this application first obtain an unlabeled image set and the feature information corresponding to each unlabeled image in the unlabeled image set. Then, based on the feature information corresponding to each unlabeled image in the unlabeled image set, the influence value of each unlabeled image in the unlabeled image set is determined. Furthermore, based on the influence value of each unlabeled image in the unlabeled image set and the feature information corresponding to each unlabeled image in the unlabeled image set, more representative unlabeled images can be selected from the unlabeled image set as images to be labeled. This results in higher accuracy when the model trained on the determined images to be labeled performs image recognition.
[0142] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. An image determination method, characterized in that, The method includes: Obtain an unlabeled image set and the feature information corresponding to each unlabeled image in the unlabeled image set, wherein the unlabeled image set includes multiple unlabeled images, and the feature information is obtained by extracting the content of the unlabeled images based on a feature extraction model, wherein the feature extraction model is obtained by comparative learning training through the unlabeled image set; Based on the preset algorithm, the loss value corresponding to each unlabeled image when the feature extraction model training converges, and the similarity of the feature information of each unlabeled image with each unlabeled image other than the unlabeled image are calculated to obtain the influence value of each unlabeled image in the unlabeled image set. Based on the influence value of each unlabeled image in the unlabeled image set and the feature information corresponding to each unlabeled image in the unlabeled image set, at least one unlabeled image is determined from the unlabeled image set as an image to be labeled; wherein, the multiple unlabeled images are divided into multiple sample sets formed by clustering based on their respective feature information, and the image to be labeled is determined according to the number of unlabeled images included in each sample set and the influence value.
2. The method according to claim 1, characterized in that, The unlabeled image set can be any one of the following: unlabeled face image set, unlabeled text image set, unlabeled animal image set, and unlabeled object image set.
3. The method according to claim 1, characterized in that, The step of determining at least one unlabeled image as an image to be labeled from the unlabeled image set based on the influence value of each unlabeled image in the unlabeled image set and the feature information corresponding to each unlabeled image in the unlabeled image set includes: Based on the feature information corresponding to each unlabeled image in the unlabeled image set, the multiple unlabeled images are clustered to obtain multiple sample sets. Each of the multiple sample sets includes at least two of the unlabeled images, and the similarity of the feature information of the at least two unlabeled images included in each sample set is greater than a preset similarity. Based on the influence value of each unlabeled image in the set of unlabeled images, at least one unlabeled image is determined from the plurality of sample sets as the image to be labeled.
4. The method according to claim 3, characterized in that, The step of determining at least one unlabeled image as the image to be labeled from the plurality of sample sets based on the influence value of each unlabeled image in the unlabeled image set includes: Obtain the number of unlabeled images included in each of the multiple sample sets; Based on the number of unlabeled images included in each sample set, obtain the preset value for sample extraction corresponding to each sample set; Based on the influence value of each unlabeled image in the unlabeled image set and the preset sample extraction value corresponding to each sample set, at least one unlabeled image is determined from the multiple sample sets as the image to be labeled.
5. The method according to claim 4, characterized in that, The step of obtaining the influence value of each unlabeled image in the unlabeled image set includes: based on Determine the influence value of each unlabeled image in the set of unlabeled images, where, The influence value of an unlabeled image in the set of unlabeled images is used to characterize the influence of the unlabeled image. The loss value of unlabeled images during the convergence of feature extraction model training. Characterizes the similarity of feature information between each unlabeled image in the unlabeled image set and every other unlabeled image except the given unlabeled image. Characterize the feature information of unlabeled images. Characteristic feature extraction model and Each unlabeled image in the unlabeled image set is represented.
6. An image determining device, characterized in that, The device includes: The feature information acquisition module is used to acquire an unlabeled image set and the feature information corresponding to each unlabeled image in the unlabeled image set, wherein the unlabeled image set includes multiple unlabeled images, and the feature information is obtained by extracting the content of the unlabeled images based on a feature extraction model, wherein the feature extraction model is obtained by comparative learning training of the unlabeled image set; The influence value determination module is used to calculate the loss value corresponding to each unlabeled image when the feature extraction model training converges, and the similarity of the feature information of each unlabeled image with each unlabeled image other than the unlabeled image itself, so as to obtain the influence value of each unlabeled image in the set of unlabeled images. An image determination module is used to determine at least one unlabeled image as an image to be labeled from the unlabeled image set based on the influence value of each unlabeled image in the unlabeled image set and the feature information corresponding to each unlabeled image in the unlabeled image set; wherein, the multiple unlabeled images are divided into multiple sample sets formed by clustering based on their respective feature information, and the image to be labeled is determined according to the number of unlabeled images included in each sample set and the influence value.
7. An electronic device, characterized in that, The method includes a memory and a processor, the memory being coupled to the processor, the memory storing instructions, and the processor performing the method as described in any one of claims 1-5 when the instructions are executed by the processor.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium contains program code that can be invoked by a processor to execute the method as described in any one of claims 1-5.
9. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method described in any one of claims 1-5.