CN115100484A - Data labeling method, computer program product, storage medium and electronic device - Google Patents

Data labeling method, computer program product, storage medium and electronic device Download PDF

Info

Publication number
CN115100484A
CN115100484A CN202210551037.8A CN202210551037A CN115100484A CN 115100484 A CN115100484 A CN 115100484A CN 202210551037 A CN202210551037 A CN 202210551037A CN 115100484 A CN115100484 A CN 115100484A
Authority
CN
China
Prior art keywords
data
labeled
labeling
label
category
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.)
Granted
Application number
CN202210551037.8A
Other languages
Chinese (zh)
Other versions
CN115100484B (en
Inventor
王塑
金宇
周昕宇
张朔
吕杰
厉莲莲
颜露
冀涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kuangshi Technology Co Ltd
Original Assignee
Beijing Kuangshi Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Kuangshi Technology Co Ltd filed Critical Beijing Kuangshi Technology Co Ltd
Priority to CN202210551037.8A priority Critical patent/CN115100484B/en
Publication of CN115100484A publication Critical patent/CN115100484A/en
Application granted granted Critical
Publication of CN115100484B publication Critical patent/CN115100484B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/774Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N5/00Computing arrangements using knowledge-based models
    • G06N5/04Inference or reasoning models
    • G06N5/041Abduction
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Computing Systems (AREA)
  • Evolutionary Computation (AREA)
  • Software Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Data Mining & Analysis (AREA)
  • Medical Informatics (AREA)
  • Multimedia (AREA)
  • Databases & Information Systems (AREA)
  • Mathematical Physics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Molecular Biology (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Image Analysis (AREA)

Abstract

The embodiment of the application provides a data annotation method, a computer program product, a storage medium and an electronic device. The data labeling method comprises the following steps: acquiring first data to be labeled and a reasoning result thereof, wherein the reasoning result of the first data to be labeled is information obtained by predicting the first data to be labeled by using a labeling model; acquiring a label of second data to be labeled marked by a user, wherein the second data to be marked is part of data to be marked in the first data to be marked; estimating whether the labeling accuracy of third data to be labeled which is not labeled in the first data to be labeled reaches the standard or not according to the labeling label of the second data to be labeled, wherein the labeling accuracy of the third data to be labeled is the accuracy of a reasoning label determined according to the reasoning result; and if so, determining the inference label of the third data to be labeled as the labeling label of the third data to be labeled. The method obviously improves the efficiency of data annotation, and the annotation accuracy is effectively guaranteed.

Description

数据标注方法、计算机程序产品、存储介质及电子设备Data labeling method, computer program product, storage medium and electronic device

技术领域technical field

本申请涉及人工智能技术领域,具体而言,涉及一种数据标注方法、计算机程序产品、存储介质及电子设备。The present application relates to the field of artificial intelligence technology, and in particular, to a data labeling method, a computer program product, a storage medium and an electronic device.

背景技术Background technique

数据标注是人工智能领域的一项重要任务,所谓数据标注,即为数据打上可靠的标签信息。例如,在图像分类任务中,数据标注可以指为训练图像标出其真实类别,从而可以以此真实类别为监督信号,对图像分类模型进行有监督训练,使得模型能够学习到训练图像的内容和其真实类别之间的对应关系,进而可以对其他图像进行有效分类。Data labeling is an important task in the field of artificial intelligence. The so-called data labeling is to add reliable label information to the data. For example, in the image classification task, data annotation can refer to marking the real category of the training image, so that the real category can be used as a supervision signal to perform supervised training on the image classification model, so that the model can learn the content and content of the training image. Correspondence between its ground-truth categories, which in turn can effectively classify other images.

然而,目前的数据标注基本上是完全依赖人工完成的,其效率十分低下。However, the current data labeling is basically completely done manually, and its efficiency is very low.

发明内容SUMMARY OF THE INVENTION

本申请实施例的目的在于提供一种数据标注方法、计算机程序产品、存储介质及电子设备,以改善上述技术问题。The purpose of the embodiments of the present application is to provide a data labeling method, a computer program product, a storage medium and an electronic device to improve the above technical problems.

为实现上述目的,本申请提供如下技术方案:To achieve the above purpose, the application provides the following technical solutions:

第一方面,本申请实施例提供一种数据标注方法,包括:获取第一待标注数据及其推理结果;其中,所述第一待标注数据的推理结果为利用标注模型对所述第一待标注数据进行预测得到的信息;获取用户标注的第二待标注数据的标注标签;其中,所述第二待标注数据为所述第一待标注数据中的部分待标注数据;根据所述第二待标注数据的标注标签估计所述第一待标注数据中尚未标注的第三待标注数据的标注准确率是否已经达标;其中,所述第三待标注数据的标注准确率为根据所述第三待标注数据的推理结果所确定的推理标签的准确率;若所述第三待标注数据的标注准确率已经达标,则将所述第三待标注数据的推理标签确定为所述第三待标注数据的标注标签。In a first aspect, an embodiment of the present application provides a data labeling method, including: acquiring first data to be labelled and an inference result thereof; wherein the reasoning result of the first data to be labelled is to use a labeling model for the first data to be labelled. information obtained by predicting the labeled data; obtaining the labeling label of the second data to be labeled marked by the user; wherein, the second data to be labeled is part of the data to be labeled in the first data to be labeled; according to the second data to be labeled The labeling label of the data to be labeled estimates whether the labeling accuracy of the third data to be labeled that has not been labeled in the first data to be labeled has reached the standard; wherein, the labeling accuracy of the third data to be labeled is based on the third The accuracy of the inference label determined by the inference result of the data to be labeled; if the labeling accuracy of the third data to be labeled has reached the standard, the inference label of the third data to be labeled is determined as the third data to be labeled. Annotation labels for the data.

上述方法只需对第一待标注数据中的第二待标注数据进行人工标注,基于其标注结果,就可以对第一待标注数据中的尚未标注的第三待标注数据进行标注准确率评估,并在其准确率达标时对第三待标注数据进行自动标注,而无需对所有待标注数据都进行人工标注。从而,该方法显著提高了数据标注的效率,并且标注准确率也得到了有效保障。其中,第三待标注数据的标注准确率达到了预期的标准(即达标),而第二待标注数据由于是人工标注的,在用户处于正常状态时,其标注准确率可以认为接近或等于100%。The above method only needs to manually label the second to-be-labeled data in the first to-be-labeled data, and based on the labeling result, the labeling accuracy evaluation can be performed on the unlabeled third to-be-labeled data in the first to-be-labeled data, And when the accuracy rate reaches the standard, the third data to be labeled is automatically labeled without manual labeling of all the data to be labeled. Therefore, the method significantly improves the efficiency of data labeling, and the labeling accuracy is also effectively guaranteed. Among them, the labeling accuracy rate of the third to-be-labeled data reaches the expected standard (that is, up to the standard), while the second to-be-labeled data is manually labeled, and its labeling accuracy can be considered to be close to or equal to 100 when the user is in a normal state %.

第二方面,本申请实施例提供一种计算机程序产品,包括计算机程序指令,所述计算机程序指令被处理器读取并运行时,执行第一方面或第一方面的任意一种可能的实现方式提供的方法。In a second aspect, an embodiment of the present application provides a computer program product, including computer program instructions that, when read and run by a processor, execute the first aspect or any possible implementation manner of the first aspect provided method.

第三方面,本申请实施例提供一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序指令,所述计算机程序指令被处理器读取并运行时,执行第一方面或第一方面的任意一种可能的实现方式提供的方法。In a third aspect, embodiments of the present application provide a computer-readable storage medium, where computer program instructions are stored on the computer-readable storage medium, and when the computer program instructions are read and run by a processor, the first aspect or A method provided by any possible implementation manner of the first aspect.

第四方面,本申请实施例提供一种电子设备,包括:存储器以及处理器,所述存储器中存储有计算机程序指令,所述计算机程序指令被所述处理器读取并运行时,执行第一方面或第一方面的任意一种可能的实现方式提供的方法。In a fourth aspect, an embodiment of the present application provides an electronic device, including: a memory and a processor, where computer program instructions are stored in the memory, and when the computer program instructions are read and run by the processor, execute a first A method provided by the aspect or any one of the possible implementations of the first aspect.

附图说明Description of drawings

为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例中所需要使用的附图作简单地介绍,应当理解,以下附图仅示出了本申请的某些实施例,因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。In order to explain the technical solutions of the embodiments of the present application more clearly, the following briefly introduces the accompanying drawings that need to be used in the embodiments of the present application. It should be understood that the following drawings only show some embodiments of the present application, therefore It should not be regarded as a limitation of the scope. For those of ordinary skill in the art, other related drawings can also be obtained from these drawings without any creative effort.

图1示出了本申请实施例提供的数据标注方法的流程;FIG. 1 shows the flow of the data labeling method provided by the embodiment of the present application;

图2(A)和图2(B)示出了用户标注界面的一种实现方式;Figure 2 (A) and Figure 2 (B) show an implementation of the user annotation interface;

图3(A)和图3(B)示出了用户标注界面的另一种实现方式;Figure 3 (A) and Figure 3 (B) show another implementation of the user annotation interface;

图4示出了图1中方法的一种迭代实现方式的流程;Fig. 4 shows the flow of an iterative implementation of the method in Fig. 1;

图5示出了第四待标注数据的缩减原理;Fig. 5 shows the reduction principle of the fourth to-be-labeled data;

图6示出了本申请实施例提供的数据标注系统的架构及其工作原理;FIG. 6 shows the architecture and working principle of the data labeling system provided by the embodiment of the present application;

图7示出了图6中的系统进行模型训练和推理的一种实现方式;Fig. 7 shows an implementation manner of model training and inference performed by the system in Fig. 6;

图8示出了本申请实施例提供的数据标注装置包含的功能模块;FIG. 8 shows the functional modules included in the data labeling apparatus provided by the embodiment of the present application;

图9示出了本申请实施例提供的电子设备的结构。FIG. 9 shows a structure of an electronic device provided by an embodiment of the present application.

具体实施方式Detailed ways

近年来,基于人工智能的计算机视觉、深度学习、机器学习、图像处理、图像识别等技术研究取得了重要进展。人工智能(Artificial Intelligence,简称AI)是研究、开发用于模拟、延伸人的智能的理论、方法、技术及应用系统的新兴科学技术。人工智能学科是一门综合性学科,涉及芯片、大数据、云计算、物联网、分布式存储、深度学习、机器学习、神经网络等诸多技术种类。计算机视觉作为人工智能的一个重要分支,具体是让机器识别世界,计算机视觉技术通常包括人脸识别、活体检测、指纹识别与防伪验证、生物特征识别、人脸检测、行人检测、目标检测、行人识别、图像处理、图像识别、图像语义理解、图像检索、文字识别、视频处理、视频内容识别、三维重建、虚拟现实、增强现实、同步定位与地图构建、计算摄影、机器人导航与定位等技术。随着人工智能技术的研究和进步,该项技术在众多领域展开了应用,例如安全防控、城市管理、交通管理、楼宇管理、园区管理、人脸通行、人脸考勤、物流管理、仓储管理、机器人、智能营销、计算摄影、手机影像、云服务、智能家居、穿戴设备、无人驾驶、自动驾驶、智能医疗、人脸支付、人脸解锁、指纹解锁、人证核验、智慧屏、智能电视、摄像机、移动互联网、网络直播、美颜、美妆、医疗美容、智能测温等领域。本申请实施例中的数据标注方法也属于人工智能技术的范畴。In recent years, important progress has been made in the research of artificial intelligence-based computer vision, deep learning, machine learning, image processing, image recognition and other technologies. Artificial Intelligence (AI) is an emerging science and technology that studies and develops theories, methods, technologies and application systems for simulating and extending human intelligence. Artificial intelligence is a comprehensive discipline, involving chips, big data, cloud computing, Internet of Things, distributed storage, deep learning, machine learning, neural networks and many other types of technologies. As an important branch of artificial intelligence, computer vision is to let machines recognize the world. Computer vision technology usually includes face recognition, living detection, fingerprint recognition and anti-counterfeiting verification, biometric recognition, face detection, pedestrian detection, target detection, pedestrian detection Recognition, image processing, image recognition, image semantic understanding, image retrieval, text recognition, video processing, video content recognition, 3D reconstruction, virtual reality, augmented reality, simultaneous positioning and map construction, computational photography, robot navigation and positioning and other technologies. With the research and progress of artificial intelligence technology, this technology has been applied in many fields, such as safety prevention and control, urban management, traffic management, building management, park management, face access, face attendance, logistics management, warehouse management , robotics, intelligent marketing, computational photography, mobile imaging, cloud services, smart home, wearable devices, driverless, autonomous driving, smart medical care, face payment, face unlock, fingerprint unlock, personal verification, smart screen, smart TV, camera, mobile Internet, webcast, beauty, beauty, medical beauty, intelligent temperature measurement and other fields. The data labeling method in the embodiment of the present application also belongs to the category of artificial intelligence technology.

在介绍本申请实施例中的技术方案之前,先简单说明数据标注的含义以及进行数据标注的意义。Before introducing the technical solutions in the embodiments of the present application, the meaning of data labeling and the meaning of performing data labeling are briefly explained.

所谓数据标注,即通过某种手段(例如,人工确认)为数据打上标签的过程,而标签可以理解为数据所具有的某项(或某几项)属性的值,如果标注效果是理想的,那么标签应为该项属性的真实值。The so-called data labeling is the process of labeling the data by some means (for example, manual confirmation), and the label can be understood as the value of a certain (or certain) attributes of the data. If the labeling effect is ideal, The label should then be the true value of the property.

在人工智能领域,数据标注往往针对某个模型(比如,神经网络模型)的训练样本进行,被标注好的训练样本可用于模型的有监督训练,训练好的模型可用于执行特定的任务,为后文方便表述,不妨将其称为任务模型。这些任务可以概括为:将任务数据输入任务模型,经任务模型运算后,预测出任务数据的某项(或某几项)属性的值,预测出的值在具体问题中可能具有实际的物理含义。In the field of artificial intelligence, data labeling is often performed on the training samples of a certain model (for example, a neural network model). The labeled training samples can be used for supervised training of the model, and the trained model can be used to perform specific tasks. For the convenience of description later, it may be called the task model. These tasks can be summarized as: input the task data into the task model, after the operation of the task model, predict the value of a certain (or certain) attributes of the task data, and the predicted value may have actual physical meaning in the specific problem .

例如,一种可能的训练过程为:将训练样本输入任务模型,得到模型输出的、针对训练样本的某项属性的预测结果,根据预测结果和训练样本的标签,代入预设的损失函数计算预测损失,该预测损失表征预测结果和训练样本的标签之间的差异,迭代地优化任务模型的参数,直至该损失收敛。For example, a possible training process is: input the training sample into the task model, obtain the prediction result output by the model for an attribute of the training sample, and substitute the prediction result and the label of the training sample into a preset loss function to calculate the prediction loss, which characterizes the difference between the predicted result and the labels of the training samples, iteratively optimizes the parameters of the task model until the loss converges.

若训练样本的标签代表了训练样本的某项属性的真实值,那么训练过程也可以视为通过调整任务模型的参数,使其输出的、针对训练样本的该项属性预测结果和其真实值越来越接近的过程。从而,任务模型在训练好以后,再处理和训练样本同类型的任务数据,也能够对任务数据的该项属性预测出比较合理的结果,即能够较好地完成特定的任务。If the label of the training sample represents the true value of an attribute of the training sample, then the training process can also be regarded as adjusting the parameters of the task model so that the output prediction result of the attribute for the training sample is closer to its true value. approaching process. Therefore, after the task model is trained, the task data of the same type as the training sample can be processed, and a reasonable result can be predicted for this attribute of the task data, that is, a specific task can be better completed.

例如,任务模型可以是图像分类模型,图像分类模型用于预测图像中特定对象的类别,比如,预测图像中的手写数字是0~9中的哪个数字,此时的训练样本可以是预先采集的手写数字图像,训练样本的标签为预先标注的图像中的真实数字。For example, the task model can be an image classification model, and the image classification model is used to predict the category of a specific object in the image, for example, to predict which number from 0 to 9 the handwritten number in the image is, the training samples at this time can be pre-collected An image of handwritten digits, the labels of the training samples are the real digits in the pre-labeled images.

又例如,任务模型可以是目标检测模型,目标检测模型用于检测图像中特定对象的位置,比如,检测图像中车辆的位置,此时的训练样本可以是预先采集的道路图像,训练样本的标签为预先标注的图像中车辆的真实位置。For another example, the task model may be a target detection model, and the target detection model is used to detect the position of a specific object in an image, for example, to detect the position of a vehicle in an image, and the training sample at this time may be a pre-collected road image, the label of the training sample. is the true position of the vehicle in the pre-annotated image.

又例如,任务模型可以是词性分析模型,词性分析模型用于预测语句中每个单词的词性,比如,名词、动词、介词等,此时的训练样本可以是预先收集的语句,训练样本的标签为预先标注的语句中单词的真实词性。For another example, the task model may be a part-of-speech analysis model, which is used to predict the part-of-speech of each word in a sentence, such as a noun, a verb, a preposition, etc. The training samples at this time may be pre-collected sentences and labels of the training samples. is the true part-of-speech of the words in the pre-annotated sentences.

总之,本申请的方案中并不限定要标注的数据的具体形式,例如可以是图像、文字、语音等;也不限定标签的具体形式,这与任务模型要执行的具体任务有关,例如可以是图像中对象的真实类别、真实位置等。在后文中,为简单起见,主要以待标注数据是图像的情况为例介绍本申请提出的数据标注方法,但这不应视为对本申请保护范围的限制。In a word, the solution of this application does not limit the specific form of the data to be labeled, such as images, text, voice, etc.; nor does it limit the specific form of the label, which is related to the specific task to be performed by the task model, for example, it can be The real class, real location, etc. of the object in the image. In the following, for the sake of simplicity, the data labeling method proposed in the present application is mainly introduced by taking the case where the data to be labelled is an image as an example, but this should not be regarded as a limitation on the protection scope of the present application.

进一步的,由于在人工智能领域,通常是将人的认知结果作为正确结果,任务模型只是对人在某个特定任务上的认知过程的模拟,因此目前的数据标注通常是通过人工方式进行的,将人工标注的标签作为数据中属性的真实值。然而,任务模型的训练很可能需要大量的带有标签的训练样本,导致标注人员的工作量极大,标注效率十分低下。Further, because in the field of artificial intelligence, the human cognitive result is usually regarded as the correct result, and the task model is only a simulation of the cognitive process of a person on a specific task, so the current data annotation is usually done manually. , take the human-annotated labels as the true values of the attributes in the data. However, the training of the task model is likely to require a large number of labeled training samples, resulting in a huge workload for labelers and very low labeling efficiency.

本申请提出的数据标注方法旨在将人工标注和机器自动标注的方式结合起来,从而显著提升数据标注的效率,并且确保标注结果的准确率能够满足任务要求。The data labeling method proposed in this application aims to combine manual labeling and machine automatic labeling, thereby significantly improving the efficiency of data labeling and ensuring that the accuracy of labeling results can meet the task requirements.

下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application. It should be noted that like numerals and letters refer to like items in the following figures, so once an item is defined in one figure, it does not require further definition and explanation in subsequent figures.

术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。The terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion such that a process, method, article or device comprising a list of elements includes not only those elements, but also other not expressly listed elements, or also include elements inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element.

术语“第一”、“第二”等仅用于将一个实体或者操作与另一个实体或操作区分开来,而不能理解为指示或暗示相对重要性,也不能理解为要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。The terms "first", "second", etc. are only used to distinguish one entity or operation from another, and should not be construed to indicate or imply relative importance, nor to require or imply such entities or operations. There is no such actual relationship or sequence between operations.

图1示出了本申请实施例中的数据标注方法的流程,该方法可以、但不限于在图9示出的电子设备上执行,该电子设备的具体结构可参考后文关于图9的阐述。参照图1,数据标注方法包括:FIG. 1 shows the flow of the data labeling method in the embodiment of the present application. The method can be, but is not limited to, executed on the electronic device shown in FIG. 9 . For the specific structure of the electronic device, refer to the description of FIG. 9 below. . Referring to Figure 1, the data labeling method includes:

步骤S110:获取第一待标注数据及其推理结果。Step S110: Acquire the first to-be-labeled data and its inference result.

第一待标注数据为一批待标注的数据,例如,第一待标注数据可以是尚未标注的训练样本,在标注好后则可以作为任务模型的正式训练样本。第一待标注数据的推理结果为利用标注模型对第一待标注数据进行预测得到的信息,或者说将第一待标注数据输入标注模型后,得到的模型输出就是第一待标注数据的推理结果。例如,若标注模型为分类模型,第一待标注数据的推理结果可以是模型预测出的第一待标注数据分属每个类别的概率,若标注模型为回归模型,第一待标注数据的推理结果可以是模型预测出的回归数值。The first data to be labeled is a batch of data to be labeled. For example, the first data to be labeled can be a training sample that has not been labeled, and can be used as a formal training sample of the task model after being labeled. The reasoning result of the first data to be labeled is the information obtained by using the labeling model to predict the first data to be labeled, or in other words, after the first data to be labeled is input into the labeling model, the obtained model output is the reasoning result of the first data to be labeled. . For example, if the labeling model is a classification model, the reasoning result of the first data to be labelled may be the probability that the first data to be labelled belongs to each category predicted by the model; if the labeling model is a regression model, the reasoning result of the first data to be labelled The result can be the regression value predicted by the model.

标注模型是数据标注阶段使用的模型,标注模型可以和前文提到的任务模型具有相同形式的输入和输出。例如,任务模型是图像分类模型,其输入为图像,输出为该图像分属每个类别的概率(比如,对于手写数字识别,就是该图像分属数字0~9的概率,默认图像中只有一个手写数字),那么标注模型也可以是图像分类模型,其输入为图像,输出为该图像分属每个类别的概率。又例如,任务模型是目标检测模型,其输入为图像,输出为该图像中每个目标的位置(比如,对于车辆检测,就是该图像中每辆车的位置),那么标注模型也可以是目标检测模型,其输入为图像,输出为该图像中每个目标的位置,等等。The annotation model is the model used in the data annotation phase. The annotation model can have the same form of input and output as the task model mentioned above. For example, the task model is an image classification model, the input is an image, and the output is the probability that the image belongs to each category (for example, for handwritten digit recognition, it is the probability that the image belongs to the numbers 0-9, and there is only one in the default image. handwritten digits), then the labeling model can also be an image classification model, whose input is an image, and the output is the probability that the image belongs to each category. For another example, if the task model is a target detection model, the input is an image, and the output is the position of each target in the image (for example, for vehicle detection, it is the position of each vehicle in the image), then the annotation model can also be the target. A detection model whose input is an image, output is the location of each object in that image, and so on.

但标注模型和任务模型可能、但不一定是相同的模型,即二者有可能结构相同但参数不同,或者干脆结构也不同。导致二者被设计为不同的模型的因素有很多:However, the annotation model and the task model may, but are not necessarily the same model, that is, the two may have the same structure but different parameters, or even different structures. There are many factors that cause the two to be designed as different models:

例如,在某场景中,希望尽可能地给待标注数据赋予准确的标签,即在进行数据标注时无需过多考虑资源消耗问题,此时,可以采用一个较复杂的模型作为标注模型;但对于任务模型,很可能是要部署到实际的生产环境中的(比如,手机、摄像头上),其可以使用的资源是严格受限的,只能采用一个较简单的模型。For example, in a certain scenario, it is desirable to assign accurate labels to the data to be labeled as much as possible, that is to say, there is no need to consider resource consumption too much during data labeling. In this case, a more complex model can be used as the labeling model; but for The task model is likely to be deployed in the actual production environment (for example, mobile phones, cameras), the resources that can be used are strictly limited, and only a simpler model can be used.

又例如,根据后文内容可知,在数据标注方法的某些实现方式中,标注模型只会使用人工标注的数据进行训练,而不会使用机器自动标注的数据进行训练,因此直接将其用于执行任务并不会取得太好的效果,因为它“见过”的训练数据十分有限,而任务模型在训练时则可能会使用人工标注的数据和机器自动标注的数据,因此其执行任务的效果更好,因为它“见过”的训练数据更多。关于标注模型如何训练,这里暂不展开阐述。For another example, according to the following content, in some implementations of the data labeling method, the labeling model will only use the manually labelled data for training, and will not use the data automatically labelled by the machine for training, so it is directly used for training. Executing the task will not achieve very good results, because the training data it has "seen" is very limited, and the task model may use human-labeled data and machine-labeled data during training, so the effect of its execution of the task. Better because it has "seen" more training data. How to train the labeling model will not be elaborated here.

为简单起见,在后文所举的例子中,可以认为标注模型和任务模型是同类的模型(比如,都是图像分类模型),且具有相同形式的输入和输出,但这不应当视为对本申请保护范围的限制。For the sake of simplicity, in the following examples, the annotation model and the task model can be considered to be the same model (for example, both are image classification models), and have the same form of input and output, but this should not be regarded as a Restrictions on the scope of application for protection.

步骤S110中的“获取”泛指通过各种手段得到:例如,可以是在执行步骤S110之前已经得到了第一待标注数据及其推理结果并存储在某处,在步骤S110执行时直接读取第一待标注数据及其推理结果;又例如,也可能在执行步骤S110之前还没有得到第一待标注数据及其推理结果,在执行步骤S110时才从某处(比如,后文提到推理结果池)得到第一待标注数据,并利用标注模型计算出第一待标注数据的其推理结果,等等。"Acquiring" in step S110 generally refers to obtaining through various means: for example, it may be that the first data to be labeled and its inference result have been obtained and stored somewhere before step S110 is executed, and directly read when step S110 is executed The first to-be-labeled data and its inference result; for another example, the first to-be-labeled data and its inference result may not be obtained before step S110 is performed, and the first data to be labeled and its inference result may not be obtained before step S110 is performed, and the inference result is obtained from somewhere (for example, the reasoning mentioned later) result pool) to obtain the first data to be labeled, and use the labeling model to calculate the inference result of the first data to be labeled, and so on.

步骤S120:获取用户标注的第二待标注数据的标注标签。Step S120: Obtain the labeling label of the second data to be labelled marked by the user.

第二待标注数据为第一待标注数据中的部分待标注数据。第二待标注数据可以从第一待标注数据中抽样得到,抽样方法不限,例如可以是随机抽样,也可以是按照固定模式抽样,等等。第二待标注数据中可以不存在重复的数据,避免进行重复标注。The second data to be labeled is part of the data to be labeled in the first data to be labeled. The second data to be labeled may be obtained by sampling from the first data to be labeled, and the sampling method is not limited, for example, it may be random sampling, or sampling according to a fixed pattern, and so on. Second, there may be no duplicate data in the data to be labeled, so as to avoid repeated labeling.

获得第二待标注数据后,可将其提供给用户进行人工标注,此处的用户就是指标注人员。将第二待标注数据提供给用户的方式有多种:例如,若用户进行数据标注所使用的设备(后文称用户终端)和执行步骤S120的设备(后文称当前设备)并非同一设备,则可以将第二待标注数据从当前设备发送给用户终端,并在用户终端的用户标注界面(比如,一个网页或者客户端界面)上进行显示,供用户标注;又例如,若用户终端和当前设备是同一设备,则可以直接将第二待标注数据在当前设备的用户标注界面上进行显示,供用户标注,等等。After the second data to be labeled is obtained, it can be provided to the user for manual labeling, and the user here is the index annotator. There are many ways to provide the second data to be labeled to the user: for example, if the device (hereinafter referred to as the user terminal) used by the user for data labeling and the device (hereinafter referred to as the current device) that performs step S120 are not the same device, Then the second data to be marked can be sent from the current device to the user terminal, and displayed on the user marking interface (for example, a web page or client interface) of the user terminal for the user to mark; If the devices are the same device, the second to-be-labeled data can be directly displayed on the user labeling interface of the current device for the user to label, and so on.

应当理解,虽然用户必须以某种方式获知第二待标注数据的内容才能对其进行标注,但获知方式并不限于将其在用户标注界面显示,例如,还可以用语音播放第二待标注数据的内容(如果其可以语音播放的话),或者将第二待标注数据打印出来给用户观看等等。It should be understood that although the user must know the content of the second to-be-labeled data in some way to label it, the way of knowing is not limited to displaying it on the user's labeling interface. For example, the second to-be-labeled data can also be played by voice. (if it can be played by voice), or print out the second data to be marked for the user to watch and so on.

用户对第二待标注数据进行标注,就是人工为其打上标签,将此标签称为标注标签,若默认人工标注是准确的,则标注标签也就是第二待标注数据最终的标签。例如,若第一待标注数据是用于训练分类模型的(比如,任务模型和标注模型都是分类模型),则用户可将自己认为的第一待标注数据的类别作为其标注标签;又例如,若第一待标注数据是用于训练回归模型的(比如,任务模型和标注模型都是回归模型),则用户可将自己认为的第一待标注数据的回归数值作为其标注标签。在介绍图2(A)、图2(B)、图3(A)和图3(B)时,还会对用户的标注过程作更多阐述,此处暂不展开。When the user labels the second data to be labeled, it is manually labeled, and this label is called a label. If the default manual labeling is accurate, the label is the final label of the second data to be labeled. For example, if the first data to be labeled is used for training a classification model (for example, the task model and the labeling model are both classification models), the user can use the category of the first data to be labeled as his label as his label; another example , if the first data to be labeled is used for training a regression model (for example, the task model and the labeled model are both regression models), the user can use the regression value of the first data to be labeled as his label as his label. When introducing FIG. 2(A), FIG. 2(B), FIG. 3(A), and FIG. 3(B), the user's labeling process will be further elaborated, which will not be expanded here for the time being.

用户标注完成后,可以自行触发代表标注完成的确认操作(例如,在用户标注界面上点击“提交”),将标注结果,即第二待标注数据的标注标签返回给当前设备(若用户本来就在当前设备上标注则可以认为是返回给了执行数据标注流程的主程序),从而当前设备获得了第二待标注数据的标注标签。在执行完步骤S120后,第二待标注数据就标注完了。After the user's annotation is completed, the user can trigger the confirmation operation representing the completion of the annotation (for example, click "Submit" on the user annotation interface), and return the annotation result, that is, the annotation label of the second data to be annotated to the current device (if the user originally The labeling on the current device can be considered as being returned to the main program that executes the data labeling process), so that the current device obtains the labeling label of the second data to be labelled. After step S120 is performed, the second to-be-labeled data is finished.

步骤S130:根据第二待标注数据的标注标签估计第三待标注数据的标注准确率是否已经达标。Step S130: Estimate whether the labeling accuracy of the third data to be labelled has reached the standard according to the labeling label of the second data to be labelled.

第三待标注数据为第一待标注数据中尚未标注的数据,由于第二待标注数据只是第一待标注数据中的部分待标注数据,所以在第二待标注数据被标注后,第一待标注数据中必然还有尚未标注的数据,从而可能会产生第三待标注数据。但需注意,第一待标注数据中所有尚未标注的数据可能、但不一定都属于第三待标注数据,这里存在不同的实现方式。例如,根据后文可知,在某些实现方式,一些被评估为标注准确率较低的未标注数据会被排除在第三待标注数据之外。The third data to be labeled is the data that has not been labeled in the first data to be labeled. Since the second data to be labeled is only part of the data to be labeled in the first data to be labeled, after the second data to be labeled is labeled, the first data to be labeled There must be unlabeled data in the labeled data, so third data to be labeled may be generated. However, it should be noted that all the unlabeled data in the first data to be labeled may, but not necessarily, belong to the third data to be labeled, and there are different implementations here. For example, it can be seen from the following that in some implementations, some unlabeled data that is evaluated as having a low labeling accuracy rate will be excluded from the third data to be labeled.

第三待标注数据的标注准确率为根据第三待标注数据的推理结果所确定的推理标签的准确率。其中,由于第三待标注数据属于第一待标注数据,而步骤S110中已经获得了第一待标注数据的推理结果,所以第三待标注数据的推理结果在执行步骤S130时是已知的。The labeling accuracy of the third to-be-labeled data is the accuracy of the inference label determined according to the inference result of the third to-be-labeled data. Wherein, since the third to-be-labeled data belongs to the first to-be-labeled data, and the inference result of the first to-be-labeled data has been obtained in step S110, the inference result of the third to-be-labeled data is known when step S130 is executed.

第三待标注数据的推理标签是基于第三待标注数据的推理结果,并结合特定的规则得到的标签,推理标签在形式上和前面介绍的标注标签并无区别,只是推理标签是机器自动给出的标签,而并非是人工标注的标签,因此其准确率通常不是100%(默认人工标注的标签是正确的),该标注准确率可以根据第二待标注数据的标注标签进行估计,其原理是:第二待标注数据也具有推理标签,且其得到推理标签的规则和第三待标注数据是相同的,从而第二待标注数据的推理标签和标注标签(正确的标注结果)的差异就可以反映出按照此种规则算出的推理标签的准确率到底如何。得到推理标签的规则有多种,后文会给出例子,此处暂不展开。The inference label of the third data to be labeled is a label obtained based on the inference result of the third data to be labeled and combined with specific rules. The label is not manually labeled, so its accuracy is usually not 100% (the default manually labeled label is correct). The labeling accuracy can be estimated according to the label of the second to-be-labeled data. The principle Yes: the second to-be-labeled data also has an inference label, and the rules for obtaining the inference label are the same as the third to-be-labeled data, so the difference between the inference label of the second to-be-labeled data and the labeling label (correct labeling result) is It can reflect the accuracy of the inference label calculated according to this rule. There are many rules for obtaining inference labels. Examples will be given later, which will not be expanded here.

需要指出,以上引出推理标签的概念仅仅是为了解释第三待标注数据的标注准确率的含义,并不代表在估计该标注准确率时一定要将第三待标注数据的推理标签计算出来,也不代表在估计该标注准确率时一定要给第三待标注数据打上推理标签,而可以这样理解该标注准确率的定义:若第三待标注数据按照其推理标签进行标注,则标注结果的准确率符合估计出的准确率。总之,第三待标注数据具有推理标签和其处于尚未标注的状态并不矛盾。It should be pointed out that the concept of the inference label introduced above is only to explain the meaning of the labeling accuracy of the third to-be-labeled data, and does not mean that the inference label of the third to-be-labeled data must be calculated when estimating the labeling accuracy. It does not mean that the third to-be-labeled data must be labeled with an inference label when estimating the labeling accuracy, but the definition of the labeling accuracy can be understood as follows: if the third to-be-labeled data is labeled according to its inference label, the labeling result is accurate. The rate is in line with the estimated accuracy. In conclusion, it is not contradictory that the third to-be-labeled data has an inference label and that it is in an unlabeled state.

第三待标注数据的准确率达标可以指其标注准确率估值大于目标准确率。其中,目标准确率可以是开始数据标注之前,根据任务模型的训练需求设定好的一个准确率,例如可以是99%、98%等。若估计出第三待标注数据的准确率达标,则执行步骤S140,若估计出第三待标注数据的准确率不达标,则可能采取不同的处理方式:例如,抽样出更多的第二待标注数据,并执行步骤S120~S130,重新估计第三待标注数据的标注准确率,当然此时的第三待标注数据可能会发生变化;又例如,重新训练标注模型,并执行步骤S110~S130,重新估计第三待标注数据的标注准确率;又例如,直接对第三待标注数据进行人工标注,等等。Third, the accuracy of the data to be labeled meets the standard may mean that the estimated accuracy of the labeled data is greater than the target accuracy. The target accuracy rate may be an accuracy rate set according to the training requirements of the task model before starting the data labeling, for example, it may be 99%, 98%, and the like. If it is estimated that the accuracy of the third to-be-labeled data meets the standard, step S140 is executed. If it is estimated that the accuracy of the third to-be-labeled data does not meet the standard, different processing methods may be adopted: for example, sampling more second to-be-labeled data Label the data, and perform steps S120 to S130 to re-estimate the labeling accuracy of the third data to be labelled. Of course, the third data to be labelled may change at this time; for another example, retrain the labeling model and perform steps S110 to S130 , re-estimating the labeling accuracy of the third data to be labeled; for another example, directly manually labeling the third data to be labeled, and so on.

步骤S140:将第三待标注数据的推理标签确定为第三待标注数据的标注标签。Step S140: Determine the inference label of the third data to be labeled as the labeling label of the third data to be labeled.

既然第三待标注数据的标注准确率能够满足需求,那么直接按照推理标签对第三待标注数据进行标注就可以了,第三待标注数据的标注标签也就是其最终的标签。如果在之前未计算过第三待标注数据的推理标签,则在步骤S140中需要先计算出第三待标注数据的推理标签。由于第三待标注数据是自动标注的,所以其标注效率远高于人工标注,并且其标注准确率也是有保障的,例如,足以满足任务模型的训练需求。Since the labeling accuracy of the third to-be-labeled data can meet the requirements, it is sufficient to label the third to-be-labeled data directly according to the inference label, and the label of the third to-be-labeled data is also its final label. If the inference label of the third data to be labeled has not been calculated before, the inference label of the third data to be labeled needs to be calculated first in step S140. Since the third data to be labeled is automatically labeled, its labeling efficiency is much higher than that of manual labeling, and its labeling accuracy is also guaranteed, for example, it is sufficient to meet the training needs of the task model.

在执行完步骤S140后,第一待标注数据中的第二待标注数据和第三待标注数据都已经标注完成,但不排除第一待标注数据中还剩余有数据尚未标注,对于这些数据,可以采取不同的处理方式:例如,直接由人工进行标注;又例如,重新训练标注模型后再进行标注(此时推理结果可能发生变化,从而改变标注结果),等等。After step S140 is performed, both the second data to be labeled and the third data to be labeled in the first data to be labeled have been labeled, but it does not rule out that there are data remaining in the first data to be labeled that have not been labeled. For these data, Different processing methods can be adopted: for example, labeling directly by humans; another example, retraining the labeling model and then labeling (at this time, the inference results may change, thereby changing the labeling results), and so on.

简单总结图1中的方法,该方法只需对第一待标注数据中的第二待标注数据进行人工标注,基于其标注结果,就可以对第一待标注数据中的尚未标注的第三待标注数据进行标注准确率评估,并在其准确率达标时对第三待标注数据进行自动标注,而无需对所有待标注数据都进行人工标注。从而,该方法显著提高了数据标注的效率,并且标注准确率也得到了有效保障,比如,可以满足任务模型的训练需求。其中,第三待标注数据的标注准确率达到了预期的标准,而第二待标注数据由于是人工标注的,在用户处于正常状态时,其标注准确率可以认为接近或等于100%。To briefly summarize the method in Figure 1, this method only needs to manually label the second to-be-labeled data in the first to-be-labeled data. The labeling data is evaluated for labeling accuracy, and the third to-be-labeled data is automatically labeled when its accuracy reaches the standard, without the need to manually label all the to-be-labeled data. Therefore, the method significantly improves the efficiency of data labeling, and the labeling accuracy is also effectively guaranteed, for example, it can meet the training requirements of the task model. Among them, the labeling accuracy of the third to-be-labeled data has reached the expected standard, while the second to-be-labeled data is manually labeled, and its labeling accuracy can be considered to be close to or equal to 100% when the user is in a normal state.

注意,发明人研究发现,待标注数据往往数量庞大,第一待标注数据很可能只是其中的一批数据,即使并非每一批第一待标注数据都能触发步骤S140的执行,还是有很多批的第一待标注数据能够触发步骤S140的执行,即自动标注几乎总是会执行的,上述有益效果并非只在少数特殊情况下才能实现。Note that the inventors have found that the data to be labeled is often huge in quantity, and the first data to be labeled is likely to be only one batch of data. Even if not every batch of the first data to be labeled can trigger the execution of step S140, there are still many batches of data to be labeled. The first data to be labeled can trigger the execution of step S140, that is, automatic labeling is almost always executed, and the above beneficial effects are not only achieved in a few special cases.

另外,需要指出,虽然上面在阐述时,总是将数据标注和任务模型的训练联系在一起,但实际上二者并不具有绑定关系,即标注好的数据(第二待标注数据和第三待标注数据)并不一定用于训练任务模型,例如也有可能仅仅是用于展示、存储目的,即其用途并不限定。In addition, it should be pointed out that although the data labeling and the training of the task model are always linked in the above description, in fact, the two do not have a binding relationship, that is, the labeled data (the second to-be-labeled data and the first (3) Data to be labeled) is not necessarily used for training the task model, for example, it may only be used for display and storage purposes, that is, its use is not limited.

前文在阐述步骤S120时提到,为了获得第二待标注数据的标注标签,可以先将第二待标注数据在用户标注界面上进行显示,由用户进行标注。由于第二待标注数据此前并未经过标注,所以在一种实现方式中,用户标注界面上可以显示标签未知的第二待标注数据,完全由用户给出其标注标签,此种实现方式比较简单,但用户的工作量比较大。As mentioned above when describing step S120, in order to obtain the labeling label of the second data to be labelled, the second data to be labelled may be displayed on the user labeling interface, and the user labels. Since the second data to be labeled has not been labeled before, in an implementation manner, the second data to be labeled with an unknown label can be displayed on the user labeling interface, and the labeling label is completely given by the user. This implementation method is relatively simple , but the workload of the user is relatively large.

因此,在另一种实现方式中,可以先根据第二待标注数据的推理结果,确定第二待标注数据的预测标签,在用户标注界面上则不仅要显示第二待标注数据,还要显示其预测标签。Therefore, in another implementation manner, the prediction label of the second to-be-labeled data may be determined first according to the inference result of the second to-be-labeled data, and not only the second to-be-labeled data but also the second to-be-labeled data should be displayed on the user labeling interface. its predicted label.

其中,预测标签是基于第二待标注数据的推理结果,并结合特定的规则得到的标签,预测标签在形式上和前面介绍的标注标签并无区别,只是预测标签并非是人工标注的标签。得到预测标签的特定规则有多种,后文会给出例子,此处暂不展开,但需要注意,计算预测标签的特定规则和计算推理标签的特定规则可能相同也可能不同,从而同一条第二待标注数据预测标签和推理标签可能相同也可能不同。Among them, the predicted label is a label obtained based on the inference result of the second data to be labeled and combined with specific rules. The predicted label is no different in form from the previously described label, except that the predicted label is not a manually labeled label. There are many specific rules for obtaining predicted labels. Examples will be given later, which will not be expanded here, but it should be noted that the specific rules for calculating predicted labels and the specific rules for calculating inference labels may be the same or different. Second, the prediction label and the inference label of the data to be labeled may be the same or different.

预测标签可以表示根据标注模型的推理结果所预测出的标注结果,若标注模型的推理结果足够精确,则预测标签可能和标注标签十分接近,从而预测标签可以作为用户进行人工标注时的重要参考信息,使得用户可以无需修改用户标注界面上显示的预测标签,直接将其确认为标注标签,或者,只需少量修改用户标注界面上显示的预测标签(修改为用户认为合适的标注标签),将大部分预测标签都确认为标注标签,从而显著提高了用户的标注效率。The predicted label can represent the labeling result predicted according to the inference result of the labeling model. If the inference result of the labeling model is accurate enough, the predicted label may be very close to the labeled label, so the predicted label can be used as an important reference for users to manually label. , so that the user can directly confirm the prediction label displayed on the user labeling interface as the labeling label without modifying it, or only need to slightly modify the prediction label displayed on the user labeling interface (modify it to the labeling label that the user deems appropriate), which will greatly Some predicted labels are confirmed as label labels, which significantly improves the labeling efficiency of users.

可选的,若标注模型是分类模型,则第二待标注数据的预测标签为第二待标注数据的预测类别,此时可以按照第二待标注数据的预测类别,在用户标注界面上分类显示第二待标注数据。Optionally, if the labeling model is a classification model, the prediction label of the second data to be labelled is the prediction class of the second data to be labelled. At this time, it can be classified and displayed on the user labeling interface according to the prediction class of the second data to be labelled. The second data to be labeled.

参照图2(A),标注模型是情绪分类模型,第二待标注数据为人脸图像,第二待标注数据的推理结果可以是图像中的人脸分属每种情绪类别(例如,高兴、难过、惊讶等)的概率,第二待标注数据的预测类别可以是图像所属的情绪类别,例如高兴、难过、惊讶等。2 (A), the labeling model is an emotion classification model, the second data to be labelled is a face image, and the reasoning result of the second data to be labelled may be that the face in the image belongs to each emotion category (for example, happy, sad) , surprise, etc.), the predicted category of the second to-be-labeled data may be the emotional category to which the image belongs, such as happy, sad, surprised, etc.

在图2(A)中,预测类别为高兴类别的人脸图像显示在一行,预测类别为难过类别的人脸图像显示在另一行,以此类推。对人脸图像分类显示后,用户很容易确认每张人脸图像所属的情绪类别,并且也更容易从中挑选出预测类别错误的图像并更改其类别,因为在大量具有共性的同类数据中,少量的异类数据会更加明显。例如,对于高兴类别中的第二张人脸图像,其嘴角弯曲方向和其他人脸图像明显不同,用户可以很快确认出其预测类别存在错误。In Figure 2(A), the face images whose predicted category is happy are displayed in one row, the face images whose predicted category is sad are displayed in another row, and so on. After the face images are classified and displayed, it is easy for users to confirm the emotional category to which each face image belongs, and it is also easier to pick out images with wrong predicted categories and change their categories, because in a large number of similar data with commonality, a small amount of The heterogeneous data will be more obvious. For example, for the second face image in the happy category, the bending direction of the corners of the mouth is significantly different from other face images, and the user can quickly confirm that the predicted category is wrong.

进一步的,第二待标注数据及其预测类别可以显示在用户标注界面的第一区域,用户可以在第一区域中执行数据选择操作,若一条第二待标注数据被用户选中,则表明该条第二待标注数据的预测类别不被用户认可。Further, the second data to be labeled and its prediction category can be displayed in the first area of the user labeling interface, and the user can perform a data selection operation in the first area. If a second data to be labeled is selected by the user, it indicates that the The predicted category of the second to-be-labeled data is not recognized by the user.

例如,参照图2(B),用户标注界面的上半部分为第一区域,若用户使用PC机进行标注,则数据选择操作可以是鼠标左键的单击操作,假设用户认为高兴类别中的第二张人脸图像的预测类别存在错误,则可以将屏幕上的光标移动至此人脸图像上然后点击鼠标左键,此时该人脸图像下方会出现未知类别的字样,表示该图像的类别待定。For example, referring to FIG. 2(B), the upper part of the user annotation interface is the first area. If the user uses a PC to make annotations, the data selection operation can be a click operation of the left mouse button. If there is an error in the predicted category of the second face image, you can move the cursor on the screen to the face image and click the left mouse button. At this time, the word unknown category will appear below the face image, indicating the category of the image. Pending.

响应于在第一区域中触发的数据选择操作,用户标注界面可以将被选中的第二待标注数据显示界面中的第二区域内,并在第二区域中显示被选中的第二待标注数据的候选类别,供用户进行人工标注时选择。In response to the data selection operation triggered in the first area, the user annotation interface may display the selected second data to be annotated in the second area in the interface, and display the selected second data to be annotated in the second area The candidate category for the user to select when manually labeling.

例如,参照图2(B),用户标注界面的下半部分为第二区域,高兴类别中的第二张人脸图像被显示在此处,并且其右侧显示出了所有可能的情绪类别供用户选择为标注标签。特别地,未知类别也可以作为一个候选类别,若用户选择了未知类别,表示该人脸图像的标注标签是未知的,或者说也可以视为其未进行过标注。For example, referring to Figure 2(B), the lower part of the user annotation interface is the second area, the second face image in the happy category is displayed here, and all possible emotion categories are displayed on the right side for The user selects a label for the callout. In particular, the unknown category can also be used as a candidate category. If the user selects the unknown category, it means that the labeling label of the face image is unknown, or it can also be considered that it has not been labeled.

应当理解,第一区域和第二区域在用户标注界面中的布局方式不限于图2(A)和图2(B)示出的方式,甚至第一区域和第二区域也可以存在重叠。It should be understood that the layout of the first area and the second area in the user annotation interface is not limited to the manner shown in FIG. 2(A) and FIG. 2(B), and even the first area and the second area may overlap.

按照上述方式进行标注的有益效果在于:在第一区域中,用户只需关注某条第二待标注数据的预测类别是否正确,即只需进行判断(判断“是”或“否”),而无需进行选择(选择正确的标注标签),在第二区域中,用户则只需进行选择无需进行判断。从而,用户可以先在第一区域中选择出预测类别错误的所有第二待标注数据,然后在第二区域中统一进行类别修改(改为标注标签中的类别),即在每个区域内,用户只需按照单一的标注逻辑进行操作,无需在两种思维逻辑之间来回切换,实验表明,此种方式能显著提升用户的标注速度。The beneficial effect of labeling according to the above method is that in the first area, the user only needs to pay attention to whether the prediction category of a second piece of data to be labelled is correct, that is, only need to make a judgment (judging "yes" or "no"), and There is no need to make a selection (choose the correct callout label), and in the second area, the user simply makes a selection without judgment. Therefore, the user can first select all the second to-be-labeled data whose predicted category is wrong in the first area, and then uniformly modify the category in the second area (change to the category in the label), that is, in each area, Users only need to operate according to a single labeling logic, without switching back and forth between the two thinking logics. Experiments show that this method can significantly improve the user's labeling speed.

应当理解,在标注界面上划分第一区域和第二区域不是必须的,例如,也可以只设置第一区域,用户在第一区域中每选中一条第二待标注数据后,就直接在其显示位置处进行类别的更改,但此时用户需要在判断和选择两种思维逻辑之间来回切换,标注效率可能会降低。It should be understood that it is not necessary to divide the first area and the second area on the labeling interface. For example, only the first area may be set. After the user selects a piece of second data to be labelled in the first area, it will be displayed directly in the first area. The category is changed at the location, but at this time, the user needs to switch back and forth between the two thinking logics of judgment and selection, and the labeling efficiency may be reduced.

另外,即使标注模型是分类模型,在用户标注界面上也不一定要按照预测类别分类显示第二待标注数据,例如也可以将所有类别的第二待标注数据混合显示,在每条第二待标注数据的显示位置处也显示其预测类别即可。In addition, even if the labeling model is a classification model, on the user labeling interface, it is not necessary to display the second data to be labeled according to the predicted category. For example, the second data to be labeled of all categories can be mixed and displayed. It suffices to display the predicted category at the display position of the labeled data.

进一步的,发明人研究发现,用户在进行标注时,很可能会从第二待标注数据的局部来判断其预测标签是否正确,或者来决定其标注标签到底是什么。例如,在图2(B)中,用户可能主要是从人脸图像的嘴角弯曲方向来判断情绪类别的(上弯为高兴,下弯为难过),对人脸图像的其余部分则并不太关注。因此,若用户标注界面在显示第二待标注数据时,能够应用户的需求,将显示内容聚焦到用户关注的重点部分(即用户注意力集中的位置),则更有利于用户快速、准确地给出标注标签。Further, the inventor's research found that when a user is annotating, it is likely to judge whether the predicted label is correct from the part of the second to-be-labeled data, or to determine what the label is. For example, in Figure 2(B), the user may judge the emotion category mainly from the bending direction of the mouth corners of the face image (bending up is happy, bending down is sad), but not so much about the rest of the face image. focus on. Therefore, if the user annotation interface can focus the displayed content on the key part of the user's attention (that is, the position where the user's attention is focused) according to the user's needs when displaying the second to-be-annotated data, it is more beneficial for the user to quickly and accurately Gives the callout label.

对于第二待标注数据是图像的情况,基于用户注意力进行数据显示的可能做法如下:For the case where the second data to be labeled is an image, the possible methods of displaying data based on the user's attention are as follows:

在用户标注界面的第一区域中显示第二待标注数据及其预测标签,在用户标注界面的第三区域中显示参考图像。其中,参考图像为从当前要标注的所有第二待标注数据中选择出的一张图像,可以由用户选择,也可以由程序自动选择(比如,自动选择排在第一张图像)。The second to-be-labeled data and its predicted label are displayed in the first area of the user annotation interface, and the reference image is displayed in the third area of the user annotation interface. The reference image is an image selected from all the second data to be marked currently to be marked, which can be selected by the user or automatically selected by the program (for example, the first image is automatically selected).

用户可以在第三区域中执行针对参考图像的图像变换操作,其目的可以是将参考图像中与标注结果密切相关的用户注意力集中区域以较显著的方式显示出来。其中,图像变换操作包括图像平移、图像旋转、图像缩放、框选图像局部区域中的至少一种操作。The user may perform an image transformation operation on the reference image in the third area, the purpose of which may be to display the user's attention-focused area closely related to the annotation result in the reference image in a more prominent manner. Wherein, the image transformation operation includes at least one operation of image translation, image rotation, image scaling, and frame selection of a local area of the image.

响应于在第三区域中触发的图像变换操作,用户标注界面(或者后台)可以将图像变换操作记录下来。由于每种操作都对应特定的操作参数,因此记录操作实际上就是记录这些操作参数。例如,对于图像平移可以记录平移量,对于图像旋转可以记录旋转角度,对于图像缩放可以记录缩放倍数,对于框选图像局部区域可以记录局部区域的位置,等等。In response to the image transformation operation triggered in the third area, the user annotation interface (or the background) may record the image transformation operation. Since each operation corresponds to specific operation parameters, logging an operation is actually recording these operation parameters. For example, the translation amount can be recorded for the image translation, the rotation angle can be recorded for the image rotation, the zoom factor can be recorded for the image zoom, the position of the local area can be recorded for the frame selection of the partial area of the image, and so on.

最后,可以将记录的图像变换操作应用到第二待标注数据中的每张图像上,并在第一区域中刷新显示执行图像变换操作后的第二待标注数据。从而,第二待标注数据中的每张图像也和参考图像一样,图像中与用户注意力集中区域以较显著的方式被显示出来,便于用户进行观察并标注。Finally, the recorded image transformation operation may be applied to each image in the second to-be-annotated data, and the second to-be-annotated data after the image transformation operation is refreshed and displayed in the first area. Therefore, each image in the second data to be annotated is also the same as the reference image, and the area in which the user's attention is concentrated is displayed in a more prominent manner, which is convenient for the user to observe and annotate.

例如,参照图3(A),用户标注界面的左侧部分为第三区域,右侧部分的上半为第一区域,右侧部分的下半则为第二区域。第三区域中有一个固定尺寸的窗口(灰色),高兴类别中的第一张人脸图像被选为参考图像后,显示在该窗口中。For example, referring to FIG. 3(A) , the left part of the user annotation interface is the third area, the upper half of the right part is the first area, and the lower half of the right part is the second area. There is a fixed-size window (grey) in the third area, where the first face image in the happy category is selected as the reference image and displayed in this window.

之后,用户可以在该固定窗口中进行图像的平移、旋转、缩放、框选局部区域中的至少一种操作,其操作参数将被记录,变换过程中超出固定窗口尺寸的部分不显示。参照图3(B),用户进行了平移操作,将图像中的人脸移动到窗口正中,此时可以记录下图像中心相对于窗口中心的偏移量作为平移参数;用户还进行了放大操作,使图像中的人脸充满整个窗口,此时可以记录下图像的放大倍数作为缩放参数;用户还框选了图像在标注时需要重点关注的嘴部区域,如粗虚线方框所示,此时可以记录下嘴部区域的位置作为框选局部区域的参数。After that, the user can perform at least one operation of image translation, rotation, zoom, and frame selection of a local area in the fixed window, and the operation parameters will be recorded, and the part beyond the fixed window size will not be displayed during the transformation process. Referring to Figure 3 (B), the user has performed a translation operation to move the face in the image to the center of the window, and the offset of the center of the image relative to the center of the window can be recorded as a translation parameter at this time; the user also performed a zoom-in operation, The face in the image fills the entire window, and the magnification of the image can be recorded as a zoom parameter; the user also selects the mouth area that needs to be focused on when annotating the image, as shown by the thick dotted box, at this time The position of the mouth area can be recorded as a parameter for the local area selection.

最后,根据记录的平移参数和缩放参数可以生成一个变换矩阵,对第二待标注数据中的每张人脸图像应用该变换矩阵,就可以将人脸移动到画面正中并放大。然后,再根据记录的嘴部区域的位置从各人脸中框选出同位置的区域,并进一步放大框选部分直至充满第二待标注图像的原始显示区域(也可以是一个固定尺寸的窗口),最终的刷新显示效果如图3(B)所示。可见,在第一区域中,人脸图像已经被其嘴部的局部放大图像所替代,根据这些放大图像,用户可以更清楚地看到其中的嘴角弯曲方向,从而可以快速选择出错误的预测标签,或者给出正确的标注标签。Finally, a transformation matrix can be generated according to the recorded translation parameters and zoom parameters, and the transformation matrix can be applied to each face image in the second to-be-annotated data, so that the face can be moved to the center of the screen and enlarged. Then, according to the recorded position of the mouth area, frame the same position from each face, and further enlarge the frame selection until it fills the original display area of the second to-be-annotated image (it can also be a fixed-size window). ), the final refresh display effect is shown in Figure 3(B). It can be seen that in the first area, the face image has been replaced by a partial enlarged image of its mouth. According to these enlarged images, the user can more clearly see the bending direction of the corners of the mouth, so that the wrong prediction label can be quickly selected. , or give the correct callout label.

注意,第一,图像变换操作在应用到第二待标注数据中的每张图像上时,并不一定和其应用到参考图像上的效果完全相同。例如,在图3(B)中,对于框选图像局部区域这种操作,在应用到参考图像上时,只是给出嘴部区域的位置,而在应用到第二待标注数据中的每张图像上时,则不仅要确定出嘴部区域的位置,还要对嘴部区域进行放大显示。Note that, first, when the image transformation operation is applied to each image in the second to-be-labeled data, the effect is not necessarily exactly the same as that applied to the reference image. For example, in Fig. 3(B), when the operation of selecting a local area of the image by a frame is applied to the reference image, only the position of the mouth area is given, and when it is applied to each image in the second to-be-annotated data When the image is displayed, not only the position of the mouth area should be determined, but also the mouth area should be enlarged and displayed.

第二,第一区域和第三区域在用户标注界面中的布局方式不限于图3(A)和图3(B)示出的方式,甚至第一区域和第三区域也可以存在重叠。Second, the layout of the first area and the third area in the user annotation interface is not limited to the method shown in FIG. 3(A) and FIG. 3(B), and even the first area and the third area may overlap.

第三,虽然图3(A)和图3(B)中示出了第一区域、第二区域和第三区域,但在上面基于用户注意力进行数据显示的方案中,是否要设置第二区域是可选的。Third, although the first area, the second area and the third area are shown in FIG. 3(A) and FIG. 3(B), in the above scheme of data display based on user attention, whether to set the second area Regions are optional.

第四,上面基于用户注意力进行数据显示的方案与标注模型是否为分类模型无关,例如,若标注模型是目标检测模型,也可以应用该方案,方便用户更精确地标注目标的位置。Fourth, the above solution for displaying data based on user attention has nothing to do with whether the labeling model is a classification model. For example, if the labeling model is a target detection model, this solution can also be applied to facilitate the user to more accurately label the location of the target.

下面在以上实施例的基础上,继续介绍步骤S130中关于第三待标注数据的标注准确率是否达标的估计方法。在一种实现方式中,步骤S130可以按照以下流程执行:On the basis of the above embodiment, the method for estimating whether the labeling accuracy rate of the third data to be labelled in step S130 is up to the standard will be described below. In an implementation manner, step S130 may be performed according to the following process:

根据第二待标注数据的标签,结合特定的规则从第一待标注数据中确定出第四待标注数据;若第四待标注数据中包含尚未标注的第三待标注数据,则根据第四待标注数据中标注正确的第二待标注数据的数量,估计第三待标注数据的标注准确率是否达标。According to the label of the second to-be-labeled data, the fourth to-be-labeled data is determined from the first to-be-labeled data in combination with specific rules; if the fourth to-be-labeled data includes the third to-be-labeled data that has not The number of correctly labeled second data to be labeled in the labeled data, and it is estimated whether the labeling accuracy of the third data to be labeled meets the standard.

其中,第四待标注数据中可能包含标注正确的第二待标注数据也可能尚未标注过的第三待标注数据,或者同时包含这两种待标注数据,具体包含哪种数据与上述特定规则的设计相关。第二待标注数据标注正确是指:第二待标注数据的标注标签和根据第二待标注数据的推理结果所确定的第二待标注数据的推理标签相同,关于推理标签和标注标签的含义在前文已经阐述,不再重复。Among them, the fourth data to be labeled may include the correctly labeled second data to be labeled, or the third data to be labeled that has not been labeled, or both types of data to be labeled. Design related. The correct labeling of the second data to be labeled means that the labeling label of the second data to be labeled is the same as the reasoning label of the second data to be labeled determined according to the inference result of the second data to be labeled. The meanings of the reasoning label and the labeling label are in The previous article has been explained and will not be repeated.

不妨先考虑第四待标注数据中包含标注正确的第二待标注数据和尚未标注过的第三待标注数据的情况,此时的第四待标注数据相当于从第一待标注数据中划定了一个范围,该范围内的部分待标注数据的推理标签已经被人工确认为是正确的,由于每条待标注数据的推理标签的确定规则是统一的,所以根据该范围内标注正确的数据的数量,可以估计剩余待标注数据的推理标签的准确率。Consider first the case where the fourth data to be labeled includes the correctly labeled second data to be labeled and the third data to be labeled that has not been labeled. At this time, the fourth data to be labeled is equivalent to the first data to be labeled. A range is defined, and the inference labels of some data to be labeled within this range have been manually confirmed as correct. Since the rules for determining the inference labels of each data to be labeled are unified, the correct data is labeled according to the range. number, the accuracy of the inference labels of the remaining data to be labeled can be estimated.

若第四待标注数据中仅包含尚未标注过的第三待标注数据,则等价于第四待标注数据中标注正确的第二待标注数据的数量为0的情况,可以和标注正确的第二待标注数据的数量不为0的情况进行统一处理。若第四待标注数据中仅包含标注正确的第二待标注数据,则说明此时这批第四待标注数据已经标注完成,没有需要自动标注的数据。应当理解,确定第四待标注数据的规则不应当使得第四待标注数据中总是仅包含尚未标注过的第三待标注数据,因为这样标注准确率必然难以达标,也不应当总是仅包含标注正确的第二待标注数据,因为这样相当于总是不进行自动标注。If the fourth data to be labeled only contains the third data to be labeled that has not been labeled, it is equivalent to the situation where the number of correctly labeled second data to be labeled is 0 in the fourth data to be labeled. 2. If the number of data to be labeled is not 0, it will be processed uniformly. If the fourth data to be labeled only includes the correctly labeled second data to be labeled, it means that the fourth batch of data to be labeled has been labeled at this time, and there is no data that needs to be automatically labeled. It should be understood that the rule for determining the fourth to-be-labeled data should not make the fourth to-be-labeled data always include only the third to-be-labeled data that has not been labeled, because the labeling accuracy is bound to be difficult to achieve, nor should it always only contain Label the correct second data to be labeled, because this is equivalent to always not automatically labeling.

进一步的,在步骤S130采用上面的实现方式时,图1中的方法还可以实现为图4中的迭代流程:Further, when the above implementation manner is adopted in step S130, the method in FIG. 1 can also be implemented as the iterative process in FIG. 4:

步骤S210:获取第一待标注数据及其推理结果。Step S210: Obtain the first to-be-labeled data and its inference result.

步骤S210类似步骤S110,不再重复阐述。注意,虽然图4从整体来看是一种迭代流程,但步骤S210并不参与迭代。步骤S220~S260为步骤S120~S140的一种迭代实现方式,或者说每一轮迭代在逻辑上都包括步骤S220~S260(当然,并不一定每一轮迭代步骤S220~S260都会全部执行)。Step S210 is similar to step S110 and will not be repeated. Note that although FIG. 4 is an iterative process as a whole, step S210 does not participate in the iteration. Steps S220-S260 are an iterative implementation of steps S120-S140, or each round of iteration logically includes steps S220-S260 (of course, not all of steps S220-S260 are necessarily executed in each round of iteration).

步骤S220:从第四待标注数据中抽样出在本轮迭代中提供给用户标注的第二待标注数据。Step S220: Sampling the second to-be-labeled data provided to the user for labeling in the current iteration from the fourth to-be-labeled data.

其中,步骤S220中的第四待标注数据既可以认为是上一轮迭代结束时的第四待标注数据,也可以认为是本轮迭代开始时的第四待标注数据,在每一轮迭代中,第四待标注数据可能、但不一定会更新(见步骤S230)。对于首轮迭代,由于不存在上一轮,因此首轮迭代开始时的第四待标注数据为第一待标注数据。Wherein, the fourth data to be labeled in step S220 may be considered to be the fourth data to be labeled at the end of the previous iteration, or the fourth data to be labeled at the beginning of the current iteration, and in each iteration , the fourth to-be-labeled data may, but not necessarily, be updated (see step S230 ). For the first round of iteration, since there is no previous round, the fourth to-be-labeled data at the beginning of the first-round iteration is the first to-be-labeled data.

从第四待标注数据中抽样第二待标注数据的方法不限,每一轮迭代时第二待标注数据都要重新抽样,并且可选的,对于那些在之前轮次中已经被抽样过的第二待标注数据,由于其在之前的迭代轮次中已经被用户标注过,可以不再重复抽样,即可以限定每次抽样的第二待标注数据,都是从上一轮迭代后的第四待标注数据中的、尚未被标注的第三待标注数据中抽样,从而可以避免重复对数据进行标注。The method of sampling the second to-be-labeled data from the fourth to-be-labeled data is not limited. The second to-be-labeled data must be re-sampled in each iteration, and optionally, for those samples that have been sampled in previous rounds The second to-be-labeled data, since it has been labeled by the user in the previous iteration round, can no longer be sampled repeatedly, that is, it can be limited that the second to-be-labeled data for each sampling is from the first iteration after the previous iteration. The fourth data to be labeled is sampled from the third data to be labeled that has not been labeled, so that repeated labeling of the data can be avoided.

步骤S230:获取用户标注的第二待标注数据的标注标签,并根据第二待标注数据的标注标签对第四待标注数据进行筛选。Step S230: Obtain the labeling label of the second data to be labelled marked by the user, and filter the fourth data to be labelled according to the labeling label of the second data to be labelled.

抽样出的第二待标注数据可以送给用户进行标注,并获得其标注标签,具体实现方式可以参考前文,不再重复阐述。The sampled second data to be labeled can be sent to the user for labeling, and the labeling label thereof can be obtained. For the specific implementation method, refer to the foregoing description, which will not be repeated.

若第四待标注数据仅包括标注正确的第二待标注数据和/或尚未标注过的第三待标注数据,则在本轮中的第二待标注数据被标注完后,目前的第四待标注数据可能已经无法满足该要求,所以需要按照特定的规则对第四待标注数据进行筛选,得到新的第四待标注数据,新的第四待标注数据仅包括标注正确的第二待标注数据和/或尚未标注过的第三待标注数据,从而可以对其中第三待标注数据的标注准确率继续进行有效评估。If the fourth data to be labeled only includes the correctly labeled second data to be labeled and/or the third data to be labeled that has not been labeled, then after the second data to be labeled in this round has been labeled, the current fourth data to be labeled The labeled data may no longer meet this requirement, so the fourth to-be-labeled data needs to be screened according to specific rules to obtain new fourth to-be-labeled data, and the new fourth to-be-labeled data only includes the correctly labeled second to-be-labeled data and/or the third data to be labeled that has not been labeled, so that the labeling accuracy of the third data to be labeled can continue to be effectively evaluated.

至于被筛选掉的待标注数据,其中包括标注错误的第二待标注数据,还可能包括某些尚未标注的待标注数据,其处理方式不限,例如,标注错误的第二待标注数据仅仅是说其推理标签存在错误,但其标注标签并无错误(默认人工标注是准确的),因此可以认为其已经标注完成,而对于尚未标注的待标注数据,则可以在标注模型更新后重新进行推理、重新标注,等等。As for the filtered data to be labeled, it includes the wrongly labeled second data to be labeled, and may also include some unlabeled data to be labeled. The processing method is not limited. For example, the wrongly labeled second data to be labeled is only It is said that there is an error in its inference label, but its labeling label is not wrong (the default manual labeling is accurate), so it can be considered that it has been labelled, and for the data to be labelled that has not been labelled, you can re-inference after the labeling model is updated. , relabel, etc.

注意,在步骤S230之后的步骤中,凡是提到第四待标注数据,均指筛选后的得到的新的第四待标注数据,为简单起见,仍然简称为第四待标注数据。Note that, in the steps after step S230, any reference to the fourth data to be labeled refers to the new fourth data to be labeled after screening, and for simplicity, it is still simply referred to as the fourth data to be labeled.

步骤S240:判断第四待标注数据中是否包含尚未标注的第三待标注数据。Step S240: Determine whether the fourth data to be labeled includes the third data to be labeled that has not been labeled.

若第四待标注数据中包含尚未标注的第三待标注数据,则继续执行步骤S250。若第四待标注数据中不包含尚未标注的第三待标注数据,即第四待标注数据中仅包含标注正确的第二待标注数据,此时也无法进行自动标注,从而可以结束对目前这批第四待标注数据的标注。又由于第一待标注数据中除第四待标注数据以外的部分都是因为步骤S230中的筛选操作产生的,若对这部分数据暂时不再进行标注,此时也可以结束对目前这批第一待标注数据的标注。If the fourth data to be labeled includes the third data to be labeled that has not been labeled, step S250 is continued. If the fourth data to be labeled does not contain the third data to be labeled that has not been labeled, that is, the fourth data to be labeled only contains the correctly labeled second data to be labeled, automatic labeling cannot be performed at this time. Batch the labeling of the fourth data to be labelled. And since the part of the first to-be-labeled data except the fourth to-be-labeled data is generated by the screening operation in step S230, if this part of the data is not to be labeled temporarily, at this time, the current batch of A label for the data to be labelled.

步骤S250:根据第四待标注数据中标注正确的第二待标注数据的数量,估计第三待标注数据的标注准确率是否达标。Step S250: According to the number of correctly labeled second data to be labeled in the fourth data to be labeled, it is estimated whether the labeling accuracy of the third data to be labeled meets the standard.

若第三待标注数据的标注准确率已经达标,则继续执行步骤S260,若第三待标注数据的标注准确率尚未达标,则可以开始下一轮迭代,即跳转到步骤S220继续执行。注意,步骤S250中标注正确的第二待标注数据,并不限于本轮迭代中标注的第二待标注数据(即不限于步骤S220中抽样出的第二待标注数据),历次迭代中标注的第二待标注数据均应纳入考虑。If the labeling accuracy of the third to-be-labeled data has reached the standard, proceed to step S260; if the labeling accuracy of the third to-be-labeled data has not yet met the standard, the next round of iteration can be started, that is, jump to step S220 to continue execution. Note that the correct second data to be labeled in step S250 is not limited to the second data to be labeled labeled in this iteration (that is, not limited to the second data to be labeled sampled in step S220), and the data labeled in previous iterations The second data to be labeled should be taken into consideration.

步骤S260:将第三待标注数据的推理标签确定为第三待标注数据的标注标签。Step S260: Determine the inference label of the third data to be labeled as the labeling label of the third data to be labeled.

步骤S260类似步骤S140,不再重复阐述。步骤S260执行完后,这批第四待标注数据的标注也就结束了,并且,若暂时不再对第一待标注数据中除第四待标注数据以外的部分进行标注,此时也可以结束对目前这批第一待标注数据的标注。Step S260 is similar to step S140 and will not be repeated. After the execution of step S260, the labeling of the fourth batch of data to be labelled also ends, and if the part of the first data to be labelled except for the fourth data to be labelled will not be labelled for the time being, it can also end at this time. Annotation of the first batch of data to be labeled at present.

注意,虽然步骤S260名义上属于迭代步骤(例如,该步骤可以包含在迭代部分的代码中),但实际上在整个迭代过程中,该步骤至多只在满足条件时被执行一次,执行完后就会跳出迭代。Note that although step S260 is nominally an iterative step (for example, this step can be included in the code of the iterative part), in fact, in the entire iterative process, this step is executed at most once when the conditions are met, and after the execution is completed, the will jump out of the iteration.

上述迭代流程的关键在于不断对第四待标注数据进行筛选,使得第四待标注数据中的第三待标注的标注准确率估值越来越高,直至达标(当然,也有可能最终无法达标)。由于图4中的流程仅仅是图1中方法的一种实现方式,因此在阐述图4中的步骤时,未提及之处,均可以参考图1中相关步骤的阐述。The key to the above iterative process is to continuously screen the fourth to-be-labeled data, so that the estimated accuracy of the third to-be-labeled data in the fourth to-be-labeled data becomes higher and higher until it reaches the standard (of course, it may eventually fail to meet the standard) . Since the flow in FIG. 4 is only an implementation manner of the method in FIG. 1 , when describing the steps in FIG. 4 , reference may be made to the description of the relevant steps in FIG. 1 for the parts that are not mentioned.

下面,以标注模型是分类模型的情况为例,举例说明迭代步骤S220~S260的两种实现方式。此时,步骤S210中第一待标注数据的推理结果包括第一待标注数据分属每个类别的概率。In the following, two implementation manners of the iterative steps S220 to S260 are illustrated by taking the case where the labeling model is a classification model as an example. At this time, the reasoning result of the first data to be labeled in step S210 includes the probability that the first data to be labeled belongs to each category.

方式1way 1

在执行首轮迭代之前,先根据第一待标注数据的推理结果创建与每个类别对应的标注候选池,一个标注候选池可以理解为一个数据集,或者也可以理解为一个存储空间。例如,若标注模型的分类结果共有nc个类别,则需要创建nc个标注候选池,标注候选池i对应类别i,i为类别序号,比如i可以取0~nc-1之中的任意整数。Before executing the first round of iterations, a label candidate pool corresponding to each category is created according to the inference result of the first data to be labelled. A label candidate pool can be understood as a dataset or a storage space. For example, if the classification results of the annotation model have nc categories, you need to create nc annotation candidate pools. The annotation candidate pool i corresponds to category i, where i is the category number. For example, i can take any integer from 0 to nc-1.

其中,每个标注候选池中包含第一待标注数据及其推理结果中的、第一待标注数属于该标注候选池对应的类别的概率。例如,标注候选池i中包含第一待标注数据及其推理结果中的、第一待标注数属于类别i的概率。Wherein, each labeling candidate pool includes the first to-be-labeled data and its inference result, the probability that the first to-be-labeled number belongs to the category corresponding to the labeling candidate pool. For example, the labeling candidate pool i includes the first to-be-labeled data and the probability that the first to-be-labeled number belongs to the category i among the first to-be-labeled data and its inference result.

注意,所谓标注候选池中包含第一待标注数据,并不是说一定要为每个标注候选池复制一份第一待标注数据,也可以只是将第一待标注数据的标识(例如,每条第一待标注数据的编号)在标注候选池中保存一份,由于根据第一待标注数据的标识可以找到对应的第一待标注数据,因此等效于在标注候选池中保存了第一待标注数据的副本。对于后文中提到的其他数据池,若存在不同的数据池保存相同数据的情况,可以类似理解。Note that the so-called labeling candidate pool contains the first data to be labelled, it does not mean that a copy of the first data to be labelled must be copied for each labelling candidate pool, or just the identifier of the first data to be labelled (for example, each The number of the first to-be-labeled data) is saved in the labeling candidate pool. Since the corresponding first to-be-labeled data can be found according to the identifier of the first to-be-labeled data, it is equivalent to saving the first to-be-labeled data in the labeling candidate pool. A copy of the annotation data. For other data pools mentioned later, if there are different data pools storing the same data, it can be understood similarly.

创建好标注候选池后,每轮迭代可以包括以下步骤:After creating an annotation candidate pool, each iteration can include the following steps:

步骤A1:从所有标注候选池中的第四待标注数据中抽样出在本轮迭代中提供给用户标注的第二待标注数据。Step A1: Sampling the second to-be-labeled data provided to the user for labeling in this round of iterations from the fourth to-be-labeled data in all the labeling candidate pools.

在步骤A1中,每个标注候选池中的第四待标注数据既可以认为是上一轮迭代结束时该标注候选池中的第四待标注数据,也可以认为是本轮迭代开始时该标注候选池中的第四待标注数据,在每一轮迭代中,每个标注候选池中第四待标注数据可能、但不一定会更新(见步骤C1)。对于首轮迭代,由于不存在上一轮,因此首轮迭代开始时,每个标注候选池中的第四待标注数据均为该标注候选池中的第一待标注数据。In step A1, the fourth to-be-labeled data in each labeling candidate pool can be regarded as either the fourth to-be-labeled data in the labeling candidate pool at the end of the previous iteration, or the labeling at the beginning of the current iteration The fourth data to be labeled in the candidate pool, in each round of iteration, the fourth data to be labeled in each labeled candidate pool may, but not necessarily, be updated (see step C1). For the first round of iteration, since there is no previous round, at the beginning of the first round of iteration, the fourth to-be-labeled data in each labeling candidate pool is the first to-be-labeled data in the labeling candidate pool.

从所有标注候选池中的第四待标注数据中抽样第二待标注数据的方法不限,每一轮迭代时第二待标注数据都要重新抽样。例如,可以对所有标注候选池中的第四待标注数据取并集,以去除重复的待标注数据,然后从该并集中抽样产生本轮要标注的第二待标注数据。进一步的,还可以对所有标注候选池中的第四待标注数据中尚未标注的第三待标注数据取并集,然后从该并集中抽样产生本轮要标注的第二待标注数据,从而避免已经标注过的数据被重复抽样。The method of sampling the second to-be-labeled data from the fourth to-be-labeled data in all the labeling candidate pools is not limited, and the second to-be-labeled data needs to be resampled in each iteration. For example, a union of the fourth to-be-labeled data in all the labeling candidate pools may be taken to remove duplicate to-be-labeled data, and then the second to-be-labeled data to be labeled in this round is generated by sampling from the union. Further, it is also possible to take a union of the third unlabeled data to be labeled in the fourth to-be-labeled data in all the labeling candidate pools, and then sample the second to-be-labeled data to be labeled in this round from the union, so as to avoid Data that has already been labeled is resampled.

步骤B1:获取用户标注的第二待标注数据的标注类别。Step B1: Obtain the labeling category of the second data to be labelled marked by the user.

由于此时针对的是分类问题,所以第二待标注数据的标注类别就是步骤S230中提到的第二待标注数据的标注标签。Since the classification problem is aimed at at this time, the labeling category of the second data to be labelled is the labeling label of the second data to be labelled mentioned in step S230.

对于每个标注候选池,执行以下步骤,以任意的标注候选池i为例:For each annotation candidate pool, perform the following steps, taking an arbitrary annotation candidate pool i as an example:

步骤C1:针对步骤A1得到的每条第二待标注数据,以任意的第二待标注数据j为例,若第二待标注数据j的标注类别和标注候选池i对应的类别(即类别i)不同,且第二待标注数据j包含在标注候选池i中的第四待标注数据中,则将标注候选池i中的第四待标注数据缩减为仅包含满足以下条件的待标注数据:其推理结果中属于类别i的概率大于第二待标注数据j的推理结果中属于类别i的概率。Step C1: For each piece of second data to be labeled obtained in step A1, taking any second data to be labeled j as an example, if the labeling category of the second data to be labeled j and the category corresponding to the labeling candidate pool i (that is, the category i ) is different, and the second to-be-labeled data j is included in the fourth to-be-labeled data in the labeling candidate pool i, then the fourth to-be-labeled data in the labeling candidate pool i is reduced to only include the data to be labeled that meets the following conditions: The probability of belonging to category i in the inference result is greater than the probability of belonging to category i in the inference result of the second to-be-labeled data j.

步骤C1中的缩减就是步骤230中的筛选的一种实现方式。类别i就是标注候选池i中所有的第一待标注数据的推理标签,从而若第二待标注数据j的标注类别和类别i不同,则表明第二待标注数据j的推理标签是错误的,而根据前文对第四待标注数据的定义,其中可以仅包含标注正确的第二待标注数据和/或尚未标注过的第三待标注数据,所以第二待标注数据j应当从当前的第四待标注数据中移除。The reduction in step C1 is an implementation of the screening in step 230 . Category i is the inference label of all the first to-be-labeled data in the label candidate pool i, so if the labeling class of the second to-be-labeled data j is different from the class i, it means that the inference label of the second to-be-labeled data j is wrong, According to the above definition of the fourth data to be labeled, it may only include the correctly labeled second data to be labeled and/or the third data to be labeled that has not been labeled, so the second data to be labeled j should be changed from the current fourth data to be labeled. To be removed from the labeled data.

另外,对于标注候选池i中的、除标注错误的第二待标注数据j之外的每条第四待标注数据(第二待标注数据本身也是第四待标注数据),若其推理结果中属于类别i的概率,不大于第二待标注数据j的推理结果中属于类别i的概率,则表明该条第四待标注数据的推理标签只能持平,甚至还不如第二待标注数据j的推理标签(已经是错误标签)可靠,如果将其保留在第四待标注数据中,将使得第三待标注数据的标注准确率估计难以进一步提高,从而这样的第四待标注数据也可以从当前的第四待标注数据中移除。In addition, for each piece of fourth to-be-labeled data (the second to-be-labeled data itself is also the fourth to-be-labeled data) in the labeling candidate pool i except for the wrongly labeled second data to be labeled j, if the reasoning result contains The probability of belonging to category i is not greater than the probability of belonging to category i in the inference result of the second to-be-labeled data j, indicating that the inference label of the fourth to-be-labeled data can only be equal, or even worse than that of the second to-be-labeled data j The reasoning label (already an error label) is reliable. If it is kept in the fourth to-be-labeled data, it will make it difficult to further improve the labeling accuracy of the third to-be-labeled data, so such fourth to-be-labeled data can also be obtained from the current is removed from the fourth to-be-labeled data.

不难看出,除开被移除的待标注数据,第四待标注数据中的剩余数据满足步骤C1中提到的条件。It is not difficult to see that, except for the removed data to be labeled, the remaining data in the fourth data to be labeled satisfies the conditions mentioned in step C1.

图5示出了第四待标注数据的缩减原理。图5中的细线箭头表示标注正确的第二待标注数据(不限于本轮标注的第二待标注数据),粗线箭头表示标注错误的第二待标注数据,尚未标注的第三待标注数据则未示出。FIG. 5 shows the reduction principle of the fourth to-be-labeled data. The thin line arrows in Figure 5 represent the correctly labeled second data to be labeled (not limited to the second data to be labeled in this round of labeling), the thick line arrows represent the wrongly labeled second data to be labeled, and the unlabeled third data to be labeled Data is not shown.

参照图5,假设第二待标注数据j是左起第一个标注错误的第二待标注数据,第四待标注数据位于第二待标注数据j左侧的部分,包括若干标注正确的第二待标注数据以及未示出的第三待标注数据,由于其推理结果中属于类别i的概率大于第二待标注数据j的推理结果中属于类别i的概率(图5最下面为属于类别i的概率的变化趋势),所以在缩减后被保留,第二待标注数据j本身,以及第四待标注数据位于第二待标注数据j右侧的部分,包括一条标注错误的第二待标注数据、若干标注正确的第二待标注数据以及未示出的若干尚未标注的待标注数据,由于其推理结果中属于类别i的概率不大于第二待标注数据j的推理结果中属于类别i的概率,所以在缩减后被移除,从而代表第四待标注数据的矩形方框后半部分变为虚线。Referring to FIG. 5, it is assumed that the second data to be labeled j is the second data to be labeled that is wrongly labeled first from the left, and the fourth data to be labeled is located on the left side of the second data to be labeled j, including a number of correctly labeled second data. The data to be labeled and the third data to be labeled not shown, because the probability of belonging to category i in the inference result is greater than the probability of belonging to category i in the inference result of the second to-be-labeled data j (the bottom of Figure 5 belongs to category i). The change trend of the probability), so it is retained after the reduction, the second to-be-labeled data j itself, and the fourth to-be-labeled data located on the right side of the second to-be-labeled data j, including a wrongly labeled second to-be-labeled data, Several correctly labeled second data to be labeled and some unlabeled data to be labeled that are not shown, since the probability of belonging to category i in the inference result is not greater than the probability of belonging to category i in the inference result of the second data to be labeled j, Therefore, it is removed after reduction, so that the second half of the rectangular box representing the fourth to-be-labeled data becomes a dotted line.

注意,按照上面介绍的缩减方式,在移除标注错误的第二待标注数据j时,也可能“顺便”将第二待标注数据k也移除掉,所以在步骤C1中,还要求在进行缩减之前,先确认第二待标注数据j是否仍包含在标注候选池i中的第四待标注数据中,避免重复移除。Note that according to the reduction method described above, when removing the wrongly labeled second data j to be labeled, the second data to be labeled k may also be removed "by the way", so in step C1, it is also required to perform Before reducing, first confirm whether the second to-be-labeled data j is still included in the fourth to-be-labeled data in the labeling candidate pool i to avoid repeated removal.

参照图5,假设目前要处理的第二待标注数据k是左起第二个标注错误的第二待标注数据,由于之前在处理第二待标注数据j时,已经将第二待标注数据k移除了,所以第二待标注数据k目前已经不在第四待标注数据中,也不会导致第四待标注数据被缩减。Referring to FIG. 5 , it is assumed that the second to-be-labeled data k to be processed is the second to-be-labeled data from the left that is wrongly labeled, because the second to-be-labeled data k has been removed, so the second to-be-labeled data k is not currently included in the fourth to-be-labeled data, and it will not cause the fourth to-be-labeled data to be reduced.

此外,在缩减过程中被移除掉的第四待标注数据,并不一定要从标注数据池i中删除,其也可以继续保留在标注数据池i中。In addition, the fourth to-be-labeled data that is removed during the reduction process does not necessarily have to be deleted from the labeled data pool i, and it can also continue to remain in the labeled data pool i.

在步骤C1之后的本轮迭代步骤中,凡是提到第四待标注数据,均指缩减后的得到的第四待标注数据,为简单起见,仍然简称为第四待标注数据。In this round of iterative steps after step C1, any reference to the fourth data to be labeled refers to the reduced fourth data to be labeled, which is still simply referred to as the fourth data to be labeled for simplicity.

步骤D1:判断标注数据池i中的第四待标注数据中是否包含尚未标注的第三待标注数据。Step D1: Determine whether the fourth data to be labeled in the labeled data pool i includes the third data to be labeled that has not been labeled.

若第四待标注数据中包含尚未标注的第三待标注数据,则继续执行步骤E1。若第四待标注数据中不包含尚未标注的第三待标注数据,即第四待标注数据中仅包含标注正确的第二待标注数据,此时也无法进行自动标注,从而可以跳出迭代过程,结束对标注数据池i的标注。If the fourth to-be-labeled data includes the unlabeled third to-be-labeled data, step E1 is continued. If the fourth data to be labeled does not contain the third data to be labeled that has not been labeled, that is, the fourth data to be labeled only contains the correctly labeled second data to be labeled, automatic labeling cannot be performed at this time, so that the iterative process can be jumped out. End the labeling of labeling data pool i.

步骤E1:根据标注数据池i中的第四待标注数据中标注正确的第二待标注数据的数量,估计第三待标注数据的标注准确率是否达标。Step E1: According to the number of correctly labeled second data to be labeled in the fourth data to be labeled in the labeled data pool i, it is estimated whether the labeling accuracy of the third data to be labeled meets the standard.

这里给出一个估计标注准确率是否达标的判断公式:1/(1+w2/Ci)>acc。Here is a judgment formula for estimating whether the labeling accuracy meets the standard: 1/(1+w 2 /Ci)>acc.

其中,大于号左侧为标注准确率的估算公式,右侧的acc为阐述步骤S130时提到的目标准确率,若左侧大于右侧,则表明标注准确率达标。在左侧的表达式中,Ci为标注候选池i的第四待标注数据中标注正确的第二待标注数据的数量(注意,这Ci条第二待标注数据不一定是本轮中的,之前各迭代轮次中标准正确的第二待标注数据若仍属于本轮中的第四待标注数据,则也对Ci产生贡献),w为与置信度相关的预设值,w的值越大,估计出的准确率的置信度越高,例如,w=2时,置信度为95%。Wherein, the left side of the greater than sign is the estimation formula of the labeling accuracy, and the acc on the right is the target accuracy rate mentioned in the description of step S130. If the left side is greater than the right side, it means that the labeling accuracy rate meets the standard. In the expression on the left, Ci is the number of correctly labeled second to-be-labeled data in the fourth to-be-labeled data of the labeled candidate pool i (note that the Ci second to-be-labeled data is not necessarily in this round, If the second to-be-labeled data with correct standards in previous iteration rounds still belongs to the fourth to-be-labeled data in this round, it will also contribute to Ci), w is a preset value related to confidence, and the higher the value of w The higher the confidence of the estimated accuracy, for example, when w=2, the confidence is 95%.

应当理解,估计标注准确率也可能采用其他公式,对此本申请并不限定。另外,判断标注准确率是否达标,并不意味着一定要显式计算出标注准确率估值,例如,把上面的公式变形一下,得到Ci>w2/(1/acc-1),即用Ci和某个阈值比较也可以进行判断。It should be understood that other formulas may also be used to estimate the labeling accuracy, which is not limited in this application. In addition, judging whether the labeling accuracy meets the standard does not mean that it is necessary to explicitly calculate the labeling accuracy estimate. For example, transform the above formula to get Ci>w 2 /(1/acc-1), that is, use Comparison of Ci and a certain threshold value can also be used for judgment.

若第三待标注数据的标注准确率已经达标,则继续执行步骤F1,若第三待标注数据的标注准确率尚未达标,则可以开始下一轮迭代,即跳转到步骤A1继续执行。If the labeling accuracy of the third data to be labeled has reached the standard, continue to step F1; if the labeling accuracy of the third data to be labeled has not met the standard, the next round of iteration can be started, that is, jump to step A1 to continue execution.

步骤F1:将类别i确定为第三待标注数据的标注类别。Step F1: Determine the category i as the labeling category of the third data to be labelled.

其中,根据步骤C1中的阐述,类别i为第三待标注数据的推理标签,而第三待标注数据的标注类别就是步骤S260中提到的第三待标注数据的标注标签。步骤F1执行完后,可以跳出迭代过程,结束对标注数据池i的标注。Wherein, according to the description in step C1, category i is the reasoning label of the third data to be labeled, and the labeling category of the third data to be labeled is the labeling label of the third data to be labeled mentioned in step S260. After the execution of step F1, the iterative process can be jumped out, and the labeling of the labeling data pool i can be ended.

可选的,方式1在创建标注候选池时,还可以将每个标注候选池中的第一待标注数据,按照其推理结果中的、属于该标注候选池对应的类别的概率降序排序。此时步骤C1中可以按照如下方式实现:Optionally, when creating an annotation candidate pool in method 1, the first data to be annotated in each annotation candidate pool may also be sorted in descending order according to the probability of belonging to the category corresponding to the annotation candidate pool in the inference result. At this time, step C1 can be implemented as follows:

针对步骤A1得到的每条第二待标注数据,若第二待标注数据j的标注类别和类别i不同,且第二待标注数据j的排序索引不大于标注候选池i中的第四待标注数据的最大排序索引,则将标注候选池i中的第四待标注数据缩减为仅包含满足以下条件的待标注数据:其排序索引小于第二待标注数据j的排序索引。For each piece of second data to be labeled obtained in step A1, if the labeling category of the second data to be labeled j is different from the class i, and the sorting index of the second data to be labeled j is not greater than the fourth data to be labeled in the labeling candidate pool i The largest sorting index of the data, the fourth to-be-labeled data in the labeling candidate pool i is reduced to only include the to-be-labeled data that satisfies the following conditions: its sorting index is smaller than the sorting index of the second to-be-labeled data j.

其中,待标注数据的排序索引可以指其在标注候选池i中的排序序号,由于标注候选池i中的第一待标注数据是按照其推理结果中对应于类别i的概率降序排序的,所以若某条第四待标注数据的排序索引小于第二待标注数据j的排序索引,表明其推理结果中属于类别i的概率大于第二待标注数据j的推理结果中属于类别i的概率,即与步骤C1中的条件是一致的。Among them, the sorting index of the data to be labeled may refer to its sorting sequence number in the labeling candidate pool i. Since the first data to be labeled in the labeling candidate pool i is sorted in descending order according to the probability corresponding to the category i in the inference result, so If the sorting index of a fourth piece of data to be labeled is smaller than the sorting index of the second data to be labeled j, it indicates that the probability of belonging to category i in the inference result is greater than the probability of belonging to category i in the inference result of the second data to be labeled j, that is, It is the same as the condition in step C1.

不难看出,按照以上方式进行缩减,第四待标注数据的排序索引的分布范围是单方向缩小的。例如,若排序索引从0开始递增计数,则最开始时,第四待标注数据的排序索引的分布范围是[0,m-1],m为第一待标注数据的数量,一轮迭代之后,第四待标注数据的排序索引的分布范围是[0,m1-1],m1≤m,两轮迭代之后,第四待标注数据的排序索引的分布范围是[0,m2-1],m2≤m1,以此类推。It is not difficult to see that, by reducing in the above manner, the distribution range of the sorting index of the fourth to-be-labeled data is reduced in one direction. For example, if the sorting index starts counting up from 0, at the beginning, the distribution range of the sorting index of the fourth data to be labeled is [0, m-1], where m is the number of the first data to be labeled, and after one iteration , the distribution range of the sorting index of the fourth data to be labeled is [0, m1-1], m1≤m, after two rounds of iterations, the distribution range of the sorting index of the fourth data to be labeled is [0, m2-1], m2≤m1, and so on.

进一步的,为避免重复移除数据,步骤C1中还要求在缩减之前应满足条件“第二待标注数据j包含在标注候选池i中的第四待标注数据中”,对于标注候选池按概率进行了降序排序的情况,此条件可以等价为第二待标注数据j的排序索引不大于标注候选池i中的第四待标注数据的最大排序索引。Further, in order to avoid repeated removal of data, step C1 also requires that the condition "the second to-be-labeled data j is included in the fourth to-be-labeled data in the labeling candidate pool i" should be satisfied before the reduction, and the labeling candidate pool is based on the probability In the case of descending sorting, this condition can be equivalent to that the sorting index of the second to-be-labeled data j is not greater than the maximum sorting index of the fourth to-be-labeled data in the labeling candidate pool i.

可见,若先对标注候选池中的数据进行排序,在执行第四待标注数据的缩减时,仅需进行简单的排序索引的比较,而不用进行概率值的比较,因此提高了处理效率。It can be seen that if the data in the labeling candidate pool is sorted first, when performing the fourth reduction of the data to be labelled, it is only necessary to perform a simple comparison of the sorting index instead of the comparison of the probability values, thus improving the processing efficiency.

假设待标注数据的排序索引从0开始递增计数,用Li表示标注候选池i中第四待标注数据的数量(此时第四待标注数据的最大排序索引为Li-1),则上述对步骤C1的实现还可以进一步简化描述为:Assuming that the sorting index of the data to be labeled starts counting up from 0, and Li represents the number of the fourth data to be labeled in the labeling candidate pool i (the maximum sorting index of the fourth data to be labeled is Li-1 at this time), then the above steps The implementation of C1 can be further simplified and described as:

若第二待标注数据j的标注类别和类别i不同,则将标注候选池i中的第四待标注数据的数量Li缩减为min(index(j,i),Li)。If the labeling category of the second to-be-labeled data j is different from the category i, the quantity Li of the fourth to-be-labeled data in the labeling candidate pool i is reduced to min(index(j,i),Li).

其中,index(j,i)表示第二待标注数据j在标注候选池i中的排序索引,下面简单解释该公式的含义:Among them, index(j,i) represents the sorting index of the second data to be labeled j in the labeling candidate pool i. The meaning of this formula is briefly explained below:

根据前文可知,由于在缩减过程中,第四待标注数据的排序索引的分布范围是单方向缩小的,所以第四待标注数据的数量Li缩减为min(index(j,i),Li),等价于第四待标注数据的排序索引的分布范围缩减为[0,min(index(j,i),Li)-1]。显然,区间[0,min(index(j,i),Li)-1]中的任意一个数都小于index(j,i),即缩减后的第四待标注数据的排序索引小于第二待标注数据j的排序索引。As can be seen from the foregoing, since the distribution range of the sorting index of the fourth data to be labeled is reduced in one direction during the reduction process, the number Li of the fourth data to be labeled is reduced to min(index(j,i),Li), The distribution range of the sorting index equivalent to the fourth to-be-labeled data is reduced to [0, min(index(j,i),Li)-1]. Obviously, any number in the interval [0, min(index(j,i),Li)-1] is smaller than index(j,i), that is, the sorted index of the reduced fourth data to be labeled is smaller than the second index to be labeled Sort index of label data j.

并且,只有在index(j,i)<Li或者说index(j,i)≤Li-1时,Li才会发生变化,否则Li仍然维持原取值,即仅当第二待标注数据j的排序索引不大于标注候选池i中的第四待标注数据的最大排序索引Li-1时,缩减才有可能发生。Moreover, Li will change only when index(j,i)<Li or index(j,i)≤Li-1, otherwise Li still maintains the original value, that is, only when the second to-be-labeled data j is The reduction is possible only when the sorting index is not greater than the largest sorting index Li-1 of the fourth to-be-labeled data in the labeling candidate pool i.

可选的,方式1在执行步骤B1之前,还可以根据第二待标注数据的推理结果,确定第二待标注数据的预测类别(即预测标签),并在用户标注界面上显示第二待标注数据及其预测类别,以提高用户标注的效率。Optionally, before step B1 is performed in Mode 1, the predicted category (ie, predicted label) of the second data to be labeled may also be determined according to the inference result of the second data to be labeled, and the second data to be labeled may be displayed on the user labeling interface. data and its predicted categories to improve the efficiency of user annotation.

若标注候选池中的第一待标注数据,按照其推理结果中的属于该标注候选池对应的类别的概率进行了降序排序,则在每一轮迭代时,第二待标注数据的预测类别可以按照以下方式来确定,以任意一条第二待标注数据j为例:If the first to-be-labeled data in the labeling candidate pool is sorted in descending order according to the probability of belonging to the category corresponding to the labeling candidate pool in its inference result, then in each round of iteration, the predicted class of the second to-be-labeled data can be It is determined in the following manner, taking any second piece of data j to be labeled as an example:

首先,获取第二待标注数据j在每个标注候选池中的排序索引,例如index(j,i),i取遍0~nc-1,即共获得nc个排序索引。First, obtain the ranking index of the second to-be-labeled data j in each labeling candidate pool, for example, index(j, i), and i is taken from 0 to nc-1, that is, a total of nc ranking indexes are obtained.

然后,将每个排序索引用对应的标注候选池中的第四待标注数据的数量进行归一化,得到归一化后的排序索引。例如,index(j,i)归一化后可以是index(j,i)/Li。注意,由于给出预测标签的步骤是在步骤B1之前执行的,此时本轮迭代中关于第四待标注数据的缩减还未执行,所以Li应为本轮迭代开始时第四待标注数据的数量。Then, each sorting index is normalized by the number of the fourth data to be labeled in the corresponding labeling candidate pool, to obtain a normalized sorting index. For example, index(j,i) can be index(j,i)/Li after normalization. Note that since the step of giving the predicted label is performed before step B1, the reduction of the fourth to-be-labeled data in this round of iteration has not been performed, so Li should be the fourth to-be-labeled data at the beginning of this iteration. quantity.

最后,将所有归一化后的排序索引中的最小排序索引对应的类别确定为第二待标注数据j的预测类别。例如,将argmin_i(index(j,i)/Li)作为第二待标注数据j的预测类别。其中,argmin_i表示计算使得后面括号内的数值取最小值时的i值。Finally, the category corresponding to the smallest sorting index among all the normalized sorting indexes is determined as the predicted category of the second to-be-labeled data j. For example, take argmin_i(index(j,i)/Li) as the predicted category of the second data j to be labeled. Among them, argmin_i represents the i value when the value in the following parentheses is calculated to take the minimum value.

通过此方式确定的预测类别,由于用标注候选池中的第四待标注数据的数量对排序索引进行了归一化,相当于削弱了不同类别的数据在分布上的差异,从而有利于改善预测类别的精度,进而提高人工标注的效率。The prediction category determined in this way, because the sorting index is normalized by the number of the fourth to-be-labeled data in the labeling candidate pool, which is equivalent to weakening the difference in the distribution of data of different categories, which is conducive to improving the prediction. The accuracy of the category, thereby improving the efficiency of manual annotation.

方式2way 2

方式2无需创建标注候选池,或者也可以认为方式2中的标注候选池只有一个,全体第一待标注数据都在该标注候选池中。每轮迭代可以包括以下步骤:There is no need to create an annotation candidate pool in method 2, or it can be considered that there is only one annotation candidate pool in method 2, and all the first to-be-labeled data are in this annotation candidate pool. Each iteration can include the following steps:

步骤A2:从第四待标注数据中抽样出在本轮迭代中提供给用户标注的第二待标注数据。Step A2: Sampling the second to-be-labeled data provided to the user for labeling in this round of iterations from the fourth to-be-labeled data.

其中,首轮迭代开始时的第四待标注数据为第一待标注数据。步骤A2和步骤S220、步骤A1类似,不再重复阐述。The fourth data to be labeled at the beginning of the first iteration is the first data to be labeled. Step A2 is similar to step S220 and step A1 and will not be repeated.

步骤B2:获取用户标注的第二待标注数据的标注类别。Step B2: Obtain the labeling category of the second data to be labelled marked by the user.

由于此时针对的是分类问题,所以第二待标注数据的标注类别就是步骤S230中提到的第二待标注数据的标注标签。Since the classification problem is aimed at at this time, the labeling category of the second data to be labelled is the labeling label of the second data to be labelled mentioned in step S230.

步骤C2:针对步骤A2得到的每条第二待标注数据,以任意的第二待标注数据j为例,若第二待标注数据j的标注类别和其推理结果中的最大概率对应的类别不同,且第二待标注数据j包含在第四待标注数据中,则将第四待标注数据缩减为仅包含满足以下条件的待标注数据:其推理结果中的最大概率大于第二待标注数据j的推理结果中的最大概率。Step C2: For each piece of second data to be labeled obtained in step A2, taking any second data to be labeled j as an example, if the labeling category of the second data to be labeled j is different from the category corresponding to the maximum probability in its inference result , and the second to-be-labeled data j is included in the fourth to-be-labeled data, then the fourth to-be-labeled data is reduced to only include the to-be-labeled data that satisfies the following conditions: the maximum probability in the inference result is greater than the second to-be-labeled data j The maximum probability in the inference result of .

步骤C2中的缩减就是步骤230中的筛选的一种实现方式。所有第一待标注数据的推理标签就是其推理结果中的、第一待标注数据分属每个类别的概率中的最大值(简称推理结果中的最大概率)所对应的类别。从而若第二待标注数据j的标注类别和其推理结果中的最大概率对应的类别不同,则表明第二待标注数据j的推理标签是错误的,而根据前文对第四待标注数据的定义,其中可以仅包含标注正确的第二待标注数据和/或尚未标注过的第三待标注数据,所以第二待标注数据j应当从当前的第四待标注数据中移除。The reduction in step C2 is an implementation of the screening in step 230 . The reasoning label of all the first data to be labeled is the category corresponding to the maximum value of the probabilities of the first data to be labeled belonging to each category (referred to as the maximum probability in the reasoning result) in the reasoning result. Therefore, if the labeling category of the second to-be-labeled data j is different from the class corresponding to the maximum probability in the inference result, it indicates that the inference label of the second to-be-labeled data j is wrong, and according to the previous definition of the fourth to-be-labeled data , which may only include the correctly labeled second data to be labeled and/or the third data to be labeled that has not been labeled, so the second data to be labeled j should be removed from the current fourth data to be labeled.

另外,对于除标注错误的第二待标注数据j之外的每条第四待标注数据(第二待标注数据本身也是第四待标注数据),若其推理结果中的最大概率不大于第二待标注数据j的推理结果中的最大概率,则表明该条第四待标注数据的推理标签只能持平,甚至还不如第二待标注数据j的推理标签(已经是错误标签)可靠,如果将其保留在第四待标注数据中,将使得第三待标注数据的标注准确率估计难以进一步提高,从而这样的第四待标注数据也可以从当前的第四待标注数据中移除。In addition, for each piece of fourth to-be-labeled data except the wrongly labeled second to-be-labeled data j (the second to-be-labeled data itself is also the fourth to-be-labeled data), if the maximum probability in the inference result is not greater than the second The maximum probability in the inference result of the data j to be labeled indicates that the inference label of the fourth data to be labeled can only be equal, or even less reliable than the inference label of the second data j to be labeled (already an error label). It remains in the fourth to-be-labeled data, which will make it difficult to further improve the estimation of the labeling accuracy of the third to-be-labeled data, so that such fourth to-be-labeled data can also be removed from the current fourth to-be-labeled data.

不难看出,除开被移除的待标注数据,第四待标注数据中的剩余数据满足步骤C2中提到的条件。It is not difficult to see that, except for the removed data to be labeled, the remaining data in the fourth data to be labeled satisfies the conditions mentioned in step C2.

在步骤C2之后的本轮迭代步骤中,凡是提到第四待标注数据,均指缩减后的得到的第四待标注数据,为简单起见,仍然简称为第四待标注数据。In this round of iterative steps after step C2, any reference to the fourth data to be labeled refers to the reduced fourth data to be labeled, which is still simply referred to as the fourth data to be labeled for simplicity.

步骤D2:判断第四待标注数据中是否包含尚未标注的第三待标注数据。Step D2: Determine whether the fourth data to be labeled includes the third data to be labeled that has not been labeled.

若第四待标注数据中包含尚未标注的第三待标注数据,则继续执行步骤E2。若第四待标注数据中不包含尚未标注的第三待标注数据,即第四待标注数据中仅包含标注正确的第二待标注数据,此时也无法进行自动标注,从而可以跳出迭代过程,结束对第一待标注数据的标注。If the fourth to-be-labeled data includes the unlabeled third to-be-labeled data, step E2 is continued. If the fourth data to be labeled does not contain the third data to be labeled that has not been labeled, that is, the fourth data to be labeled only contains the correctly labeled second data to be labeled, automatic labeling cannot be performed at this time, so that the iterative process can be jumped out. End the labeling of the first data to be labelled.

步骤E2:根据第四待标注数据中标注正确的第二待标注数据的数量,估计第三待标注数据的标注准确率是否达标。Step E2: According to the number of correctly labeled second data to be labeled in the fourth data to be labeled, it is estimated whether the labeling accuracy of the third data to be labeled meets the standard.

估计标注准确率是否达标的判断公式可以为:1/(1+w2/C)>acc。其中,C为第四待标注数据中标注正确的第二待标注数据的数量(注意,这C条第二待标注数据不一定是本轮中的,之前各迭代轮次中标准正确的第二待标注数据若仍属于本轮中的第四待标注数据,则也对C产生贡献),w为与置信度相关的预设值,acc为阐述步骤S130时提到的目标准确率。不难看出,该公式的和前面的公式1/(1+w2/Ci)>acc是类似的,只是Ci换成了C,因为方式2本来就可以视为只有一个标注候选池。The judgment formula for estimating whether the labeling accuracy meets the standard can be: 1/(1+w 2 /C)>acc. Among them, C is the number of correctly labeled second data to be labeled in the fourth data to be labeled (note that the C second data to be labeled are not necessarily in this round, and the second data to be labeled with correct standards in previous iteration rounds) If the data to be labeled still belongs to the fourth data to be labeled in this round, it will also contribute to C), w is a preset value related to confidence, and acc is the target accuracy rate mentioned in step S130. It is not difficult to see that this formula is similar to the previous formula 1/(1+w 2 /Ci)>acc, except that Ci is replaced by C, because method 2 can be regarded as only one annotation candidate pool.

应当理解,判断标注准确率是否达标也可能采用其他公式,对此本申请并不限定。It should be understood that other formulas may also be used to determine whether the labeling accuracy rate meets the standard, which is not limited in this application.

若第三待标注数据的标注准确率已经达标,则继续执行步骤F2,若第三待标注数据的标注准确率尚未达标,则可以开始下一轮迭代,即跳转到步骤A2继续执行。If the labeling accuracy of the third to-be-labeled data has reached the standard, proceed to step F2; if the labeling accuracy of the third to-be-labeled data has not met the standard, the next round of iteration can be started, that is, jump to step A2 to continue execution.

步骤F2:将第三待标注数据的推理结果中的最大概率对应的类别确定为第三待标注数据的标注类别。Step F2: Determine the category corresponding to the maximum probability in the inference result of the third to-be-labeled data as the labeling class of the third to-be-labeled data.

其中,根据步骤C2中的阐述,第三待标注数据的推理结果中的最大概率对应的类别为第三待标注数据的推理标签,而第三待标注数据的标注类别就是步骤S260中提到的第三待标注数据的标注标签。步骤F2执行完后,可以跳出迭代过程,结束对第一待标注数据的标注。Wherein, according to the description in step C2, the category corresponding to the maximum probability in the inference result of the third data to be labeled is the inference label of the third data to be labeled, and the labeling class of the third data to be labeled is the one mentioned in step S260 The third label of the data to be labelled. After the execution of step F2, the iterative process can be jumped out, and the labeling of the first data to be labelled is ended.

可选的,方式2在开始迭代之前,还可以将第一待标注数据按照其推理结果中的、第一待标注数据分属每个类别的概率中的最大概率降序排序。此时步骤C2中可以按照如下方式实现:Optionally, before starting the iteration in Manner 2, the first data to be labeled may be sorted in descending order according to the maximum probability in the inference result that the first data to be labeled belong to each category. At this time, step C2 can be implemented as follows:

针对步骤A2中得到的每条第二待标注数据,若第二待标注数据j的标注类别和其推理结果中的最大概率对应的类别不同,且第二待标注数据j的排序索引不大于第四待标注数据中的最大排序索引,则将第四待标注数据缩减为仅包含满足以下条件的待标注数据:其排序索引小于第二待标注数据j的排序索引。For each piece of second data to be labeled obtained in step A2, if the labeling category of the second data to be labeled j is different from the class corresponding to the maximum probability in the inference result, and the sorting index of the second data to be labeled j is not greater than the first 4. The largest sorting index in the data to be labeled, the fourth data to be labeled is reduced to only include data to be labeled that meets the following conditions: its sorting index is smaller than the sorting index of the second data to be labeled j.

其中,待标注数据的排序索引可以指其在第一待标注数据中的排序序号,由于第一待标注数据是按照其推理结果中的最大概率降序排序的,所以若某条第四待标注数据的排序索引小于第二待标注数据j的排序索引,表明其推理结果中的最大概率大于第二待标注数据j的推理结果中的最大概率,即与步骤C2中的条件是一致的。不难看出,按照以上方式进行缩减,第四待标注数据的排序索引的分布范围是单方向缩小的。The sorting index of the data to be marked may refer to its sorting sequence number in the first data to be marked. Since the first data to be marked is sorted in descending order according to the maximum probability in the inference result, if a fourth The sorting index of j is smaller than the sorting index of the second to-be-labeled data j, indicating that the maximum probability in the inference result is greater than the maximum probability in the inference result of the second to-be-labeled data j, that is, it is consistent with the condition in step C2. It is not difficult to see that, by reducing in the above manner, the distribution range of the sorting index of the fourth to-be-labeled data is reduced in one direction.

进一步的,为避免重复移除数据,步骤C2中还要求在缩减之前应满足条件“第二待标注数据j包含在第四待标注数据中”,对于第一待标注数据按概率进行了降序排序的情况,此条件可以等价为第二待标注数据j的排序索引不大于第四待标注数据的最大排序索引。Further, in order to avoid repeated removal of data, step C2 also requires that the condition "the second data to be labeled j is included in the fourth data to be labeled" should be satisfied before the reduction, and the first data to be labeled is sorted in descending order by probability. In the case of , this condition can be equivalent to that the sorting index of the second to-be-labeled data j is not greater than the maximum sorting index of the fourth to-be-labeled data.

可见,若先对第一待标注数据进行排序,在执行第四待标注数据的缩减时,仅需进行简单的排序索引的比较,而不用进行概率值的比较,因此提高了处理效率。It can be seen that if the first to-be-labeled data is sorted first, when performing the reduction of the fourth to-be-labeled data, it is only necessary to perform a simple comparison of sorting indexes instead of probability values, thus improving processing efficiency.

假设待标注数据的排序索引从0开始递增计数,用L表示第四待标注数据的数量(此时第四待标注数据的最大排序索引为L-1),则上述对步骤C2的实现还可以进一步简化描述为:Assuming that the sorting index of the data to be marked starts counting up from 0, and L represents the number of the fourth data to be marked (at this time, the maximum sorting index of the fourth data to be marked is L-1), then the above implementation of step C2 can also be A further simplified description is:

若第二待标注数据j的标注类别和其推理结果中的最大概率对应的类别不同,则将第四待标注数据的数量L缩减为min(index(j),L)。其中,index(j)表示第二待标注数据j在第一待标注数据中的排序索引,该公式的以可以参照方式1中的公式min(index(j,i),Li)进行理解,不再重复阐述。If the labeling category of the second to-be-labeled data j is different from the category corresponding to the maximum probability in the inference result, the quantity L of the fourth to-be-labeled data is reduced to min(index(j), L). Among them, index(j) represents the sorting index of the second data to be labeled j in the first data to be labeled, and the formula can be understood by referring to the formula min(index(j,i),Li) in Mode 1, and it is not Repeat the elaboration.

可选的,方式2在执行步骤B2之前,还可以根据第二待标注数据的推理结果,确定第二待标注数据的预测类别(即预测标签),并在用户标注界面上显示第二待标注数据及其预测类别,以提高用户标注的效率。Optionally, before step B2 is performed in Mode 2, the predicted category (ie, the predicted label) of the second data to be labeled can also be determined according to the inference result of the second data to be labeled, and the second data to be labeled can be displayed on the user labeling interface. data and its predicted categories to improve the efficiency of user annotation.

若第一待标注数据,按照其推理结果中的最大概率进行了降序排序,第二待标注数据的预测类别可以按照以下方式来确定(与迭代轮次无关),以任意一条第二待标注数据j为例:If the first to-be-labeled data is sorted in descending order according to the highest probability in its inference result, the prediction category of the second to-be-labeled data can be determined in the following manner (regardless of the iteration round), using any second to-be-labeled data j for example:

将第二待标注数据j的推理结果中的最大概率对应的类别确定为第二待标注数据j的预测类别。通过此方式确定预测类别十分简单快速。The category corresponding to the maximum probability in the inference result of the second data j to be labeled is determined as the predicted category of the second data j to be labeled. Determining the prediction category in this way is simple and fast.

简单对比方式1和方式2,方式2在实现上比较简单,无需创建多个标注候选池。当方式1的优势在于,针对每个类别的数据都有一个标注候选池,每个标注候选池中的第四待标注数据的数量是不同的,相当于自适应地为每个类别都设置了一个判别阈值,来决定哪些数据可以被标注为该类别,而并非每个类别都设置相同的判别阈值(如,概率值1/nc),从而可以在一定程度上克服待标注数据中存在的偏置(即每个类别的数据分布不同),改善标注的准确率。A simple comparison between method 1 and method 2, method 2 is relatively simple in implementation, and there is no need to create multiple annotation candidate pools. The advantage of method 1 is that there is an annotation candidate pool for each category of data, and the number of fourth to-be-annotated data in each annotation candidate pool is different, which is equivalent to adaptively setting each category. A discriminant threshold to decide which data can be labeled as this category, and not every category is set with the same discrimination threshold (eg, probability value 1/nc), which can overcome the bias in the data to be labeled to a certain extent. Setting (that is, the data distribution of each category is different), to improve the accuracy of labeling.

应当理解,即使对于标注模型是分类模型的情况,迭代步骤S220~S260的也不限于方式1和方式2两种实现方式,比如,在方式2的某种实现方式中,按照推理结果中的最大概率对第一待标注数据进行降序排序,该最大概率也可以替换成其他指标。It should be understood that even in the case where the labeling model is a classification model, the iterative steps S220 to S260 are not limited to the two implementations of Mode 1 and Mode 2. The probability sorts the first data to be labeled in descending order, and the maximum probability can also be replaced with other indicators.

在阐述方式1和方式2的步骤时,未提及之处,均可以参考图1及图4中相关步骤的阐述,或者两种方式相互参照。When describing the steps of Mode 1 and Mode 2, for the parts not mentioned, reference may be made to the description of the relevant steps in FIG. 1 and FIG. 4 , or the two modes may refer to each other.

根据前文的阐述可知,图4中的数据标注方法只对当前的第四待标注数据中尚未标注的第三待标注数据给出标注准确率估计,对于其他待标注数据,其标注准确率则是未知,并且只在第三待标注数据的标注准确率达标时,才给出其标签,标注准确率未达标时,第三待标注数据的标签则是未知,并且其他尚未标注的待标注数据(步骤S230中被筛选掉的),其标签也是未知。According to the previous description, the data labeling method in Fig. 4 only gives the labeling accuracy estimate for the third data to be labelled that has not been labelled in the current fourth data to be labelled. For other data to be labelled, the labeling accuracy is It is unknown, and its label is given only when the labeling accuracy of the third to-be-labeled data reaches the standard. screened out in step S230), its label is also unknown.

即,并不能保证每条待标注数据在任何时刻都有一个当前合理的标注准确率和一个当前合理的标签,这给某些应用场景带来了困难:例如,用户标注了一段时间之后,因故不得不停止标注,并希望根据目前的标注进度,获取尽可能多的、标注准确率大于96%(目标准确率为99%)的数据及其标签用于任务模型的训练,但按照之前介绍的方法,至多只能给出目前的第三待标注数据的标注准确率估值,难以满足用户需求。That is, it is not guaranteed that each piece of data to be labeled has a current reasonable labeling accuracy rate and a current reasonable label at any time, which brings difficulties to some application scenarios: for example, after the user labels for a period of time, Therefore, we have to stop labeling, and hope to obtain as much data and labels with labeling accuracy greater than 96% (target accuracy rate 99%) as possible for training the task model according to the current labeling progress, but according to the previous introduction method, at most it can only give an estimate of the labeling accuracy of the current third data to be labelled, which is difficult to meet user needs.

针对上述问题,在一种改进方案中,为每条待标注数据都增设两项属性:标注准确率属性和标注标签属性,标注准确率属性的中存储该条待标注数据当前的标注准确率估值,标注标签属性中存储该条待标注数据当前的标签估值。这样,用户随时可以结束标注,并根据每条待标注数据的标注准确率属性的值来筛选其是否可作为任务模型的训练样本,并根据其标注标签属性的值为训练样本打上标签。In response to the above problems, in an improved scheme, two attributes are added for each piece of data to be labeled: the labeling accuracy attribute and the labeling label attribute. The labeling accuracy attribute stores the current labeling accuracy estimate of the piece of data to be labeled. value, the label attribute of the label stores the current label estimate of the piece of data to be labelled. In this way, the user can end the labeling at any time, and according to the value of the labeling accuracy attribute of each piece of data to be labeled, whether it can be used as a training sample of the task model, and label the training sample according to the value of its labeling attribute.

下面,结合前面方式1中的步骤,来举例说明如何计算每条待标注数据的标注准确率属性和标注标签属性,由于方式1针对的是分类问题,所以标注标签属性也可以改称标注类别属性。In the following, combined with the steps in the previous method 1, an example is given to illustrate how to calculate the annotation accuracy attribute and the annotation label attribute of each piece of data to be labeled. Since the method 1 is aimed at the classification problem, the annotation label attribute can also be renamed as the annotation category attribute.

首先,执行初始化步骤,可以在执行迭代步骤之前为第一待标注数据的这两项属性设置初始值,例如,对于标注准确率属性,可以将其初始值设置为0、1/nc等,对于标注标签属性,可以将其初始值设置为标签未知(可视为一个特殊标签),或者也可以设置为其推理标签等。First, perform the initialization step, and you can set initial values for these two attributes of the first data to be labeled before executing the iterative step. For example, for the labeling accuracy attribute, you can set its initial value to 0, 1/nc, etc., for Annotation label attribute, its initial value can be set to the label unknown (can be regarded as a special label), or it can also be set to its inference label, etc.

注意,如果某条第一待标注数据的这两项数据本来就有值,且并非初始值,则无需对其进行初始化,原因在于,这些待标注数据在之前可能标注过(比如之前的某批第一待标注数据),之前标注的时候就计算过这两项属性的值,但在之前标注的时候被缩减掉了,并未被打上最终的标注标签,所以本次又被加入到当前的一批第一待标注数据中,重新标注(由于此时标注模型可能已经优化,所以其对同一条待标注数据的推理结果也很可能和之前的不同,重新标注可能会得到新的结果)。Note that if the two items of the first piece of data to be labeled already have values and are not initial values, there is no need to initialize them, because these data to be labeled may have been labeled before (such as a previous batch of data) The first data to be labeled), the values of these two attributes were calculated during the previous labeling, but were reduced during the previous labeling, and were not marked with the final labeling label, so this time they were added to the current In the first batch of data to be labeled, re-label (because the labeling model may have been optimized at this time, its inference result for the same data to be labeled may also be different from the previous one, and re-labeling may result in new results).

在执行步骤B1之后,可以将每条第二待标注数据的标注准确率属性的值设置为第一数值,并将其标注类别属性的值设置为用户给出的标注类别。其中,第一数值可以是一个预设的值,例如,若默认用户给出的标注类别是正确的,则第一数值可以是1,当然也不排除第一数值取其他值。After step B1 is performed, the value of the labeling accuracy attribute of each second piece of data to be labeled may be set to the first numerical value, and the value of its labeling category attribute may be set to the labeling category given by the user. The first value may be a preset value. For example, if the default labeling category given by the user is correct, the first value may be 1. Of course, it is not excluded that the first value takes other values.

在执行步骤C1时,可能会有部分待标注数据被移除第四待标注数据,被移除的待标注数据包括三种成分:其一,是第二待标注数据,其标注准确率属性的值为第一数值,标注标签属性的值为用户给出的标签;其二,是首轮迭代即被缩减掉的、尚未标注的数据,由于进行了初始化,其标注准确率属性和标注标签属性均为各自的初始值;其三,是非首轮迭代中被缩减掉的、尚未标注的数据,根据下面的内容可知,其标注准确率属性和标注标签属性可能会被赋予特定的值。When step C1 is performed, part of the data to be labeled may be removed, and the fourth data to be labeled may be removed. The removed data to be labeled includes three components: one is the second data to be labeled, and its labeling accuracy attribute is The value is the first value, and the value of the label attribute is the label given by the user; the second is the data that has been reduced in the first iteration and has not been labeled. Due to initialization, its labeling accuracy attribute and labeling label attribute are their respective initial values; the third is the data that has been reduced in the non-first round of iterations and has not yet been labeled. According to the following content, its labeling accuracy attribute and labeling label attribute may be assigned specific values.

在执行步骤D1之后,若第四待标注数据中包含尚未标注的第三待标注数据,则获取第三待标注数据的标注准确率。其中,若步骤E1中进行判断时计算了第三待标注数据的标注准确率,则此处可以直接获取E1中的计算结果,若步骤E1中进行判断时并未计算第三待标注数据的标注准确率(如前所述,估计标注准确率是否达标,并不一定要显式计算标注准确率估值),则此时需要计算第三待标注数据的标注准确率。After step D1 is performed, if the fourth data to be labeled includes the third data to be labeled that has not been labeled, the labeling accuracy rate of the third data to be labeled is obtained. Wherein, if the labeling accuracy of the third data to be labelled is calculated in the judgment in step E1, the calculation result in E1 can be directly obtained here, if the labeling of the third data to be labelled is not calculated when the judgment is made in step E1 Accuracy (as mentioned above, it is not necessary to explicitly calculate the estimate of the labeling accuracy to estimate whether the labeling accuracy meets the standard), then the labeling accuracy of the third to-be-labeled data needs to be calculated.

针对每条第三待标注数据,以任意的第三待标注数据s为例,若第三待标注数据s的标注准确率属性的值小于获取到的标注准确率,则将第三待标注数据s的标注准确率属性的值设置为获取到的标注准确率,并将其标注类别属性的值设置为类别i(以标注候选池i中的情况为例)。For each piece of third data to be labeled, taking any third data to be labeled s as an example, if the value of the labeling accuracy attribute of the third data to be labeled s is less than the obtained labeling accuracy, the third data to be labeled The value of the labeling accuracy attribute of s is set to the obtained labeling accuracy, and the value of its labeling category attribute is set to the category i (taking the case in the labeling candidate pool i as an example).

例如,根据公式1/(1+w2/Ci)可以估计标注候选池i中的第三待标注数据s的标注准确率,将第三待标注数据s的标注准确率属性的值记为p(s)、标注类别属性的值记为c(s),若p(s)<1/(1+w2/Ci),则将p(s)设置为1/(1+w2/Ci),将c(s)设置为i,否则p(s)和c(s)的值保持不变。特别地,若p(s)>acc,则c(s)的值也就是第三待标注数据最终的标注标签。For example, the labeling accuracy rate of the third to-be-labeled data s in the labeling candidate pool i can be estimated according to the formula 1/(1+w 2 /Ci), and the value of the labeling accuracy attribute of the third to-be-labeled data s is denoted as p (s), the value of the label category attribute is recorded as c(s), if p(s)<1/(1+w 2 /Ci), then p(s) is set to 1/(1+w 2 /Ci ), set c(s) to i, otherwise the values of p(s) and c(s) remain unchanged. In particular, if p(s)>acc, the value of c(s) is the final label of the third data to be labelled.

注意,由于同一条待标注数据s在每个标注候选池中都会保留副本,所以可能在多个标注候选池中都会估计标注准确率,但按照上面的公式,会自动选择计算结果中的最大值p(s)。Note that since the same piece of data s to be labeled will retain a copy in each labeling candidate pool, the labeling accuracy may be estimated in multiple labeling candidate pools, but according to the above formula, the maximum value in the calculation result will be automatically selected p(s).

应当理解,即使图4中的步骤不是通过方式1实现的,也可以按照类似的方式计算每条第一待标注数据的标注准确率属性和标注类别属性的值,不再详细阐述。It should be understood that even if the steps in FIG. 4 are not implemented by way 1, the values of the labeling accuracy attribute and labeling category attribute of each first piece of data to be labelled can be calculated in a similar manner, which will not be described in detail.

本申请实施例还提供一种数据标注系统,该数据标注系统可以、但不限于部署在图9示出的电子设备,用于执行上面介绍的数据标注方法及其任意一种实现方式的步骤,图6示出了数据标注系统300的架构及其工作原理,下面将结合数据标注系统300继续介绍本申请实施例提供的数据标注方法。The embodiment of the present application also provides a data labeling system, which can be, but is not limited to, deployed on the electronic device shown in FIG. 9 to perform the steps of the data labeling method and any implementation manner thereof introduced above, FIG. 6 shows the architecture and working principle of the data labeling system 300 . The data labeling method provided by the embodiment of the present application will be described below in conjunction with the data labeling system 300 .

参照图6,数据标注系统300包括:6, the data annotation system 300 includes:

两个功能模块:模型训练与推理模块310和标注策略模块330;其中,功能模块可以理解为数据标注程序的程序模块;Two functional modules: model training and reasoning module 310 and labeling strategy module 330; wherein, the functional module can be understood as the program module of the data labeling program;

四个数据池:标注结果池322、推理数据候选池324、训练数据池326和推理结果池328;其中,数据池可以理解为一个数据集,或者也可以理解为一个存储空间。Four data pools: annotation result pool 322 , inference data candidate pool 324 , training data pool 326 and inference result pool 328 ; wherein, a data pool can be understood as a data set, or can also be understood as a storage space.

以及,一个界面:用户标注界面340。And, one interface: the user annotation interface 340 .

结合图6,该系统的工作工程概述如下:In conjunction with Figure 6, the working engineering of the system is outlined as follows:

步骤1:模型训练与推理模块310从训练数据池326中抽样出至少零批次训练数据对标注模型进行训练,以及,利用训练后得到的标注模型对从推理数据候选池324中抽样出的至少一批次的待标注数据进行推理,得到至少一批次的待标注数据的推理结果。Step 1: The model training and inference module 310 samples at least zero batches of training data from the training data pool 326 to train the labeling model, and uses the labeling model obtained after training to perform training on at least zero batches of training data sampled from the inference data candidate pool 324. Inference is performed on a batch of data to be labeled, and an inference result of at least one batch of data to be labeled is obtained.

步骤1中的抽样方式不限。训练数据池326为训练数据的数据源,训练数据池326中的训练数据包括训练样本及其标注标签(例如,图像和其标注类别),如何得到训练数据稍后说明。一批次(batch)的数据包括至少一条数据,若抽样出的训练数据为零批次,其实表明此时不进行数据抽样,从而也不进行标注模型的训练,继续使用原有的标注模型,只是为了表述上的简便性,将抽取零批次训练数据的情况与抽取至少一批次训练数据的情况合并在一起了而已。抽取零批次训练数据的情况是可能发生的,例如,认为当前标注模型的性能已经足够好,无需调整其参数,避免浪费计算资源。被抽样出的训练数据无需从训练数据池326中移除。关于标注模型的训练过程,可以参考现有技术,此处不具体解释。The sampling method in step 1 is not limited. The training data pool 326 is the data source of the training data. The training data in the training data pool 326 includes training samples and their labels (eg, images and their label categories). How to obtain the training data will be described later. A batch of data includes at least one piece of data. If the sampled training data is zero batch, it actually means that no data sampling will be performed at this time, so the training of the labeling model will not be performed, and the original labeling model will continue to be used. Just for simplicity of presentation, the case of extracting zero batches of training data is combined with the case of extracting at least one batch of training data. It is possible to extract zero batches of training data. For example, the performance of the current annotation model is considered to be good enough, and there is no need to adjust its parameters to avoid wasting computing resources. The sampled training data need not be removed from the training data pool 326 . Regarding the training process of the labeling model, reference may be made to the prior art, which will not be explained in detail here.

推理数据候选池326为待标注数据的数据源,待标注数据是无标签的数据。被抽样出的待标注数据暂时无需从推理数据候选池326中移除。关于标注模型的推理过程,可以参考现有技术,此处不具体解释。The inference data candidate pool 326 is the data source of the data to be labeled, and the data to be labeled is unlabeled data. The sampled data to be labeled does not need to be removed from the inference data candidate pool 326 temporarily. Regarding the reasoning process of the labeling model, reference may be made to the prior art, which will not be explained in detail here.

可选的,数据标注系统300初始化时,模型训练与推理模块310会将标注模型初始化,包括构建模型的结构、设置模型的初始参数、设置模型使用的损失函数等。Optionally, when the data labeling system 300 is initialized, the model training and inference module 310 will initialize the labeling model, including constructing the structure of the model, setting the initial parameters of the model, setting the loss function used by the model, and the like.

然后,模型训练与推理模块310可将所有待标注数据都写入推理数据候选池326,这样推理数据候选池326中最初的数据就有了,从而可以支持步骤1中提到的数据抽样。然后,可以由标注策略模块330从推理数据候选池326中读取预设数量(例如,30条)的待标注数据,并将这些待标注数据直接交由用户在用户标注界面340上进行标注并获得用户标注界面340返回的标注标签,注意,这部分待标注数据不含预测标签,因为此时标注模型还没训练,无法给出预测标签。之后,标注策略模块330将这部分待标注数据及其标注标签写入训练数据池326,这样训练数据池326中最初的数据就有了,从而可以支持步骤1中提到的数据抽样。Then, the model training and inference module 310 can write all the data to be labeled into the inference data candidate pool 326, so that the original data in the inference data candidate pool 326 is available, so that the data sampling mentioned in step 1 can be supported. Then, the labeling strategy module 330 can read a preset number (eg, 30 pieces) of data to be labelled from the inference data candidate pool 326 , and directly hand over the data to be labelled to the user on the user labeling interface 340 for labeling and labeling. The labeling label returned by the user labeling interface 340 is obtained. Note that this part of the data to be labelled does not contain a prediction label, because the labeling model has not been trained at this time, and the prediction label cannot be given. After that, the labeling strategy module 330 writes this part of the data to be labelled and its labeling labels into the training data pool 326, so that the original data in the training data pool 326 is available, so that the data sampling mentioned in step 1 can be supported.

图7示步骤1中进行模型训练和推理的一种实现方式。参照图7,步骤1可实现为至少一次模型训练/推理循环,每次模型训练/推理循环中包括至少零次模型训练(从训练数据池326中每抽样一批次训练数据对应一次模型训练),以及,利用训练后得到的标注模型进行的至少零次模型推理(从推理数据候选池326中每抽样一批次待标注数据对应一次模型推理)。FIG. 7 shows an implementation of model training and inference in step 1. Referring to FIG. 7, step 1 can be implemented as at least one model training/inference cycle, and each model training/inference cycle includes at least zero model training (each batch of training data sampled from the training data pool 326 corresponds to one model training) , and at least zero-time model reasoning performed using the labeling model obtained after training (each batch of data to be labelled is sampled from the reasoning data candidate pool 326 corresponds to one model reasoning).

但需注意,在每一次模型训练/推理循环中训练和推理的次数不能都是零,并且,在全部的模型训练/推理循环中至少应包括一次模型推理,否则无法得到待标注数据的推理结果。例如,进行两次模型训练/推理循环,可以实现为顺序执行的1次模型训练、1次模型推理、1次模型训练、1次模型推理,也可以实现为0次模型训练、1次模型推理、1次模型训练、0次模型推理,也可以实现为0次模型训练、1次模型推理、0次模型训练、2次模型推理,等等。However, it should be noted that the number of training and inference in each model training/inference cycle cannot be zero, and at least one model inference should be included in all model training/inference cycles, otherwise the inference results of the data to be labeled cannot be obtained. . For example, performing two model training/inference cycles can be implemented as 1 model training, 1 model inference, 1 model training, and 1 model inference in sequence, or 0 model training and 1 model inference. , 1 model training, 0 model inference, can also be implemented as 0 model training, 1 model inference, 0 model training, 2 model inference, and so on.

步骤2:模型训练与推理模块310将步骤1中的至少一批次的待标注数据及其推理结果写入推理结果池328。Step 2: The model training and inference module 310 writes at least one batch of the data to be labeled in Step 1 and its inference results into the inference result pool 328 .

可选的,数据标注系统300初始化时,模型训练与推理模块310可以将推理结果池328初始化为空。Optionally, when the data annotation system 300 is initialized, the model training and inference module 310 may initialize the inference result pool 328 to be empty.

步骤3:标注策略模块330从推理结果池328中读取第一待标注数据及其推理结果。Step 3: The labeling strategy module 330 reads the first data to be labelled and its reasoning result from the reasoning result pool 328 .

其中,第一待标注数据的数量不超过推理结果池328中目前的待标注数据的总数量,被读取出的第一待标注数据及其推理结果可以认为是从推理结果池328中移除了。The number of the first data to be labeled does not exceed the total number of data to be labeled currently in the inference result pool 328 , and the read first data to be labeled and its inference result can be considered to be removed from the inference result pool 328 .

步骤3有多种可能的实现方式:从读取时机上说,标注策略模块330可以每隔固定的时间从推理结果池328中读取第一待标注数据及其推理结果,也可以等待上一批的第一待标注数据的标注结束后(前文已经介绍了结束条件)再从推理结果池328中读取新一批的第一待标注数据及其推理结果,等等。从读取的数据量上说,标注策略模块330可以将推理结果池328中当前的全部待标注数据及其推理结果都读取出来作为第一待标注数据其推理结果,也可以总是从推理结果池328中读取固定条数的第一待标注数据其推理结果(除非推理结果池328中数据量不足),等等。There are many possible implementations of step 3: in terms of reading timing, the labeling strategy module 330 can read the first data to be labelled and its reasoning result from the reasoning result pool 328 at regular intervals, or it can wait for the last data to be labelled. After the labeling of the first batch of data to be labelled ends (the end condition has been described above), a new batch of first data to be labelled and its reasoning results are read from the inference result pool 328, and so on. In terms of the amount of data read, the labeling strategy module 330 can read all the current to-be-labeled data and its inference results in the inference result pool 328 as the inference results of the first to-be-labeled data, or it can always read the inference results from the inference result pool 328. The inference result of the first to-be-labeled data of a fixed number is read in the result pool 328 (unless the amount of data in the inference result pool 328 is insufficient), and so on.

步骤1~3也可以认为是步骤S110的一种实现方式。Steps 1 to 3 may also be considered as an implementation manner of step S110.

步骤4:标注策略模块330执行第一待标注数据的标注流程。Step 4: The labeling strategy module 330 executes the labeling process of the first data to be labelled.

步骤4对应步骤S120~S140,在标注过程中,还需要将第二待标注数据及其预测标签(可选)在用户标注界面340上进行显示,并通过用户标注界面340获得第二待标注数据的标注标签。Step 4 corresponds to steps S120 to S140. During the labeling process, it is also necessary to display the second data to be labelled and its predicted label (optional) on the user labeling interface 340, and obtain the second data to be labelled through the user labeling interface 340. the callout label.

对于第二待标注数据及其标注标签,标注策略模块330可以将其写入训练数据池326,用于增加其中训练数据的数量,从而在后续再次执行步骤1时提升标注模型的性能。对于自动标注出的第三待标注数据及其标注标签(步骤S140得到),也可以写入训练数据池326,但这不是必须的,因为毕竟自动标注结果未经过人工确认,其标注准确率仅仅是算法估计得到的,可能会对标注模型的性能产生负面影响。For the second to-be-labeled data and its labeling label, the labeling strategy module 330 may write it into the training data pool 326 to increase the amount of training data therein, thereby improving the performance of the labeling model when step 1 is subsequently performed again. For the automatically marked third data to be marked and its marking label (obtained in step S140), it can also be written into the training data pool 326, but this is not necessary, because after all, the automatic marking result has not been manually confirmed, and its marking accuracy is only is estimated by the algorithm and may negatively affect the performance of the annotation model.

对于已经确定了标注标签的第二待标注数据和第三待标注数据,标注策略模块330可以将其从推理数据候选池324中移除,避免其重复推理、重复标注。不过,对于那些未确定标注标签的待标注数据,则可以继续将其保留在推理数据候选池324中,允许其再次推理、再次标注,随着标注模型的优化,针对这些数据有可能会推理出不同的结果,从而被成功标注。For the second to-be-labeled data and the third to-be-labeled data for which the labeling label has been determined, the labeling strategy module 330 may remove them from the inference data candidate pool 324 to avoid repeated reasoning and repeated labeling. However, for those to-be-labeled data for which the labeling label is not determined, it can continue to be kept in the inference data candidate pool 324, allowing it to reason and label again. With the optimization of the labeling model, it is possible to infer these data. Different results were successfully annotated.

另外,数据标注系统300初始化时,模型训练与推理模块310可以将所有待标注数据及一个特殊标签(代表未知标签)写入标注结果池322中,在执行步骤4时,对于已经确定了标注标签的第二待标注数据和第三待标注数据,标注策略模块330可以利用其标注标签将标注结果池322中对应的特殊标签修改掉。可选的,对于前文提到的待标注数据的标注准确率属性和标注标签属性,也可以保存在标注结果池322中。In addition, when the data labeling system 300 is initialized, the model training and reasoning module 310 can write all the data to be labelled and a special label (representing an unknown label) into the labeling result pool 322. The second data to be labeled and the third data to be labeled, the labeling strategy module 330 can use the labeling labels to modify the corresponding special labels in the labeling result pool 322 . Optionally, the labeling accuracy attribute and labeling label attribute of the data to be labelled mentioned above may also be stored in the labeling result pool 322 .

在替代方案中,标注结果池322也可以初始化为空,标注策略模块330负责将已经确定了标注标签的第二待标注数据和第三待标注数据、以及二者的标注标签写入标注结果池322。In an alternative solution, the labeling result pool 322 can also be initialized to be empty, and the labeling strategy module 330 is responsible for writing the second to-be-labeled data and the third to-be-labeled data for which the labeling label has been determined, and the labeling labels of the two into the labeling result pool 322.

步骤1~4可以重复执行,在一种实现方式中(简称同步模式),执行步骤3~4时,不允许执行步骤1~2。在另一种实现方式中(简称异步模式),执行步骤3~4时,允许同时执行步骤1~2,即标注策略模块330从推理结果池328中读取第一待标注数据后,不等第一待标注数据标注结束,模型训练与推理模块310又可能将新的待标注数据及其推理结果写入推理结果池328。Steps 1 to 4 may be repeatedly performed. In an implementation manner (referred to as a synchronous mode), when steps 3 to 4 are performed, steps 1 to 2 are not allowed to be performed. In another implementation (abbreviated as asynchronous mode), when steps 3 to 4 are executed, steps 1 to 2 are allowed to be executed at the same time, that is, after the labeling strategy module 330 reads the first data to be labelled from the inference result pool 328, After the labeling of the first to-be-labeled data ends, the model training and inference module 310 may write the new to-be-labeled data and its inference results into the inference result pool 328 again.

在异步模式下,由于模型训练与推理模块310和标注策略模块330都可以按照各自的逻辑独立工作,所以其标注效率高于同步模式,但对于异步模式,可能导致一个问题:虽然根据前文介绍,对于已经确定了标注标签的第二待标注数据和第三待标注数据,标注策略模块330会将其从推理数据候选池324中移除,但在移除之前,这些数据可能又被模型训练与推理模块310从推理数据候选池324中抽样出来,并进行推理,从而导致其再次进入推理结果池328,进而引起重复标注。In the asynchronous mode, since the model training and reasoning module 310 and the labeling strategy module 330 can work independently according to their respective logics, the labeling efficiency is higher than that in the synchronous mode. For the second to-be-labeled data and the third to-be-labeled data for which the labeling label has been determined, the labeling strategy module 330 will remove them from the inference data candidate pool 324, but before the removal, these data may be trained and matched by the model again. The inference module 310 samples from the inference data candidate pool 324 and performs inference, causing it to re-enter the inference result pool 328, thereby causing duplicate annotations.

为改善此问题,对于已经确定了标注标签的第二待标注数据和第三待标注数据,标注策略模块330还可以将其从推理数据候选池324中移除,如果其存在于推理数据候选池324中的话。In order to improve this problem, for the second to-be-labeled data and the third to-be-labeled data for which the labeling label has been determined, the labeling strategy module 330 may also remove it from the inference data candidate pool 324, if it exists in the inference data candidate pool. 324 words.

进一步的,在异步模式下,由于标注策略模块330随时可能向训练数据池326写入新的训练数据,所以若步骤1采用训练/推理循环的方式实现,在不同轮次的训练/推理循环中,训练数据池326中的训练数据可能是不同的。Further, in the asynchronous mode, since the labeling strategy module 330 may write new training data to the training data pool 326 at any time, if step 1 is implemented in a training/inference loop, in different rounds of training/inference loops , the training data in the training data pool 326 may be different.

应当理解,通过模型训练与推理模块310和标注策略模块330来执行步骤1~4只是一种可选方式,程序模块的划分是比较自由的,例如,也可以由同一个模块来执行步骤1~4。It should be understood that performing steps 1-4 through the model training and reasoning module 310 and the labeling strategy module 330 is only an optional way, and the division of program modules is relatively free, for example, steps 1-4 can also be performed by the same module. 4.

下面,在以上实施例的基础上,继续介绍本申请实施例提供的两种标注模式:In the following, on the basis of the above embodiments, the two labeling modes provided by the embodiments of the present application will be continuously introduced:

可选的,数据标注过程可以在两种标注模式下进行,一种是半自动标注模式,一种是人工标注模式。其中,半自动标注模式是指用户标注结合自动标注的模式,例如,前面介绍的数据标注方法就是半自动标注模式,其中第二待标注数据通过用户标注,标注准确率达标的第三待标注数据通过机器自动标注,人工标注模式是指完全由用户标注的模式,即所有待标注数据都交由用户标注,后文会给出人工标注模式的例子。Optionally, the data labeling process can be performed in two labeling modes, one is a semi-automatic labeling mode and the other is a manual labeling mode. Among them, the semi-automatic labeling mode refers to the mode in which user labeling is combined with automatic labeling. For example, the data labeling method described above is the semi-automatic labeling mode, in which the second data to be labelled is labelled by the user, and the third data to be labelled whose labeling accuracy meets the standard is labelled by the machine. Automatic labeling, manual labeling mode refers to the mode that is completely labelled by the user, that is, all the data to be labelled are handed over to the user for labeling, and an example of the manual labeling mode will be given later.

在满足标注模式切换条件时,这两种标注模式之间可以相互切换,具体为:满足人工标注模式切换条件时,从半自动标注模式切换为人工标注模式,在满足半自动标注模式切换条件时,从人工标注模式切换为半自动标注模式。When the switching conditions of the labeling mode are met, the two labeling modes can be switched between each other, specifically: when the switching conditions of the manual labeling mode are met, the semi-automatic labeling mode is switched to the manual labeling mode; when the switching conditions of the semi-automatic labeling mode are met, the Switch from manual labeling mode to semi-automatic labeling mode.

例如,若将一个标注候选池中的第三待标注数据被自动标注称为执行了一次跳过策略,若连续M个(M大于某一个数阈值)标注候选池都未执行跳过策略,而是由于标注候选池中的第四待标注数据仅包含标注正确的第二待标注数据而结束标注,则表明此时的数据对于机器来说标注起来比困难(或者说明此时的标注模型的性能达不到自动标注的要求),从而可以从半自动标注模式切换为人工标注模式。For example, if the third to-be-labeled data in a labeling candidate pool is automatically labelled as executing a skip strategy, if there are M consecutive labeling candidate pools (M greater than a certain threshold), the skip strategy is not executed, It is because the fourth to-be-labeled data in the labeling candidate pool only contains the correctly labeled second to-be-labeled data and ends the labeling, which means that the data at this time is more difficult for the machine to label (or the performance of the labeling model at this time). does not meet the requirements of automatic labeling), so that the semi-automatic labeling mode can be switched to the manual labeling mode.

不过需要注意,即使继续采用半自动标注模式进行标注,也是可以标注完的,但通常可将人工标注模式下的标注方法设计得比半自动标注模式更简单一些(比如,不用创建若干标注候选池),使得在进行模式切换后标注效率能够提高。However, it should be noted that even if you continue to use the semi-automatic labeling mode for labeling, the labeling can still be completed, but the labeling method in the manual labeling mode can usually be designed to be simpler than the semi-automatic labeling mode (for example, without creating several labeling candidate pools), The labeling efficiency can be improved after mode switching.

又例如,若标注策略模块330每次都从推理结果池328中读取全部的待标注数据及其推理结果作为第一待标注数据及其推理结果,则当标注策略模块330检测到推理结果池中待标注数据的数量小于某个数量阈值时,可以从半自动标注模式切换为人工标注模式。For another example, if the labeling strategy module 330 reads all the data to be labelled and its reasoning results from the reasoning result pool 328 each time as the first data to be labelled and its reasoning result, then when the labeling strategy module 330 detects the reasoning result pool When the amount of data to be labeled is less than a certain amount threshold, you can switch from the semi-automatic labeling mode to the manual labeling mode.

因为若模型训练与推理模块310大致以恒定的速度进行推理,推理结果池328中待标注数据的数量较少,表明标注进入了收尾阶段,而收尾阶段剩下的待标注数据,很可能是之前历次标注过程中未能成功标注的数据(比如,被缩减掉的),即难数据,从而可以合理地推断这些数据并不能触发、或者只能少量触发跳过策略,还不如直接由用户进行标注。Because if the model training and inference module 310 performs inference at a roughly constant speed, the number of data to be labeled in the inference result pool 328 is small, indicating that the labeling has entered the final stage, and the remaining data to be labeled in the final stage is likely to be the previous The data that has not been successfully labeled (for example, reduced) in the previous labeling process is difficult data, so it can be reasonably inferred that these data cannot trigger the skip strategy, or can only trigger a small amount of skipping strategy, it is better to label it directly by the user .

其中,对于标注模型是分类模型,且分类结果为nc个类别,且采用方式1进行半自动标注的情况,该数量阈值可以、但不限于设置为(w2/(1/acc-1))×nc×h,其中h为一个预设的倍数,例如可以取3、5等。Among them, for the case where the labeling model is a classification model, and the classification results are nc categories, and the method 1 is used for semi-automatic labeling, the number threshold can be, but is not limited to, set to (w 2 /(1/acc-1))× nc×h, where h is a preset multiple, for example, 3, 5, etc. can be taken.

下面再以标注模型是分类模型的情况为例,介绍一种人工标注模式的实现方法:Next, take the case where the labeling model is a classification model as an example to introduce an implementation method of the manual labeling mode:

对于一批待标注数据,假设叫第五待标注数据,第五待标注数据的推理结果包括第五待标注数据分属每个类别的概率,第五待标注数据在人工标注模式的标注方式为:For a batch of data to be labeled, it is assumed to be called the fifth data to be labeled. The reasoning result of the fifth data to be labeled includes the probability that the fifth data to be labeled belongs to each category. The labeling method of the fifth data to be labeled in the manual labeling mode is: :

首先,获取第五待标注数据及其推理结果;其中,第五待标注数据的推理结果利用标注模型对第五待标注数据进行推理得到。例如,可以从推理结果池328中读取第五待标注数据及其推理结果。First, obtain the fifth data to be labeled and its inference result; wherein, the inference result of the fifth data to be labeled is obtained by inferring the fifth data to be labeled by using a labeling model. For example, the fifth to-be-labeled data and its inference result can be read from the inference result pool 328 .

然后,将第五待标注数据按照其推理结果中的最大概率降序排序,按照排序索引递增的顺序逐批(比如,每批100条数据)将第五待标注数据及其预测类别提供给用户进行标注;其中,每条第五待标注数据的预测类别为其推理结果中的最大概率对应的类别。Then, sort the fifth data to be labeled in descending order according to the maximum probability in the inference result, and provide the fifth data to be labeled and its prediction category to the user batch by batch (for example, 100 pieces of data per batch) in the order of increasing sorting index. Annotation; wherein, the predicted category of each fifth piece of data to be annotated is the category corresponding to the maximum probability in its inference result.

获取用户标注的每批第五待标注数据的标注类别,直至第五待标注数据全部标注完成,或者,也可以在每标注完一批第五待标注数据后,就重新检查一下目前是否满足半自动标注模式切换条件,若满足切换条件,则从人工标注模式切换为半自动标注模式,并将剩余尚未标注的第五待标注数据改为半自动标注。Obtain the labeling category of each batch of the fifth data to be labelled marked by the user until all the fifth data to be labelled is labelled, or, after each batch of the fifth batch of data to be labelled, recheck whether the current semi-automatic data is satisfied Labeling mode switching conditions, if the switching conditions are met, switch from manual labeling mode to semi-automatic labeling mode, and change the remaining fifth data to be labelled that has not been labelled to semi-automatic labeling.

上述标注方法的关键在于按照排序索引分批标注,各批第五待标注数据的标注难度从低到高(推理结果中的概率越低,表明标注模型对数据所属类别越不肯定,从而标注难度也越高),用户先以较高的效率标注低难度数据,有可能在低难度数据标注完后,因满足了半自动标注模式切换条件,剩余的数据就不用全部靠用户来标注了,因此可以避免用户完全靠自己去标注难度较高的数据。The key to the above labeling method is to label in batches according to the sorting index, and the labeling difficulty of each batch of the fifth data to be labelled is from low to high (the lower the probability in the inference result, the more uncertain the labeling model is about the data category, which makes labeling difficult. The user will mark the low-difficulty data with higher efficiency first. It is possible that after the low-difficulty data is marked, the remaining data does not need to be marked by the user because the semi-automatic marking mode switching conditions are met. Avoid users completely relying on themselves to label difficult data.

应当理解,采用两种标注模式不是必须的,例如也可以一直采用半自动标注模式进行标注。It should be understood that it is not necessary to use two labeling modes, for example, the semi-automatic labeling mode may always be used for labeling.

在一些应用场景中,希望对待标注数据中的简单数据集和难数据集进行区分,从而可以在这两个数据集上分别评估任务模型的性能,进而确定其在训练时的优化方向。In some application scenarios, it is desirable to distinguish between simple datasets and difficult datasets in the labeled data, so that the performance of the task model can be evaluated on these two datasets respectively, and then its optimization direction during training can be determined.

借助本申请实施例提供的数据标注方法可以实现简单数据集和难数据集的划分:With the help of the data labeling method provided by the embodiments of the present application, the division of simple data sets and difficult data sets can be realized:

例如,在半自动标注模式下标注的数据都认为属于简单数据集,在人工标注模式下标注的数据都认为属于难数据集。又例如,在所有的待标注数据标注完成后,根据其标注准确率属性的值进行判断,若其大于某个阈值,则认为待标注数据属于简单数据集,否则认为其属于难数据集,等等。For example, the data labeled in the semi-automatic labeling mode are considered to belong to the simple data set, and the data labeled in the manual labeling mode are considered to belong to the difficult data set. For another example, after all the data to be labeled is labeled, it is judged according to the value of its labeling accuracy attribute. If it is greater than a certain threshold, the data to be labeled is considered to belong to a simple data set, otherwise it is considered to belong to a difficult data set, etc. Wait.

图8示出了本申请实施例提供的数据标注装置400的一种可能的结构。参照图8,数据标注装置400包括:FIG. 8 shows a possible structure of the data labeling apparatus 400 provided by the embodiment of the present application. 8, the data labeling apparatus 400 includes:

数据获取单元410,用于获取第一待标注数据及其推理结果;其中,所述第一待标注数据的推理结果为利用标注模型对所述第一待标注数据进行预测得到的信息;The data obtaining unit 410 is configured to obtain the first data to be labeled and an inference result thereof; wherein, the inference result of the first data to be labeled is information obtained by using a labeling model to predict the first data to be labeled;

人工标注单元420,用于获取用户标注的第二待标注数据的标注标签;其中,所述第二待标注数据为所述第一待标注数据中的部分待标注数据;The manual labeling unit 420 is configured to obtain the labeling label of the second data to be labelled marked by the user; wherein, the second data to be labelled is part of the data to be labelled in the first data to be labelled;

准确率评估单元430,用于根据所述第二待标注数据的标注标签估计所述第一待标注数据中尚未标注的第三待标注数据的标注准确率是否已经达标;其中,所述第三待标注数据的标注准确率为根据所述第三待标注数据的推理结果所确定的推理标签的准确率;An accuracy evaluation unit 430, configured to estimate whether the labeling accuracy of the third data to be labelled that has not been labelled in the first data to be labelled has reached the standard according to the labelling label of the second data to be labelled; wherein, the third data to be labelled The labeling accuracy rate of the data to be labeled is the accuracy rate of the inference label determined according to the inference result of the third data to be labeled;

自动标注单元440,用于在所述第三待标注数据的标注准确率已经达标时,将所述第三待标注数据的推理标签确定为所述第三待标注数据的标注标签。The automatic labeling unit 440 is configured to determine the inference label of the third data to be labelled as the labeling label of the third data to be labelled when the labeling accuracy of the third data to be labelled has reached the standard.

本申请实施例提供的数据标注装置400,其实现原理及产生的技术效果在前述方法实施例中已经介绍,其可实现前述方法实施例中的全部内容,为简要描述,该装置所包括各个单元所对应功能的具体实现过程可参考前述方法实施例中相应内容,此处不再赘述。The data labeling apparatus 400 provided by the embodiments of the present application, the implementation principle and the technical effects produced have been introduced in the foregoing method embodiments, and it can implement all the contents in the foregoing method embodiments. For a brief description, the apparatus includes various units For the specific implementation process of the corresponding function, reference may be made to the corresponding content in the foregoing method embodiments, which will not be repeated here.

图9示出了本申请实施例提供的电子设备500的结构。参照图9,电子设备500包括:处理器510、存储器520以及通信接口530,这些组件通过通信总线540和/或其他形式的连接机构(未示出)互连并相互通讯。FIG. 9 shows a structure of an electronic device 500 provided by an embodiment of the present application. 9, an electronic device 500 includes a processor 510, a memory 520, and a communication interface 530, and these components are interconnected and communicate with each other through a communication bus 540 and/or other forms of connection mechanisms (not shown).

其中,处理器510包括一个或多个(图中仅示出一个),其可以是一种集成电路芯片,具有信号的处理能力。上述的处理器510可以是通用处理器,包括中央处理器(CentralProcessing Unit,简称CPU)、微控制单元(Micro Controller Unit,简称MCU)、网络处理器(Network Processor,简称NP)或者其他常规处理器;还可以是专用处理器,包括图形处理器(Graphics Processing Unit,GPU)、神经网络处理器(Neural-network ProcessingUnit,简称NPU)、数字信号处理器(Digital Signal Processor,简称DSP)、专用集成电路(Application Specific Integrated Circuits,简称ASIC)、现场可编程门阵列(FieldProgrammable Gate Array,简称FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。并且,在处理器510为多个时,其中的一部分可以是通用处理器,另一部分可以是专用处理器。Among them, the processor 510 includes one or more (only one is shown in the figure), which may be an integrated circuit chip, and has signal processing capability. The above-mentioned processor 510 may be a general-purpose processor, including a central processing unit (Central Processing Unit, referred to as CPU), a micro control unit (Micro Controller Unit, referred to as MCU), a network processor (Network Processor, referred to as NP) or other conventional processors ; It can also be a special-purpose processor, including a graphics processor (Graphics Processing Unit, GPU), a neural network processor (Neural-network Processing Unit, referred to as NPU), a digital signal processor (Digital Signal Processor, referred to as DSP), application-specific integrated circuits (Application Specific Integrated Circuits, ASIC for short), Field Programmable Gate Array (Field Programmable Gate Array, FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components. Also, when there are multiple processors 510, some of them may be general-purpose processors, and the other may be dedicated processors.

存储器520包括一个或多个(图中仅示出一个),其可以是,但不限于,随机存取存储器(Random Access Memory,简称RAM),只读存储器(Read Only Memory,简称ROM),可编程只读存储器(Programmable Read-Only Memory,简称PROM),可擦除可编程只读存储器(Erasable Programmable Read-Only Memory,简称EPROM),电可擦除可编程只读存储器(Electric Erasable Programmable Read-Only Memory,简称EEPROM)等。The memory 520 includes one or more (only one is shown in the figure), which may be, but not limited to, a random access memory (Random Access Memory, RAM for short), a read only memory (Read Only Memory, ROM for short), or Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), Electrical Erasable Programmable Read-Only Memory (EPROM) Only Memory, referred to as EEPROM) and so on.

处理器510以及其他可能的组件可对存储器520进行访问,读和/或写其中的数据。特别地,在存储器520中可以存储一个或多个计算机程序指令,处理器510可以读取并运行这些计算机程序指令,以实现本申请实施例提供的数据标注方法。The processor 510 and possibly other components may access the memory 520, read and/or write data therein. In particular, one or more computer program instructions may be stored in the memory 520, and the processor 510 may read and execute these computer program instructions, so as to implement the data labeling method provided by the embodiments of the present application.

通信接口530包括一个或多个(图中仅示出一个),可以用于和其他设备进行直接或间接地通信,以便进行数据的交互。通信接口530可以包括进行有线和/或无线通信的接口。The communication interface 530 includes one or more (only one is shown in the figure), which can be used to communicate directly or indirectly with other devices for data exchange. Communication interface 530 may include an interface for wired and/or wireless communication.

可以理解,图9所示的结构仅为示意,电子设备500还可以包括比图9中所示更多或者更少的组件,或者具有与图9所示不同的配置。例如,电子设备500在不需要与其他设备进行通信时,也可以不包括通信接口530。It can be understood that the structure shown in FIG. 9 is only for illustration, and the electronic device 500 may further include more or less components than those shown in FIG. 9 , or have different configurations from those shown in FIG. 9 . For example, when the electronic device 500 does not need to communicate with other devices, the communication interface 530 may not be included.

图9中所示的各组件可以采用硬件、软件或其组合实现。电子设备500可能是实体设备,例如服务器、PC机、笔记本电脑、平板电脑、手机等,也可能是虚拟设备,例如虚拟机、容器等。并且,电子设备500也不限于单台设备,也可以是多台设备的组合或者大量设备构成的集群。Each component shown in FIG. 9 may be implemented in hardware, software, or a combination thereof. The electronic device 500 may be a physical device, such as a server, a PC, a notebook computer, a tablet computer, a mobile phone, etc., or a virtual device, such as a virtual machine, a container, and the like. In addition, the electronic device 500 is not limited to a single device, and may be a combination of a plurality of devices or a cluster composed of a large number of devices.

本申请实施例还提供一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序指令,这些计算机程序指令被处理器读取并运行时,执行本申请实施例提供的数据标注方法。例如,计算机可读存储介质可以实现为图9中电子设备500中的存储器520。Embodiments of the present application further provide a computer-readable storage medium, where computer program instructions are stored on the computer-readable storage medium. When these computer program instructions are read and run by a processor, the data labeling method provided by the embodiments of the present application is executed. . For example, the computer-readable storage medium may be implemented as the memory 520 in the electronic device 500 in FIG. 9 .

本申请实施例还提供一种计算机程序产品,该计算机程序产品包括计算机程序指令,这些计算机程序指令被处理器读取并运行时,执行本申请实施例提供的数据标注方法。Embodiments of the present application further provide a computer program product, the computer program product includes computer program instructions, and when the computer program instructions are read and run by a processor, the data labeling method provided by the embodiments of the present application is executed.

以上所述仅为本申请的实施例而已,并不用于限制本申请的保护范围,对于本领域的技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above descriptions are merely examples of the present application, and are not intended to limit the protection scope of the present application. For those skilled in the art, various modifications and changes may be made to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this application shall be included within the protection scope of this application.

Claims (18)

1. A method for annotating data, comprising:
acquiring first data to be marked and an inference result thereof; the inference result of the first data to be labeled is information obtained by predicting the first data to be labeled by using a labeling model;
acquiring a labeling label of second data to be labeled marked by a user; the second data to be marked is part of data to be marked in the first data to be marked;
estimating whether the labeling accuracy of third data to be labeled which is not labeled in the first data to be labeled reaches the standard or not according to the labeling label of the second data to be labeled; the labeling accuracy of the third data to be labeled is the accuracy of the inference label determined according to the inference result of the third data to be labeled;
and if the labeling accuracy of the third data to be labeled reaches the standard, determining the inference label of the third data to be labeled as the labeling label of the third data to be labeled.
2. The data annotation method of claim 1, wherein the estimating whether the annotation accuracy of the third data to be annotated in the first data to be annotated reaches the standard according to the annotation tag of the second data to be annotated comprises:
determining fourth data to be marked in the first data to be marked according to the label of the second data to be marked; the fourth data to be labeled comprises second data to be labeled with correct labeling and/or third data to be labeled which is not labeled, wherein the second data to be labeled with correct labeling refers to: the labeling label of the second data to be labeled is the same as the inference label of the second data to be labeled determined according to the inference result of the second data to be labeled;
and if the fourth data to be labeled contains third data to be labeled which is not labeled yet, estimating whether the labeling accuracy of the third data to be labeled reaches the standard or not according to the quantity of the second data to be labeled which is labeled correctly in the fourth data to be labeled.
3. The data annotation method of claim 2, wherein the steps from the obtaining of the annotation tag of the second data to be annotated by the user to the determining of the inference tag of the third data to be annotated as the annotation tag of the third data to be annotated are performed in an iterative manner, and each iteration includes the following steps:
sampling the second data to be labeled, which is provided for the user to label in the iteration, from the fourth data to be labeled; for the first iteration, the fourth data to be labeled is the first data to be labeled;
acquiring a label of the second data to be labeled marked by the user, and screening the fourth data to be labeled according to the label of the second data to be labeled;
after screening, if the fourth data to be labeled contains third data to be labeled which is not labeled yet, estimating whether the labeling accuracy of the third data to be labeled reaches the standard or not according to the quantity of second data to be labeled which is labeled correctly in the fourth data to be labeled;
and if the labeling accuracy of the third data to be labeled reaches the standard, determining the inference label of the third data to be labeled as the labeling label of the third data to be labeled.
4. The data labeling method of claim 3, wherein the labeling model is a classification model, and the inference result of the first data to be labeled comprises a probability that the first data to be labeled belongs to each class;
prior to performing the first iteration, the method further comprises: creating a labeling candidate pool corresponding to each category according to the inference result of the first data to be labeled; each marking candidate pool comprises the first data to be marked and the probability of the first data to be marked belonging to the category corresponding to the marking candidate pool in the inference result;
each iteration comprises the following steps:
sampling the second data to be labeled, which is provided for the user to label in the iteration, from the fourth data to be labeled in all the labeling candidate pools; for the first iteration, the fourth data to be labeled in each labeling candidate pool is the first data to be labeled in the labeling candidate pool;
acquiring the labeling category of the second data to be labeled marked by the user; the labeling type of the second data to be labeled is a labeling label of the second data to be labeled;
for each annotation candidate pool, performing the following steps:
for each piece of second data to be annotated, if the annotation category of the piece of second data to be annotated is different from the category corresponding to the annotation candidate pool, and the piece of second data to be annotated is included in the fourth data to be annotated in the annotation candidate pool, reducing the fourth data to be annotated in the annotation candidate pool to only include the data to be annotated satisfying the following conditions: the probability of the class corresponding to the labeling candidate pool in the inference result is greater than the probability of the class corresponding to the labeling candidate pool in the inference result of the second piece of data to be labeled;
after the fourth data to be labeled in the labeling candidate pool is reduced, if the fourth data to be labeled contains third data to be labeled which is not labeled yet, estimating whether the labeling accuracy of the third data to be labeled reaches the standard or not according to the quantity of second data to be labeled which is labeled correctly in the fourth data to be labeled;
if the marking accuracy rate of the third data to be marked already reaches the standard, determining the category corresponding to the marking candidate pool as the marking category of the third data to be marked; the category corresponding to the labeling candidate pool is the inference label of the third data to be labeled, and the labeling category of the third data to be labeled is the labeling label of the third data to be labeled.
5. The data annotation method of claim 4, wherein in each annotation candidate pool, the first data to be annotated is sorted in descending order of probability of the class corresponding to the annotation candidate pool in the inference result;
if the category of the second to-be-labeled data is different from the category corresponding to the labeling candidate pool and the second to-be-labeled data is contained in the fourth to-be-labeled data in the labeling candidate pool, reducing the fourth to-be-labeled data in the labeling candidate pool to only contain the to-be-labeled data meeting the following conditions: the probability of the inference result belonging to the category corresponding to the labeling candidate pool is greater than the probability of the inference result belonging to the category corresponding to the labeling candidate pool of the second piece of data to be labeled, and the method comprises the following steps:
if the labeling category of the piece of second data to be labeled is different from the category corresponding to the labeling candidate pool, and the sorting index of the piece of second data to be labeled is not greater than the maximum sorting index of the fourth data to be labeled in the labeling candidate pool, reducing the fourth data to be labeled in the labeling candidate pool to only contain the data to be labeled which meets the following conditions: the sorting index of the second to-be-labeled data is smaller than that of the second to-be-labeled data.
6. The data annotation method of claim 4 or 5, wherein each piece of first data to be annotated comprises an annotation accuracy attribute and an annotation category attribute, and after the obtaining of the annotation category of the second data to be annotated labeled by the user, the method further comprises:
setting the value of the labeling accuracy rate attribute of each piece of second data to be labeled as a first numerical value, and setting the value of the labeling category attribute as the labeling category;
for each annotation candidate pool, the following steps are also performed:
after the fourth data to be labeled in the labeling candidate pool is reduced, if the fourth data to be labeled contains third data to be labeled which is not labeled yet, acquiring the labeling accuracy of the third data to be labeled; the labeling accuracy is estimated according to the quantity of second data to be labeled which are correctly labeled in the fourth data to be labeled;
and for each piece of third data to be labeled, if the value of the labeling accuracy attribute of the piece of third data to be labeled is smaller than the labeling accuracy, setting the value of the labeling accuracy attribute of the piece of third data to be labeled as the labeling accuracy, and setting the value of the labeling category attribute as the category corresponding to the candidate labeling pool.
7. The data labeling method of claim 3, wherein the labeling model is a classification model, and the inference result of the first data to be labeled comprises a probability that the first data to be labeled belongs to each class;
each iteration comprises the following steps:
sampling the second data to be labeled provided for the user to label in the current iteration from the fourth data to be labeled; for the first iteration, the fourth data to be labeled is the first data to be labeled;
acquiring the labeling category of the second data to be labeled marked by the user; the labeling category of the second data to be labeled is the labeling label of the second data to be labeled;
for each piece of second data to be labeled, if the labeling category of the piece of second data to be labeled is different from the category corresponding to the maximum probability in the inference result, and the piece of second data to be labeled is included in the fourth data to be labeled, reducing the fourth data to be labeled to only include the data to be labeled which meets the following conditions: the maximum probability in the inference result is greater than the maximum probability in the inference result of the second data to be labeled;
after the fourth data to be labeled is reduced, if the fourth data to be labeled contains third data to be labeled which is not labeled, estimating whether the labeling accuracy of the third data to be labeled reaches the standard or not according to the quantity of second data to be labeled which is labeled correctly in the fourth data to be labeled;
if the labeling accuracy of the third data to be labeled reaches the standard, determining the category corresponding to the maximum probability in the inference result of the third data to be labeled as the labeling category of the third data to be labeled; the class corresponding to the maximum probability in the inference result of the third data to be labeled is the inference label of the third data to be labeled, and the labeling class of the third data to be labeled is the labeling label of the third data to be labeled.
8. The data annotation method of claim 7, wherein the first data to be annotated is sorted in descending order according to the maximum probability among the probabilities of the inference results that the first data to be annotated belongs to each category;
if the labeling category of the second piece of data to be labeled is different from the category corresponding to the maximum probability in the inference result, and the second piece of data to be labeled is contained in the fourth piece of data to be labeled, reducing the fourth piece of data to be labeled to only contain the data to be labeled meeting the following conditions: the maximum probability in the inference result is greater than the maximum probability in the inference result of the second piece of data to be labeled, and the method comprises the following steps:
if the labeling category of the second data to be labeled is different from the category corresponding to the maximum probability in the inference result, and the sorting index of the second data to be labeled is not greater than the maximum sorting index in the fourth data to be labeled, reducing the fourth data to be labeled to only contain the data to be labeled which meets the following conditions: the sorting index of the second piece of data to be labeled is smaller than that of the second piece of data to be labeled.
9. The data annotation method of any one of claims 1 to 8, wherein before the obtaining of the annotation tag of the second data to be annotated by the user, the method further comprises:
determining a prediction label of the second data to be labeled according to the inference result of the second data to be labeled;
and displaying the second data to be labeled and the prediction label thereof on a user labeling interface.
10. The data annotation method of claim 9, wherein the annotation model is a classification model, the inference result of the first data to be annotated includes a probability that the first data to be annotated belongs to each class, the first data to be annotated is annotated by performing at least one iteration, before performing the first iteration, an annotation candidate pool corresponding to each class is created according to the inference result of the first data to be annotated, and in each annotation candidate pool, the first data to be annotated is sorted in a descending order according to the probability that the first data to be annotated belongs to the class corresponding to the annotation candidate pool in the inference result;
when each iteration is executed, determining the prediction category of any one piece of second data to be labeled according to the following mode, wherein the prediction category of the second data to be labeled is a prediction label of the second data to be labeled:
obtaining a sorting index of the piece of second data to be labeled in each labeling candidate pool;
normalizing the quantity of the fourth data to be labeled in the labeling candidate pool corresponding to each sequencing index reference to obtain a normalized sequencing index;
and determining the category corresponding to the minimum sorting index in all the normalized sorting indexes as the prediction category of the second data to be labeled.
11. The data labeling method of claim 9, wherein the labeling model is a classification model, the inference result of the first data to be labeled includes a probability that the first data to be labeled belongs to each class, and the first data to be labeled is labeled by performing at least one iteration;
determining the prediction category of any piece of second data to be labeled according to the following mode, wherein the prediction category of the second data to be labeled is the prediction label of the second data to be labeled:
and determining the class corresponding to the maximum probability in the inference result of the second piece of data to be labeled as the prediction class of the second piece of data to be labeled.
12. The data annotation method of any one of claims 9 to 11, wherein the annotation model is a classification model, the prediction label of the second data to be annotated is a prediction category of the second data to be annotated, and the displaying the second data to be annotated and the prediction label thereof on the user annotation interface comprises:
and displaying the second data to be labeled on the user labeling interface in a classified manner according to the prediction category of the second data to be labeled.
13. The data annotation method of claim 12, wherein the second data to be annotated and its prediction category are displayed in a first area of the user annotation interface;
the method further comprises the following steps:
responding to data selection operation which is triggered in the first area and aims at the second data to be annotated, displaying the selected second data to be annotated in a second area of the user annotation interface, and displaying the selected candidate category of the second data to be annotated in the second area;
if one piece of second data to be labeled is selected by the user, the prediction type of the piece of second data to be labeled is not approved by the user.
14. The data annotation method of any one of claims 9 to 13, wherein the second data to be annotated is an image, and the second data to be annotated and a prediction tag thereof are displayed in a first area of the user annotation interface;
the method further comprises the following steps:
displaying a reference image in a third area of the user labeling interface, wherein the reference image is an image selected from the second data to be labeled;
recording an image transformation operation triggered in the third area and aiming at the reference image, applying the image transformation operation to each image in the second data to be labeled, and refreshing and displaying the second data to be labeled after the image transformation operation is executed in the first area;
wherein the image transformation operation comprises at least one operation of image translation, image rotation, image scaling and image local area frame selection.
15. The data annotation method according to any one of claims 1 to 14, wherein the obtaining of the first data to be annotated and the inference result thereof includes:
sampling at least zero batches of training data from a training data pool to train the labeling model, and reasoning at least one batch of data to be labeled sampled from a reasoning data candidate pool by using the labeling model to obtain a reasoning result of the at least one batch of data to be labeled;
writing the at least one batch of data to be marked and the reasoning result thereof into a reasoning result pool;
and reading the first data to be labeled and the inference result thereof from the inference result pool.
16. A computer program product comprising computer program instructions which, when read and executed by a processor, perform the method of any one of claims 1 to 15.
17. A computer-readable storage medium having computer program instructions stored thereon, which when read and executed by a processor, perform the method of any one of claims 1-15.
18. An electronic device, comprising: a memory having stored therein computer program instructions which, when read and executed by the processor, perform the method of any of claims 1-15.
CN202210551037.8A 2022-05-18 2022-05-18 Data labeling method, computer program product, storage medium and electronic device Active CN115100484B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210551037.8A CN115100484B (en) 2022-05-18 2022-05-18 Data labeling method, computer program product, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210551037.8A CN115100484B (en) 2022-05-18 2022-05-18 Data labeling method, computer program product, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN115100484A true CN115100484A (en) 2022-09-23
CN115100484B CN115100484B (en) 2025-05-16

Family

ID=83288730

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210551037.8A Active CN115100484B (en) 2022-05-18 2022-05-18 Data labeling method, computer program product, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN115100484B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115510992A (en) * 2022-10-11 2022-12-23 北京合力亿捷科技股份有限公司 Data labeling method and device, electronic equipment and storage medium
CN115797930A (en) * 2022-11-09 2023-03-14 深圳杉谷科技有限公司 Image data automatic labeling method, equipment, storage medium and device
CN121503593A (en) * 2025-11-11 2026-02-10 北京数码视讯技术有限公司 Interaction methods and systems between annotation software and training platform

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190318261A1 (en) * 2018-04-11 2019-10-17 Samsung Electronics Co., Ltd. System and method for active machine learning
CN113111716A (en) * 2021-03-15 2021-07-13 中国科学院计算机网络信息中心 Remote sensing image semi-automatic labeling method and device based on deep learning
CN113139141A (en) * 2021-04-22 2021-07-20 康键信息技术(深圳)有限公司 User label extension labeling method, device, equipment and storage medium
CN113180701A (en) * 2021-07-01 2021-07-30 中国人民解放军军事科学院军事医学研究院 Electroencephalogram signal depth learning method for image label labeling

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190318261A1 (en) * 2018-04-11 2019-10-17 Samsung Electronics Co., Ltd. System and method for active machine learning
CN113111716A (en) * 2021-03-15 2021-07-13 中国科学院计算机网络信息中心 Remote sensing image semi-automatic labeling method and device based on deep learning
CN113139141A (en) * 2021-04-22 2021-07-20 康键信息技术(深圳)有限公司 User label extension labeling method, device, equipment and storage medium
CN113180701A (en) * 2021-07-01 2021-07-30 中国人民解放军军事科学院军事医学研究院 Electroencephalogram signal depth learning method for image label labeling

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
NOWAK等: "How reliable are annotations via crowdsourcing: a study about inter-annotator agreement for multi-label image annotation", 《PROCEEDINGS OF THE INTERNATIONAL CONFERENCE ON MULTIMEDIA INFORMATION RETRIEVAL》, 29 March 2010 (2010-03-29), pages 557 - 566 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115510992A (en) * 2022-10-11 2022-12-23 北京合力亿捷科技股份有限公司 Data labeling method and device, electronic equipment and storage medium
CN115797930A (en) * 2022-11-09 2023-03-14 深圳杉谷科技有限公司 Image data automatic labeling method, equipment, storage medium and device
CN121503593A (en) * 2025-11-11 2026-02-10 北京数码视讯技术有限公司 Interaction methods and systems between annotation software and training platform

Also Published As

Publication number Publication date
CN115100484B (en) 2025-05-16

Similar Documents

Publication Publication Date Title
Yang et al. Improving one-stage visual grounding by recursive sub-query construction
CN111259142B (en) Specific target emotion classification method based on attention coding and graph convolution network
CN110363049B (en) Methods and devices for detecting, identifying and determining categories of graphic elements
Tang et al. Tri-clustered tensor completion for social-aware image tag refinement
CN111985229A (en) Sequence labeling method and device and computer equipment
CN108717409A (en) A kind of sequence labelling method and device
CN115100484B (en) Data labeling method, computer program product, storage medium and electronic device
CN111078881B (en) Fine-grained sentiment analysis method and system, electronic equipment and storage medium
CN114612767B (en) Scene graph-based image understanding and expressing method, system and storage medium
CN113569888B (en) Image annotation method, device, equipment and medium
CN111291564B (en) A model training method, device and storage medium for word vector acquisition
CN113609337A (en) Pre-training method, device, equipment and medium of graph neural network
CN110265098A (en) A kind of case management method, apparatus, computer equipment and readable storage medium storing program for executing
US12450933B2 (en) Method, device, computer equipment and storage medium for identifying illegal commodity
CN118377384B (en) Virtual scene interaction method and system
CN116756605A (en) An automatic recognition method, system, equipment and medium based on ERNIE_CN-GRU
CN113822183A (en) Zero-sample expression recognition method and system based on AU-EMO association and graph neural network
CN117421609B (en) Image and text semantic similarity calculation method and system applied to social media
CN113434697A (en) Event element extraction method, computer device and storage medium
US20110161266A1 (en) System, method and device for solving problems in np without hyper-polynomial cost
CN116935388B (en) Skin acne image auxiliary labeling method and system, and grading method and system
CN118211931A (en) Strategy process canvas generation method, device, computer equipment and storage medium
CN116975743A (en) Industry information classification methods, devices, computer equipment and storage media
CN115576789A (en) Method and system for identifying lost user
CN109543114A (en) Heterogeneous Information network linking prediction technique, readable storage medium storing program for executing and terminal

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