Sample image label processing method and device and electronic equipment
Patent Information
- Application Number
- CN202211479262.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-24
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2042-11-24
AI Technical Summary
[0004]在现有的一些数据清洗方式中,采用人工修正的方式,虽然准确度高,但成本高效率低;基于模型检测的方式能够识别出一些离群样本,但无法很好地应对同类别之内数据一致性较差的情形;基于聚类分析的方式中,聚类方向不一定会按照理想的方向聚集,并且其聚类结果非常受参数和数据分布的影响,例如,密度大的簇可能会合并密度小的簇
[0040]本申请实施例提供的一种样本图像标签处理方法、装置及电子设备,通过从待处理样本图像中筛选出一部分作为标准样本图像,将需要进行分类标签调整的目标样本图像与标准样本图像进行特征相似度比对,然后根据特征相似度比对的结果,基于标准样本图像的分类标签调整目标样本图像的分类标签。如此,可以在不引入更多数据、无监督的情况下,自动地实现海量待处理样本图像的分类标签清洗。
Smart Images

Figure CN115713658B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of big data processing technology, and more specifically, to a sample image label processing method, apparatus, and electronic device. Background Technology
[0002] In big data processing scenarios, the quality of the data to be processed usually has a decisive impact on the processing results. However, obtaining a sufficient amount of data to be processed may not be difficult, but obtaining accurate, reliable, and clean data is relatively difficult.
[0003] For example, in big data processing scenarios involving image processing, it may be necessary to use a large number of sample images for training or processing. Sample image data typically includes the image ontology and corresponding classification labels. In a sample set with massive amounts of sample images, the classification labels of each sample image may be automatically labeled by multiple models. This can lead to problems such as inconsistent sample features within the same category and discrepancies in sample classification labels. A sample set with messy classification labels is difficult to use in subsequent big data processing workflows. Therefore, it is necessary to clean and adjust the classification labels of the sample images.
[0004] Among existing data cleaning methods, manual correction is highly accurate but costly and inefficient. Model-based detection can identify outliers but cannot effectively handle situations where data within the same category has poor consistency. In cluster analysis, the clustering direction may not follow the ideal direction, and the clustering results are highly affected by parameters and data distribution; for example, high-density clusters may merge with low-density clusters. Summary of the Invention
[0005] To overcome the aforementioned shortcomings in the prior art, the purpose of this application is to provide a sample image labeling method, the method comprising:
[0006] Obtain multiple sample images to be processed and the first classification label corresponding to each sample image to be processed;
[0007] Multiple standard sample images are obtained by filtering from the multiple sample images to be processed;
[0008] The feature extraction model is used to extract features from each of the sample images to be processed, thereby obtaining the image feature information corresponding to each of the sample images to be processed.
[0009] For the target sample images other than the standard sample images in the sample images to be processed, the adjusted second classification label of the target sample image is determined based on the similarity of the image feature information between the target sample image and each of the standard sample images and the first classification label of each of the standard sample images.
[0010] In one possible implementation, the step of filtering from the plurality of sample images to be processed to obtain a plurality of standard sample images includes:
[0011] A classification model is trained by using multiple sample images to be processed, and the trained classification model is obtained.
[0012] The classification model is used to classify and identify each of the sample images to be processed, and the predicted classification result corresponding to each of the sample images to be processed is obtained.
[0013] Based on the predicted classification results of each of the sample images to be processed and the first classification label, the label confidence of each of the sample images to be processed is determined;
[0014] The sample images to be processed that have a label confidence level greater than a preset confidence threshold are identified as the standard sample images.
[0015] In one possible implementation, the step of extracting features from each of the sample images to be processed using a feature extraction model to obtain image feature information corresponding to each of the sample images to be processed includes:
[0016] For each of the sample images to be processed, the sample image to be processed is used as an anchor sample, the transformed image of the sample image to be processed is used as a positive sample, and the other sample images to be processed are used as negative samples, so as to minimize the feature distance between the anchor sample and the positive sample and maximize the feature distance between the anchor sample and the negative sample, a feature extraction model is trained.
[0017] The feature extraction model is used to extract features from each of the sample images to be processed, thereby obtaining the image feature information corresponding to each sample image to be processed.
[0018] In one possible implementation, the step of using the transformed image of the sample image to be processed as a positive sample includes:
[0019] The image after cropping and / or rotating the sample image to be processed is used as the positive sample.
[0020] In one possible implementation, the step of determining the adjusted second classification label of the target sample image based on the similarity of image feature information between the target sample image and each of the standard sample images and the first classification label of each of the standard sample images includes:
[0021] The standard sample images are sorted according to the similarity of image feature information between the target sample image and each of the standard sample images;
[0022] Based on the sorting results, a first preset number of standard sample images whose image feature information is closest to that of each of the standard sample images are determined as candidate sample images;
[0023] The adjusted second classification label of the target sample image is determined based on the sorting position of each candidate sample image and the first classification label of each candidate sample image.
[0024] In one possible implementation, the step of determining the adjusted second classification label of the target sample image based on the sorting position of each of the candidate sample images and the first classification label of each of the candidate sample images includes:
[0025] The contribution value is determined according to the sorting position of each candidate sample image, wherein the candidate sample image with greater similarity to the image feature information between each standard sample image has a greater contribution value.
[0026] The sum of the contribution values of the candidate sample images with the same first classification label is calculated as the weight value corresponding to the first classification label;
[0027] The first classification label with the highest weight value is used as the adjusted second classification label of the target sample image.
[0028] In one possible implementation, before the step of determining the adjusted second classification label of the target sample image based on the sorting position of each of the candidate sample images and the first classification label of each of the candidate sample images, the method further includes:
[0029] Determine the number of candidate sample images whose first classification label differs from the target sample image;
[0030] If the number of candidate sample images whose first classification label is different from the target sample image is less than or equal to a second preset number, then the first classification label of the target sample image is used as the second classification label of the target sample image; the second preset number is less than the first preset number.
[0031] If the number of candidate sample images whose first classification label is different from the target sample image is greater than the second preset number, then the process jumps to the step of determining the adjusted second classification label of the target sample image based on the sorting position of each candidate sample image and the first classification label of each candidate sample image.
[0032] Another object of this application is to provide a sample image labeling device, the device comprising:
[0033] The data acquisition module is used to acquire multiple sample images to be processed and the first classification label corresponding to each sample image to be processed;
[0034] A sample screening module is used to screen multiple standard sample images from multiple sample images to be processed;
[0035] The feature extraction module is used to extract features from each of the sample images to be processed using a feature extraction model, and to obtain the image feature information corresponding to each of the sample images to be processed.
[0036] The label adjustment module is used to determine the adjusted second classification label of the target sample image based on the similarity of the image feature information between the target sample image and each of the standard sample images and the first classification label of each of the standard sample images in the sample images to be processed.
[0037] Another objective of this application is to provide an electronic device, including a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions, and the machine-executable instructions, when executed by the processor, implement the sample image label processing method provided in this application.
[0038] Another objective of this application is to provide a machine-readable storage medium, characterized in that the machine-readable storage medium stores machine-executable instructions, which, when executed by one or more processors, implement the sample image label processing method provided in this application.
[0039] Compared with the prior art, this application has the following beneficial effects:
[0040] This application provides a sample image labeling processing method, apparatus, and electronic device. By selecting a portion of the sample images to be processed as standard sample images, comparing the feature similarity between the target sample image requiring classification label adjustment and the standard sample images, and then adjusting the classification label of the target sample image based on the classification label of the standard sample image according to the feature similarity comparison result, the classification label of the target sample image can be adjusted automatically. In this way, classification label cleaning of massive amounts of sample images to be processed can be automatically achieved without introducing more data or in an unsupervised manner. Attached Figure Description
[0041] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0042] Figure 1 This is a flowchart illustrating the steps of the sample image label processing method provided in the embodiments of this application;
[0043] Figure 2 This is a flowchart illustrating the sub-steps of step S120;
[0044] Figure 3 This is a flowchart illustrating the sub-steps of step S130;
[0045] Figure 4 This is a flowchart illustrating the sub-steps of step S140;
[0046] Figure 5 A schematic diagram of an electronic device provided in an embodiment of this application;
[0047] Figure 6 A schematic diagram of the functional modules of the sample image label processing device provided in the embodiments of this application. Detailed Implementation
[0048] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, 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. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0049] Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0050] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0051] In the description of this application, it should be noted that the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0052] In the description of this application, it should also be noted that, unless otherwise explicitly specified and limited, the terms "set," "install," "connect," and "link" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances. The embodiments provided...
[0053] Please refer to Figure 1 , Figure 1 This is a flowchart illustrating the steps of a sample image labeling method provided in this embodiment. The steps of the method are described in detail below.
[0054] Step S110: Obtain multiple sample images to be processed and the first classification label corresponding to each sample image to be processed.
[0055] In this embodiment, the first classification label corresponding to the multiple sample images to be processed can be a classification label labeled by multiple models. Among them, multiple may be due to problems such as inconsistent sample features and discrepancies in sample classification labels in the same category among the sample images to be processed.
[0056] Step S120: Select multiple standard sample images from the multiple sample images to be processed.
[0057] In this embodiment, a portion of the sample images to be processed can be selected as standard sample images from a plurality of sample images to be processed. The number of standard sample images is less than the total number of sample images to be processed. The standard sample images and their corresponding first classification labels will serve as the benchmark for adjusting the classification labels of other sample images to be processed subsequently. Therefore, in this embodiment, the standard sample images can be sample images with relatively accurate first classification labels.
[0058] Step S130: Feature extraction is performed on each of the sample images to be processed using a feature extraction model to obtain image feature information corresponding to each sample image to be processed.
[0059] In this embodiment, features can be extracted from each of the images to be processed using a machine learning-based feature extraction model. In one example, image feature information can be first obtained from each of the standard sample images and recorded to form a feature library. Then, in subsequent processing, feature extraction and comparison are performed sequentially on the images to be processed other than the standard sample images.
[0060] Step S140: For the target sample images other than the standard sample images in the sample images to be processed, determine the adjusted second classification label of the target sample image based on the similarity of the image feature information between the target sample image and each of the standard sample images and the first classification label of each of the standard sample images.
[0061] In this embodiment, the images to be processed, excluding the standard sample images, can be sequentially used as target sample images. The image feature information of the target sample images is compared with the features of each of the standard sample images in the feature library. Then, based on the similarity of the image feature information between the target sample images and each of the standard sample images, the first classification label of the standard sample images is used as a benchmark to adjust the first classification label of the target sample images, thereby obtaining the adjusted second classification label of the target sample images.
[0062] Based on the above design, a subset of the sample images to be processed is selected as standard sample images. The target sample images requiring classification label adjustment are then compared with the standard sample images in terms of feature similarity. Based on the results of the feature similarity comparison, the classification labels of the target sample images are adjusted according to the classification labels of the standard sample images. In this way, classification label cleaning of massive amounts of sample images to be processed can be automatically achieved without introducing more data and without supervision.
[0063] In one possible implementation, please refer to Figure 2Step S120 may include the following sub-steps.
[0064] Step S121: Train a classification model using multiple sample images to be processed to obtain the trained classification model.
[0065] In this embodiment, the classification model can be a deep learning-based convolutional neural network classification model, such as the ResNet50 model. In step S121, the classification model can be trained using multiple sample images to be processed against the first classification label until the classification results of the classification model for the multiple sample images to be processed converge or the number of training iterations reaches a preset threshold.
[0066] Step S122: Classify and identify each of the sample images to be processed using the classification model to obtain the predicted classification result corresponding to each sample image to be processed.
[0067] In this embodiment, after training the classification model, it is used to classify and recognize multiple images to be processed, thereby obtaining the predicted classification result corresponding to each image to be processed. The predicted classification result can be the classification confidence level corresponding to multiple different classification labels. It is possible that the predicted classification result for some of the images to be processed differs from the first classification label.
[0068] Step S123: Determine the label confidence level of each of the sample images to be processed based on the predicted classification result and the first classification label.
[0069] In this embodiment, for each of the sample images to be processed, the label execution degree corresponding to the image to be processed can be determined based on the similarity between the predicted classification result and the first classification label. For example, the classification execution degree of the predicted classification result of the sample image to be processed, which corresponds to the classification label of the first classification label inherent in the sample image to be processed, can be determined as the label confidence degree of the sample image to be processed.
[0070] Step S124: The sample images to be processed that have a label confidence level greater than a preset confidence threshold are determined as the standard sample images.
[0071] In this embodiment, multiple sample images to be processed that have a label confidence level greater than a set threshold can be selected as standard sample images, one by one, for each category. For example, 500 sample images to be processed that have the highest label confidence level and a confidence value greater than 0.9 can be selected as standard sample images, one by one, for each category.
[0072] Based on the above design, although there is a certain proportion of divergence in the first classification labels among the multiple sample images to be processed, which may cause the classification model to be interfered with by erroneous information during the learning process, since the first classification labels of the multiple images to be processed are generally correct, the trained classification model can have a certain recognition ability. Thus, the label confidence obtained by the classification model can be used as the benchmark for subsequent adjustment of the classification labels.
[0073] Furthermore, in this step, the training is performed entirely using the first classification label of the sample image to be processed itself, which can achieve the screening of the standard sample image without introducing more data and without supervision.
[0074] In one possible implementation, please refer to Figure 3 Step S130 may include the following sub-steps.
[0075] Step S131: For each of the sample images to be processed, the sample image to be processed is used as an anchor sample, the transformed image of the sample image to be processed is used as a positive sample, and the other sample images to be processed are used as negative samples, so as to minimize the feature distance between the anchor sample and the positive sample and maximize the feature distance between the anchor sample and the negative sample, and train a feature extraction model.
[0076] Optionally, in this embodiment, the image after random cropping and / or rotation of the sample image to be processed can be used as a positive sample.
[0077] Specifically, in one possible implementation, to discriminately embed all the sample images to be processed into the vector space, this embodiment can employ the MoCo V2 algorithm from unsupervised learning to train a feature extraction model. Here, the sample images to be processed are used as anchor samples, the images of the sample images to be processed after cropping and / or rotation are used as positive samples of the anchor samples, and the other images to be processed are used as negative samples of the anchor samples. The training objective is to minimize the feature distance between the anchor samples and positive samples, and maximize the feature distance between the anchor samples and negative samples, as shown in Equation 1:
[0078] distance(f(x),f(x + ))>>distance(f(x),f(n)) Formula (1)
[0079] In the formula, x represents the anchor sample; x + Let represent the positive sample; n represents the negative sample. The loss function is InfoNCELoss, as shown in Equation 2:
[0080]
[0081] In the formula, k represents the number of negative samples, and i represents the negative sample index.
[0082] Step S132: The feature extraction model is used to extract features from each of the sample images to be processed, and the image feature information corresponding to each sample image to be processed is obtained.
[0083] Specifically, for the standard sample image, the extracted image feature information can be saved to a feature library for subsequent comparison. For other sample images to be processed besides the standard sample image, features can be extracted sequentially in subsequent comparisons and compared with the image features in the feature library.
[0084] In one possible implementation, please refer to Figure 4 Step S140 may include the following sub-steps.
[0085] Step S141: Sort the standard sample images according to the similarity of the image feature information between the target sample image and each of the standard sample images.
[0086] Among them, the standard sample images with higher similarity are ranked earlier.
[0087] Step S142: Based on the sorting results, determine a first preset number of standard sample images whose image feature information is closest to that of each of the standard sample images as candidate sample images.
[0088] Step S143: Determine the adjusted second classification label of the target sample image based on the sorting position of each candidate sample image and the first classification label of each candidate sample image.
[0089] Specifically, in step S143, the corresponding contribution value can be determined first according to the sorting position of each candidate sample image, wherein the candidate sample image with greater similarity to the image feature information between each standard sample image has a greater contribution value.
[0090] Then, the sum of the contribution values of the candidate sample images with the same first classification label is calculated as the weight value corresponding to the first classification label.
[0091] Then, the first classification label with the highest weight value is used as the adjusted second classification label of the target sample image.
[0092] For example, after comparing the similarity of the image feature information between the target sample image and each of the standard sample images, the 20 standard sample images with the highest similarity values are determined as the candidate sample images.
[0093] Then, based on the sorting position of each candidate sample image, its corresponding contribution value is calculated using Formula 3:
[0094]
[0095] Among them, score i The top value represents the contribution value of candidate sample image i; n represents the first preset number (n = 20 in the above scenario); i This indicates the sorting position of candidate sample image i. If the sorting position of candidate sample image i is top... i =1 indicates that candidate sample image i is the most similar matching result to the target sample image, and its contribution is Similarly, if top i If the weight is 2, then the weight is 23.03. The exponential function allows images ranked lower to decay rapidly, thus making the earlier-ranked candidate images more representative.
[0096] Then, the sum of the contribution values of the candidate sample images with the same first classification label is calculated. For example, if four of the 20 standard sample images have the first classification label C1, the standard sample images corresponding to the four standard sample images are added together to obtain the weight value corresponding to C1; correspondingly, if two of the standard sample images have the first classification label C2, the standard sample images corresponding to the two standard sample images are added together to obtain the weight value corresponding to C2.
[0097] Finally, the first classification label with the highest weight value is used as the adjusted second classification label of the target sample image.
[0098] Optionally, before step S143, the number of candidate sample images whose first classification label is different from the target sample image can be determined first.
[0099] If the number of candidate sample images whose first classification label is different from the target sample image is less than or equal to a second preset number, then the first classification label of the target sample image is used as the second classification label of the target sample image; the second preset number is less than the first preset number.
[0100] If the number of candidate sample images whose first classification label is different from the target sample image is greater than the second preset number, then the process jumps to the step of determining the adjusted second classification label of the target sample image based on the sorting position of each candidate sample image and the first classification label of each candidate sample image.
[0101] For example, after identifying the 20 standard sample images with the highest similarity values as candidate sample images, the number of candidate sample images whose first classification label is different from the target sample image is detected among the 20 candidate sample images.
[0102] If the first classification label of more than 18 candidate sample images is inconsistent with the first classification label of the target sample image, then step S143 is executed. Otherwise, the first classification label of the target sample image is used as the second classification label of the target sample image.
[0103] Based on the above design, experiments show that using ResNet50 as the backbone network can improve classification accuracy by 2.08% without introducing more data or using other optimization techniques.
[0104] This embodiment also provides an electronic device, which can be a server, personal computer, laptop, workstation, or other device with image processing capabilities. Please refer to... Figure 5 , Figure 5 This is a block diagram of the electronic device 100. The electronic device 100 includes a sample image tag processing device 110, a machine-readable storage medium 120, and a processor 130.
[0105] The machine-readable storage medium 120 and the processor 130 are electrically connected directly or indirectly to each other to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines. The sample image tag processing device 110 includes at least one software function module that can be stored in the machine-readable storage medium 120 in the form of software or firmware or embedded in the operating system (OS) of the electronic device 100. The processor 130 is used to execute the executable modules stored in the machine-readable storage medium 120, such as the software function modules and computer programs included in the sample image tag processing device 110.
[0106] The machine-readable storage medium 120 may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc. The machine-readable storage medium 120 is used to store a program, and the processor 130 executes the program / executable sample image label processing method provided in this embodiment after receiving an execution instruction.
[0107] The processor 130 may be an integrated circuit chip with signal processing capabilities. The aforementioned processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application-Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor.
[0108] Please refer to Figure 6 This embodiment also provides a sample image labeling processing device 110, which includes at least one functional module that can be stored in a machine-readable storage medium 120 in software form. Functionally, the sample image labeling processing device 110 may include a data acquisition module 111, a sample screening module 112, a feature extraction module 113, and a label adjustment module 114.
[0109] The data acquisition module 111 is used to acquire multiple sample images to be processed and the first classification label corresponding to each sample image to be processed.
[0110] In this embodiment, the data acquisition module 111 can be used to perform... Figure 1 For a detailed description of the data acquisition module 111 shown in step S110, please refer to the description of step S110.
[0111] The sample screening module 112 is used to screen and obtain multiple standard sample images from multiple sample images to be processed.
[0112] In this embodiment, the sample screening module 112 can be used to perform... Figure 1 The specific description of the sample screening module 112 shown in step S120 can be found in the description of step S120.
[0113] The feature extraction module 113 is used to extract features from each of the sample images to be processed using a feature extraction model, and to obtain image feature information corresponding to each of the sample images to be processed.
[0114] In this embodiment, the feature extraction module 113 can be used to perform... Figure 1 For a detailed description of the feature extraction module 113 shown in step S130, please refer to the description of step S130.
[0115] The label adjustment module 114 is used to determine the adjusted second classification label of the target sample image based on the similarity of the image feature information between the target sample image and each of the standard sample images and the first classification label of each of the standard sample images in the sample image to be processed.
[0116] In this embodiment, the label adjustment module 114 can be used to perform... Figure 1 For a detailed description of the label adjustment module 114 shown in step S140, please refer to the description of step S140.
[0117] In summary, the sample image labeling method, apparatus, and electronic device provided in this application select a portion of the sample images to be processed as standard sample images, compare the feature similarity between the target sample image requiring classification label adjustment and the standard sample images, and then adjust the classification label of the target sample image based on the classification label of the standard sample image according to the feature similarity comparison result. Thus, classification label cleaning of massive amounts of sample images to be processed can be automatically achieved without introducing more data and without supervision.
[0118] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0119] In addition, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0120] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0121] 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.
[0122] The above descriptions are merely various embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for processing sample image labels, characterized in that, The method includes: Obtain multiple sample images to be processed and the first classification label corresponding to each sample image to be processed; Multiple standard sample images are obtained by filtering from the multiple sample images to be processed using a classification model trained with the multiple sample images to be processed and their corresponding first classification labels; The feature extraction model using the MoCo V2 algorithm, trained on the sample images to be processed, is used to extract features from each of the sample images to be processed, thereby obtaining the image feature information corresponding to each sample image to be processed. For the target sample images other than the standard sample images in the sample images to be processed, the standard sample images are sorted according to the similarity of the image feature information between the target sample images and each of the standard sample images; Based on the sorting results, a first preset number of standard sample images whose image feature information is closest to that of each of the standard sample images are determined as candidate sample images; The adjusted second classification label of the target sample image is determined based on the sorting position of each candidate sample image and the first classification label of each candidate sample image.
2. The method according to claim 1, characterized in that, The step of selecting multiple standard sample images from multiple sample images to be processed includes: A classification model is trained by using multiple sample images to be processed, and the trained classification model is obtained. The classification model is used to classify and identify each of the sample images to be processed, and the predicted classification result corresponding to each of the sample images to be processed is obtained. Based on the predicted classification results of each of the sample images to be processed and the first classification label, the label confidence of each of the sample images to be processed is determined; The sample images to be processed that have a label confidence level greater than a preset confidence threshold are identified as the standard sample images.
3. The method according to claim 1, characterized in that, The steps of extracting features from each of the sample images to be processed using a feature extraction model to obtain image feature information corresponding to each of the sample images to be processed include: For each of the sample images to be processed, the sample image to be processed is used as the anchor sample, the transformed image of the sample image to be processed is used as the positive sample, and the other sample images to be processed are used as negative samples, so as to minimize the feature distance between the anchor sample and the positive sample and maximize the feature distance between the anchor sample and the negative sample, and train a feature extraction model. The feature extraction model is used to extract features from each of the sample images to be processed, thereby obtaining the image feature information corresponding to each sample image to be processed.
4. The method according to claim 3, characterized in that, The step of using the transformed image of the sample image to be processed as a positive sample includes: The image after cropping and / or rotating the sample image to be processed is used as the positive sample.
5. The method according to claim 1, characterized in that, The step of determining the adjusted second classification label of the target sample image based on the sorting position of each candidate sample image and the first classification label of each candidate sample image includes: The contribution value is determined according to the sorting position of each candidate sample image, wherein the candidate sample image with greater similarity to the image feature information between each standard sample image has a greater contribution value. The sum of the contribution values of the candidate sample images with the same first classification label is calculated as the weight value corresponding to the first classification label; The first classification label with the highest weight value is used as the adjusted second classification label of the target sample image.
6. The method according to claim 1, characterized in that, Before the step of determining the adjusted second classification label of the target sample image based on the sorting position of each candidate sample image and the first classification label of each candidate sample image, the method further includes: Determine the number of candidate sample images whose first classification label differs from the target sample image; If the number of candidate sample images whose first classification label is different from the target sample image is less than or equal to a second preset number, then the first classification label of the target sample image is used as the second classification label of the target sample image; the second preset number is less than the first preset number. If the number of candidate sample images whose first classification label is different from the target sample image is greater than the second preset number, then the process jumps to the step of determining the adjusted second classification label of the target sample image based on the sorting position of each candidate sample image and the first classification label of each candidate sample image.
7. A sample image label processing device, characterized in that, The device includes: The data acquisition module is used to acquire multiple sample images to be processed and the first classification label corresponding to each sample image to be processed; A sample filtering module is used to filter multiple standard sample images from multiple sample images to be processed using a classification model trained by the sample images to be processed; The feature extraction module is used to extract features from each of the sample images to be processed using a feature extraction model trained on the sample images to be processed, and to obtain image feature information corresponding to each sample image to be processed. The label adjustment module is used to sort the standard sample images (excluding the standard sample images) based on the similarity of the image feature information between the target sample images and each of the standard sample images in the sample images to be processed; based on the sorting result, determine a first preset number of standard sample images whose similarity to the image feature information between each of the standard sample images is closest as candidate sample images; and determine the adjusted second classification label of the target sample image based on the sorting position of each candidate sample image and the first classification label of each candidate sample image.
8. An electronic device, characterized in that, The method includes a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions, which, when executed by the processor, implement the method according to any one of claims 1-6.
9. A machine-readable storage medium, characterized in that, The machine-readable storage medium stores machine-executable instructions that, when executed by one or more processors, implement the method of any one of claims 1-6.
Citation Information
Patent Citations
Label adding method and device and terminal
CN108563683A
Image data processing method and device, equipment and storage medium
CN112115996A
Perioperative period patient sample data set equalization method and sample data set acquisition system
CN115206538A