CN113269226B - Picture selection labeling method based on local and global information - Google Patents
Picture selection labeling method based on local and global information Download PDFInfo
- Publication number
- CN113269226B CN113269226B CN202110399472.9A CN202110399472A CN113269226B CN 113269226 B CN113269226 B CN 113269226B CN 202110399472 A CN202110399472 A CN 202110399472A CN 113269226 B CN113269226 B CN 113269226B
- Authority
- CN
- China
- Prior art keywords
- model
- picture
- objects
- image
- information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/214—Generating training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/23—Clustering techniques
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
Landscapes
- Engineering & Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Evolutionary Computation (AREA)
- Artificial Intelligence (AREA)
- General Engineering & Computer Science (AREA)
- Life Sciences & Earth Sciences (AREA)
- General Physics & Mathematics (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Bioinformatics & Computational Biology (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Evolutionary Biology (AREA)
- General Health & Medical Sciences (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Molecular Biology (AREA)
- Computational Linguistics (AREA)
- Biophysics (AREA)
- Biomedical Technology (AREA)
- Health & Medical Sciences (AREA)
- Image Analysis (AREA)
Abstract
Description
技术领域technical field
本发明涉及一种基于局部与全局信息的图片选择标注方法,该方法能够利用特征表示空间的局部与全局信息高效地选择图片数据库中需要标注的对象,以较少的标注成本训练较好的图片分类模型,属于计算机人工智能数据分析技术领域。The invention relates to a picture selection and labeling method based on local and global information. The method can use the local and global information of the feature representation space to efficiently select objects to be labelled in a picture database, and train better pictures with less labeling cost. The classification model belongs to the technical field of computer artificial intelligence data analysis.
背景技术Background technique
随着互联网的不断发展,有大量的图片数据需要进行处理,例如人脸识别中的人脸图片,自动驾驶中的道路图片,电商平台上的商品图片等等。图片数据结构较为复杂,因此经常要用深度模型完成图片分类任务。但是训练深度模型需要大量的有标记图片。通常情况下,标注这些图片需要花费大量的人力物力,代价昂贵。为了降低标注成本,提高有标记图片利用效率,一种解决方法是让模型自动地选择需要标注的重要图片,并收集这些图片的标记用于更新模型,这便是选择标注的基本思想。目前的选择标注方法在衡量数据的重要程度时,主要考虑数据的不确定性与代表性。其中模型对于数据的预测结果的置信度越低,数据的不确定性越高。另外数据梯度的模长也可以用于估计数据的不确定性。由于基于不确定性的方法只考虑了单个数据的不确定程度,因此模型容易挑选出一批不确定性高但冗余的数据。通过考虑数据的代表性可以一定程度上缓解这一问题。基于代表性的方法一般将数据的特征聚成几个聚簇,选取每个聚簇的中心点作为该聚簇的代表。这样只需利用少量的数据即可刻画整个数据的分布情况。但是这种方法由于没有模型的信息作为指导,选取的数据不一定有利于模型的更新。With the continuous development of the Internet, a large amount of picture data needs to be processed, such as face pictures in face recognition, road pictures in automatic driving, and commodity pictures on e-commerce platforms. The image data structure is relatively complex, so deep models are often used to complete image classification tasks. But training deep models requires a large number of labeled images. Usually, labeling these images requires a lot of manpower and material resources and is expensive. In order to reduce the cost of labeling and improve the efficiency of using labeled pictures, one solution is to let the model automatically select important pictures that need to be labeled, and collect the labels of these pictures to update the model. This is the basic idea of choosing labels. The current selection and labeling methods mainly consider the uncertainty and representativeness of the data when measuring the importance of the data. The lower the confidence of the model in the prediction result of the data, the higher the uncertainty of the data. In addition, the modulo length of the data gradient can also be used to estimate the uncertainty of the data. Since the uncertainty-based method only considers the degree of uncertainty of a single data, it is easy for the model to pick out a batch of data with high uncertainty but redundant. This problem can be mitigated to some extent by considering the representativeness of the data. The representation-based method generally aggregates the features of the data into several clusters, and selects the center point of each cluster as the representative of the cluster. In this way, only a small amount of data can be used to describe the distribution of the entire data. However, since this method does not have model information as a guide, the selected data is not necessarily conducive to model updating.
发明内容SUMMARY OF THE INVENTION
发明目的:针对现有技术中存在的问题与不足,本发明提供一种基于局部与全局信息的图片选择标注方法。该方法能够利用图片特征表示空间中的局部信息,结合模型的预测结果,衡量图片的信息量,能够在一定程度上避免相似或冗余的图片。同时还结合了特征表示空间的全局信息,将图片数据分为多个聚簇,根据模型在不同聚簇上的性能动态地分配标注预算,进一步提高图片标记的利用效率,减少标注成本。在利用相同数目的有标记图片时,通过该方法训练的模型相较于一般的选择标注方法具有更好的性能。Purpose of the invention: In view of the problems and deficiencies in the prior art, the present invention provides a picture selection and annotation method based on local and global information. This method can use the image features to represent the local information in the space, and combine the prediction results of the model to measure the information content of the image, and can avoid similar or redundant images to a certain extent. At the same time, combined with the global information of the feature representation space, the image data is divided into multiple clusters, and the labeling budget is dynamically allocated according to the performance of the model on different clusters, which further improves the utilization efficiency of image labeling and reduces the labeling cost. When using the same number of labeled images, the model trained by this method has better performance than the general selective labeling method.
技术方案:一种基于局部与全局信息的图片选择标注方法,包括如下内容:Technical solution: a method for selecting and labeling pictures based on local and global information, including the following:
首先需要用户建立一个图片对象库。接下来从图片对象库中随机选取部分图片对象,获取这些图片对象的标记,组成初始训练集。用户设置深度模型的结构、每一轮选取的图片对象数目、迭代总轮数。First, the user needs to create a picture object library. Next, some image objects are randomly selected from the image object library, and the labels of these image objects are obtained to form an initial training set. The user sets the structure of the depth model, the number of image objects selected in each round, and the total number of iterations.
接着,基于训练集训练深度学习模型。利用深度模型将图片对象库中的图片对象转换为特征表示,即提取图片对象库中图片的特征。其中深度模型的倒数第二层的输出常常作为相应图片对象的特征表示。这些特征表示组成的空间被称为特征表示空间。Next, the deep learning model is trained based on the training set. The image objects in the image object library are converted into feature representations by using the deep model, that is, the features of the pictures in the image object library are extracted. The output of the penultimate layer of the deep model is often used as the feature representation of the corresponding image object. The space composed of these feature representations is called the feature representation space.
然后,在特征表示空间中,根据局部信息计算方法估计每个对象的信息量,并按照全局信息预算分配方法分配标注预算。基于该预算,挑选出信息量高的一批图片对象,收集这些图片对象的标记。更新有标记图片对象集合和未标记图片对象集合。同时,使用有标记图片对象集合重新训练深度模型,利用新模型重新提取图片对象的特征表示。将这些步骤依次迭代指定轮数。最后一轮的模型即为最终的深度模型。Then, in the feature representation space, the information amount of each object is estimated according to the local information calculation method, and the labeling budget is allocated according to the global information budget allocation method. Based on the budget, a batch of image objects with high information content is selected, and the tags of these image objects are collected. Update the marked image object collection and the unmarked image object collection. At the same time, the deep model is retrained using the set of labeled image objects, and the feature representation of the image objects is re-extracted using the new model. These steps are iterated sequentially for the specified number of rounds. The model in the last round is the final deep model.
最后在预测阶段,用户将待测图片对象输入到训练得到的深度模型,深度模型给用户返回预测结果。Finally, in the prediction stage, the user inputs the image object to be tested into the trained deep model, and the deep model returns the prediction result to the user.
有益效果:与现有的技术相比,本发明通过结合特征表示空间中的局部与全局信息,通过考虑了图片对象的局部信息避免选取出冗余图片,通过特征表示空间的全局信息按需分配预算,提高了图片数据标记的利用效率,减少了标注成本。Beneficial effects: Compared with the prior art, the present invention avoids selecting redundant pictures by combining the local and global information in the feature representation space, and avoids selecting redundant pictures by considering the local information of the picture object, and assigns the global information of the feature representation space as needed. budget, improve the utilization efficiency of image data tagging, and reduce the cost of tagging.
附图说明Description of drawings
图1是本发明的流程图;Fig. 1 is the flow chart of the present invention;
图2是本发明中局部信息计算方法的流程图;Fig. 2 is the flow chart of local information calculation method in the present invention;
图3是本发明中全局信息预算分配方法的流程图。FIG. 3 is a flow chart of the global information budget allocation method in the present invention.
具体实施方式Detailed ways
下面结合具体实施例,进一步阐明本发明,应理解这些实施例仅用于说明本发明而不用于限制本发明的范围,在阅读了本发明之后,本领域技术人员对本发明的各种等价形式的修改均落于本申请所附权利要求所限定的范围。Below in conjunction with specific embodiments, the present invention will be further illustrated, and it should be understood that these embodiments are only used to illustrate the present invention and not to limit the scope of the present invention. The modifications all fall within the scope defined by the appended claims of this application.
如图1所示,基于局部与全局信息的图片选择标注方法,包括如下步骤:As shown in Figure 1, the image selection and annotation method based on local and global information includes the following steps:
步骤100,建立一个图片对象库作为数据集,从图片对象库中随机选取少量对象,获取这些对象的标记,组成初始训练集。记图片对象库中的数据的类别数为C。表示有标记图片对象组成的集合,表示未标记图片对象组成的集合;In
步骤101,用户选择要使用的深度模型,记该模型为f(·;Θ),其中为模型参数,为模型的全连接层参数,θ为模型中的其他参数,用户选择每一轮选取的样本数目B与迭代总轮数T;
步骤102,使用有标记的图片对象训练深度模型,当前轮数t=1;
步骤103,将未标记图片对象输入到深度模型中,根据深度模型提取图片对象的特征表示rθ(x)与softmax层输出f(x;Θ);
步骤104,根据局部信息计算方法估计每个对象为模型提供的信息量,如图2所示,其具体步骤为:
步骤1041,由用户选定局部近邻区域的范围∈;
步骤1042,对于未标记图片对象x,其softmax层输出为f(x;Θ)=(p1,...,pC),模型f(x;Θ)预测的标记为为了增加鲁棒性,进行如下的概率平滑:
其中g(x;Θ)=(g(x;Θ)1,…,g(x;Θ)C);where g(x; Θ)=(g(x; Θ) 1 , . . . , g(x; Θ) C );
步骤1043,对于未标记图片对象与基于平滑后的概率计算信息量
步骤1044,记图片对象x的近邻区域为其中rθ(x)为图片对象x的特征表示,图片对象x的信息量为
步骤1045,为所有的未标记图片对象计算并输出。
步骤105,根据全局信息预算分配方法将未标记数据在特征表示空间内聚成C个聚簇,在不同聚簇中分配预算(B1,…,BC),其中Bj为分配给第j个聚簇的标记预算。如图3所示,其具体步骤为:Step 105: According to the global information budget allocation method, the unlabeled data is clustered into C clusters in the feature representation space, and the budgets (B 1 , . . . , B C ) are allocated in different clusters, where B j is allocated to the jth The tag budget for each cluster. As shown in Figure 3, the specific steps are:
步骤1051,由用户选定Gibbs分布的温度参数τ;
步骤1052,使用kmeans++方法把未标记图片对象的特征表示聚成C个聚簇,第j个聚簇中的图片对象组成的集合为
步骤1053,估计模型在不同聚簇上的性能,将其记模型在第j个聚簇上的表现为γj
步骤1054,根据γj构建预算的Gibbs分布α=(α1,…,αC)
其中∑j αj=1,τ为温度参数用于调节Gibbs分布的平滑程度;where ∑ j α j =1, τ is the temperature parameter used to adjust the smoothness of the Gibbs distribution;
步骤1055,根据Gibbs分布α进行B次采样,得到各个聚簇中所分配的预算(B1,…,BC)并输出,其中∑j Bj=B,B为总的标记预算;Step 1055 , perform B times of sampling according to the Gibbs distribution α, obtain the budgets ( B 1 , .
步骤106,在每个聚簇中,根据相应的预算Bj j∈[C],选取信息量的最高的Bj个图片对象,获取这些图片对象的标记,将这些图片对象加入有标记对象集合中,更新与重新训练深度模型;Step 106: In each cluster, according to the corresponding budget B j j∈[C], select B j picture objects with the highest amount of information, obtain the marks of these picture objects, and add these picture objects to the set of marked objects. medium, update and Retrain the deep model;
步骤107,如果t<T,则t=t+1,跳转到步骤103;
步骤108,用第T轮训练得到的模型作为最终的模型。对于待测对象,将模型预测的标记输出。
Claims (1)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110399472.9A CN113269226B (en) | 2021-04-14 | 2021-04-14 | Picture selection labeling method based on local and global information |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110399472.9A CN113269226B (en) | 2021-04-14 | 2021-04-14 | Picture selection labeling method based on local and global information |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113269226A CN113269226A (en) | 2021-08-17 |
CN113269226B true CN113269226B (en) | 2022-09-23 |
Family
ID=77229077
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110399472.9A Active CN113269226B (en) | 2021-04-14 | 2021-04-14 | Picture selection labeling method based on local and global information |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113269226B (en) |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8452087B2 (en) * | 2009-09-30 | 2013-05-28 | Microsoft Corporation | Image selection techniques |
CN106934055B (en) * | 2017-03-20 | 2020-05-19 | 南京大学 | Semi-supervised webpage automatic classification method based on insufficient modal information |
US11003892B2 (en) * | 2018-11-09 | 2021-05-11 | Sap Se | Landmark-free face attribute prediction |
CN111177384B (en) * | 2019-12-25 | 2023-01-20 | 南京理工大学 | Multi-mark Chinese emotion marking method based on global and local mark correlation |
CN112434736B (en) * | 2020-11-24 | 2024-08-02 | 成都潜在人工智能科技有限公司 | Deep active learning text classification method based on pre-training model |
-
2021
- 2021-04-14 CN CN202110399472.9A patent/CN113269226B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN113269226A (en) | 2021-08-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2022077917A1 (en) | Instance segmentation model sample screening method and apparatus, computer device and medium | |
CN115292532B (en) | Remote sensing image domain adaptive retrieval method based on pseudo-label consistency learning | |
CN107368534B (en) | A method for predicting social network user attributes | |
CN118314352B (en) | Crop remote sensing image segmentation method based on patch-level classification labels | |
CN112990331A (en) | Image processing method, electronic device and storage medium | |
CN114972438B (en) | Self-supervised object tracking method based on multi-cycle cycle consistency | |
CN113051914A (en) | Enterprise hidden label extraction method and device based on multi-feature dynamic portrait | |
CN110298348A (en) | Remote sensing image building sample areas extracting method and system, storage medium, equipment | |
CN117572457A (en) | A cross-scene multispectral point cloud classification method based on pseudo-label learning | |
CN115861196A (en) | Active learning method for multi-modal medical images | |
CN112668633B (en) | A graph transfer learning method based on fine-grained domain adaptation | |
CN115546553B (en) | A zero-shot classification method based on dynamic feature extraction and attribute correction | |
Sun et al. | Automatic building age prediction from street view images | |
CN101213539B (en) | Cross descriptor learning system using non-label sample and method | |
CN116524298A (en) | Semi-supervised Object Detection Method Based on Feature Repository and Contrastive Learning | |
CN116310621A (en) | A Few-Sample Image Recognition Method Based on Feature Library Construction | |
CN115588129A (en) | Automatic Selection Method of Remote Sensing Image Training Samples | |
CN115439715A (en) | Semi-supervised few-sample image classification learning method and system based on anti-label learning | |
CN113269226B (en) | Picture selection labeling method based on local and global information | |
CN111950619B (en) | An Active Learning Method Based on Dual Generative Adversarial Networks | |
CN117876878B (en) | Intelligent classification method for artificial building scenes in high-resolution remote sensing images | |
CN119272938A (en) | A method for energy consumption prediction and management based on large model intelligent agent | |
CN119152209A (en) | Weak supervision semantic segmentation method based on large model auxiliary supervision | |
CN116012840B (en) | Three-dimensional point cloud semantic segmentation labeling method based on active learning and semi-supervision | |
CN118334414A (en) | Scene graph generation method and system supporting historical cultural neighborhood scene |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |