CN112613569B - Image recognition method, image classification model training method and device - Google Patents
Image recognition method, image classification model training method and device Download PDFInfo
- Publication number
- CN112613569B CN112613569B CN202011598490.1A CN202011598490A CN112613569B CN 112613569 B CN112613569 B CN 112613569B CN 202011598490 A CN202011598490 A CN 202011598490A CN 112613569 B CN112613569 B CN 112613569B
- Authority
- CN
- China
- Prior art keywords
- label
- training
- input image
- image
- abnormal
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/214—Generating training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V20/00—Scenes; Scene-specific elements
- G06V20/10—Terrestrial scenes
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V20/00—Scenes; Scene-specific elements
- G06V20/50—Context or environment of the image
- G06V20/52—Surveillance or monitoring of activities, e.g. for recognising suspicious objects
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Physics & Mathematics (AREA)
- Artificial Intelligence (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- Bioinformatics & Computational Biology (AREA)
- General Engineering & Computer Science (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Multimedia (AREA)
- Image Analysis (AREA)
Abstract
Description
技术领域Technical Field
本申请公开了一种图像识别方法、图像分类模型的训练方法、装置、设备及存储介质,尤其涉及自然语言处理技术领域,具体涉及图像识别和深度学习。The present application discloses an image recognition method, a training method, an apparatus, a device and a storage medium for an image classification model, and particularly relates to the technical field of natural language processing, specifically to image recognition and deep learning.
背景技术Background technique
目前城管案件处理的流程是由巡检员在城市各地巡逻,发现案件后采集案件图片,上传城管系统,通过人工审核识别案件类型,入库。一段时间后,由巡检员再次到案件地址采集图片,上传城管系统,通过人工审核判定当前案件是否被处理,若消失,则做销案处理,关闭此案件,否则更新案件,以便后续再次巡检。整个流程中最核心的案件识别任务和销案判定任务完全依赖于人工,对于每年百万级别的案件数量,人工审核成本大,周期长,且不同审核人员标准和理解不统一。The current process of handling urban management cases is that inspectors patrol the city, collect case pictures after discovering a case, upload them to the urban management system, identify the case type through manual review, and store them in the database. After a period of time, the inspectors will go to the case address again to collect pictures, upload them to the urban management system, and manually review to determine whether the current case has been handled. If it has disappeared, the case will be closed, otherwise the case will be updated for subsequent inspections. The core case identification and case closing tasks in the entire process are completely dependent on manual work. For the number of cases at the million level each year, manual review is costly and time-consuming, and different reviewers have different standards and understandings.
发明内容Summary of the invention
本申请提供了一种图像识别方法、图像分类模型的训练方法、装置、设备、存储介质及计算机程序产品。The present application provides an image recognition method, an image classification model training method, an apparatus, a device, a storage medium and a computer program product.
本申请的第一方面实施例,提供了一种图像识别方法,包括:The first aspect of the present application provides an image recognition method, comprising:
获取经过训练的图像分类模型,以及获取采集到的输入图像;Obtain a trained image classification model and obtain a captured input image;
采用所述图像分类模型对输入图像进行分类处理,以从至少一个异常标签和各所述异常标签关联的背景标签中,确定所述输入图像的标签;Using the image classification model to classify the input image, so as to determine the label of the input image from at least one abnormal label and the background labels associated with each abnormal label;
根据所述输入图像的标签,确定所述输入图像存在所述异常标签指示的异常行为,或者确定所述输入图像存在所述背景标签指示的背景。According to the label of the input image, it is determined that the input image has abnormal behavior indicated by the abnormal label, or it is determined that the input image has a background indicated by the background label.
作为本申请实施例的一种可能的实现方式,所述根据所述输入图像的标签,确定所述输入图像存在所述异常标签指示的异常行为,或者确定所述输入图像存在所述背景标签指示的背景,包括:As a possible implementation manner of the embodiment of the present application, determining, according to the label of the input image, that the input image has an abnormal behavior indicated by the abnormal label, or determining that the input image has a background indicated by the background label, includes:
在所述输入图像的标签为所述异常标签的情况下,确定所述输入图像展示有所述异常标签指示的异常行为;In a case where the label of the input image is the abnormal label, determining that the input image exhibits abnormal behavior indicated by the abnormal label;
在所述输入图像的标签为所述背景标签的情况下,确定所述输入图像中展示有所述背景标签指示的背景,且未具有所述背景标签所关联的异常标签所指示的异常行为。In a case where the label of the input image is the background label, it is determined that the input image shows the background indicated by the background label and does not have abnormal behavior indicated by the abnormal label associated with the background label.
作为本申请实施例的另一种可能的实现方式,所述方法还包括:As another possible implementation of the embodiment of the present application, the method further includes:
查询所述输入图像之前所拍摄的历史图像中展示的历史异常行为;Querying historical abnormal behaviors displayed in historical images taken before the input image;
在所述历史异常行为所属的异常标签,与所述输入图像的标签不匹配的情况下,采用属性识别模型对所述输入图像进行属性识别,以得到至少一个属性的属性值,其中,所述属性用于指示异常行为,所述属性值用于指示存在异常行为的概率;When the abnormal label to which the historical abnormal behavior belongs does not match the label of the input image, an attribute recognition model is used to perform attribute recognition on the input image to obtain an attribute value of at least one attribute, wherein the attribute is used to indicate the abnormal behavior, and the attribute value is used to indicate the probability of the existence of the abnormal behavior;
从所述至少一个属性的属性值中,确定指示所述历史异常行为的目标属性的属性值;Determining, from the attribute values of the at least one attribute, an attribute value of a target attribute indicating the historical abnormal behavior;
在所述目标属性的属性值小于或等于概率阈值的情况下,执行所述历史异常行为的核销流程。When the attribute value of the target attribute is less than or equal to the probability threshold, the cancellation process of the historical abnormal behavior is executed.
作为本申请实施例的另一种可能的实现方式,所述查询所述输入图像之前所拍摄的历史图像中展示的历史异常行为之后,还包括:As another possible implementation of the embodiment of the present application, after querying the historical abnormal behavior displayed in the historical image taken before the input image, it also includes:
在所述历史异常行为所属的异常标签,与所述输入图像的标签匹配的情况下,发出继续采集图像的指示信息。When the abnormal label to which the historical abnormal behavior belongs matches the label of the input image, an instruction message for continuing to collect images is issued.
作为本申请实施例的另一种可能的实现方式,所述查询所述输入图像之前所拍摄的历史图像中展示的历史异常行为之后,还包括:As another possible implementation of the embodiment of the present application, after querying the historical abnormal behavior displayed in the historical image taken before the input image, it also includes:
在所述目标属性的属性值大于概率阈值的情况下,发出继续采集图像的指示信息。When the attribute value of the target attribute is greater than the probability threshold, an instruction message for continuing to collect images is issued.
本申请第二方面实施例提出了一种图像分类模型的训练方法,图像分类模型用于执行第一方面实施例中所述的图像识别方法,所述训练方法包括:The second aspect of the present application provides a training method for an image classification model, where the image classification model is used to perform the image recognition method described in the first aspect of the present application. The training method includes:
获取本轮训练采用的第一样本集合和第二样本集合;Obtain the first sample set and the second sample set used in this round of training;
采用所述第一样本集合中的训练样本,对图像分类模型进行训练;Using the training samples in the first sample set to train the image classification model;
采用所述第二样本集合中的训练样本,对经过训练的所述图像分类模型进行测试,得到所述第二样本集合中各训练样本的预测标签和对应的置信度;Using the training samples in the second sample set to test the trained image classification model, and obtaining the predicted label and corresponding confidence of each training sample in the second sample set;
将所述第二样本集合中的目标样本移动至所述第一样本集合中,以得到下一轮训练所采用的第一样本集合和第二样本集合;其中,所述目标样本,包括所述预测标签与标注标签匹配,且置信度大于阈值置信度的训练样本。The target samples in the second sample set are moved to the first sample set to obtain the first sample set and the second sample set used for the next round of training; wherein the target samples include training samples whose predicted labels match the labeled labels and whose confidence is greater than a threshold confidence.
作为本申请实施例的一种可能的实现方式,所述本轮训练采用的阈值置信度大于下一轮训练采用的阈值置信度。As a possible implementation manner of the embodiment of the present application, the threshold confidence level adopted in the current round of training is greater than the threshold confidence level adopted in the next round of training.
作为本申请实施例的另一种可能的实现方式,所述采用所述第二样本集合中的训练样本,对经过训练的所述图像分类模型进行测试,得到所述第二样本集合中各训练样本的预测标签和置信度之后,还包括:As another possible implementation manner of the embodiment of the present application, after using the training samples in the second sample set to test the trained image classification model and obtaining the predicted labels and confidences of each training sample in the second sample set, the method further includes:
发送提示信息,其中,所述提示信息,用于对所述第二样本集合中,所述预测标签与标注标签不匹配,且置信度大于阈值置信度的训练样本提示进行人工复核;Sending prompt information, wherein the prompt information is used to prompt manual review of the training samples in the second sample set, in which the predicted label does not match the labeled label and the confidence level is greater than a threshold confidence level;
响应于用户复核操作,将经过复核的训练样本作为所述目标样本移动至所述第一样本集合中。In response to a user review operation, the reviewed training samples are moved as the target samples to the first sample set.
作为本申请实施例的另一种可能的实现方式,所述方法还包括:As another possible implementation of the embodiment of the present application, the method further includes:
将多个候选样本输入所述图像分类模型,以得到各所述候选样本的预测标签;Inputting a plurality of candidate samples into the image classification model to obtain a predicted label of each of the candidate samples;
根据多个所述候选样本的预测标签和标注标签,生成目标矩阵;其中,所述目标矩阵中的元素表征符合行对应的标注标签,且符合列对应的预测标签的候选样本;Generate a target matrix based on the predicted labels and labeled labels of the plurality of candidate samples; wherein the elements in the target matrix represent candidate samples that meet the labeled labels corresponding to the rows and the predicted labels corresponding to the columns;
从所述目标矩阵中,获取目标元素,其中,所述目标元素为行对应的标注标签与列对应的预测标签不匹配的元素;Obtain a target element from the target matrix, wherein the target element is an element whose labeled label corresponding to a row does not match the predicted label corresponding to a column;
根据所述目标元素表征的候选样本,生成首轮训练采用的所述第二样本集合。The second sample set used in the first round of training is generated according to the candidate samples represented by the target element.
本申请第三方面实施例提出了一种图像识别装置,包括:The third aspect of the present application provides an image recognition device, including:
获取模块,用于获取经过训练的图像分类模型,以及获取采集到的输入图像;An acquisition module, used to acquire a trained image classification model and acquire a collected input image;
输入模块,用于采用所述图像分类模型对输入图像进行分类处理,以从至少一个异常标签和各所述异常标签关联的背景标签中,确定所述输入图像的标签;确定模块,用于根据所述输入图像的标签,确定所述输入图像存在所述异常标签指示的异常行为,或者确定所述输入图像存在所述背景标签指示的背景。An input module is used to classify the input image using the image classification model to determine the label of the input image from at least one abnormal label and the background labels associated with each abnormal label; a determination module is used to determine, based on the label of the input image, whether the input image has abnormal behavior indicated by the abnormal label, or whether the input image has a background indicated by the background label.
本申请第四方面实施例提出了一种图像分类模型的训练装置,所述图像分类模型用于执行第一方面实施例所述的图像识别方法,所述训练装置包括:The fourth aspect of the present application provides a training device for an image classification model, wherein the image classification model is used to perform the image recognition method described in the first aspect of the present application, and the training device includes:
获取模块,用于获取本轮训练采用的第一样本集合和第二样本集合;An acquisition module, used to acquire a first sample set and a second sample set used in this round of training;
训练模块,用于采用所述第一样本集合中的训练样本,对图像分类模型进行训练;A training module, used to train an image classification model using training samples in the first sample set;
测试模块,用于采用所述第二样本集合中的训练样本,对经过训练的所述图像分类模型进行测试,得到所述第二样本集合中各训练样本的预测标签和对应的置信度;A testing module, used to test the trained image classification model using the training samples in the second sample set, and obtain the predicted label and corresponding confidence of each training sample in the second sample set;
第一移动模块,用于将所述第二样本集合中的目标样本移动至所述第一样本集合中,以得到下一轮训练所采用的第一样本集合和第二样本集合;其中,所述目标样本,包括所述预测标签与标注标签匹配,且置信度大于阈值置信度的训练样本。The first moving module is used to move the target sample in the second sample set to the first sample set to obtain the first sample set and the second sample set used for the next round of training; wherein the target sample includes the training sample whose predicted label matches the marked label and whose confidence is greater than the threshold confidence.
本申请第五方面实施例提出了一种电子设备,包括:A fifth aspect of the present application provides an electronic device, including:
至少一个处理器;以及at least one processor; and
与所述至少一个处理器通信连接的存储器;其中,a memory communicatively connected to the at least one processor; wherein,
所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行第一方面实施例所述的图像识别方法,或者,执行第二方面实施例所述的模型的训练方法。The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the image recognition method described in the first aspect embodiment, or execute the model training method described in the second aspect embodiment.
本申请第六方面实施例提出了一种存储有计算机指令的非瞬时计算机可读存储介质,其中,所述计算机指令用于使所述计算机执行第一方面实施例所述的图像识别方法,或者,执行第二方面实施例所述的模型的训练方法。The sixth aspect embodiment of the present application proposes a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute the image recognition method described in the first aspect embodiment, or to execute the model training method described in the second aspect embodiment.
本申请第七方面实施例提出了一种计算机程序产品,包括计算机程序,所述计算机程序在被处理器执行时实现第一方面实施例所述的图像识别方法,或者,执行第二方面实施例所述的模型的训练方法。The seventh aspect embodiment of the present application proposes a computer program product, including a computer program, which, when executed by a processor, implements the image recognition method described in the first aspect embodiment, or executes the model training method described in the second aspect embodiment.
应当理解,本部分所描述的内容并非旨在标识本申请的实施例的关键或重要特征,也不用于限制本申请的范围。本申请的其它特征将通过以下的说明书而变得容易理解。It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
附图用于更好地理解本方案,不构成对本申请的限定。其中:The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present application.
图1为本申请实施例提供的一种图像识别方法的流程示意图;FIG1 is a schematic diagram of a flow chart of an image recognition method provided in an embodiment of the present application;
图2为本申请实施例提供的另一种图像识别方法的流程示意图;FIG2 is a schematic diagram of a flow chart of another image recognition method provided in an embodiment of the present application;
图3为本申请实施例提供的另一种图像识别方法的流程示意图;FIG3 is a schematic diagram of a flow chart of another image recognition method provided in an embodiment of the present application;
图4为本申请实施例提供的一种图像识别的示例图;FIG4 is an example diagram of image recognition provided by an embodiment of the present application;
图5为本申请实施例提供的一种图像分类模型的训练方法的流程示意图;FIG5 is a flow chart of a method for training an image classification model provided in an embodiment of the present application;
图6为本申请实施例提供的另一种图像分类模型的训练方法的流程示意图;FIG6 is a flow chart of another method for training an image classification model provided in an embodiment of the present application;
图7为本申请实施例提供的又一种图像分类模型的训练方法的流程示意图;FIG7 is a flow chart of another method for training an image classification model provided in an embodiment of the present application;
图8为本申请实施例提供的一种图像分类模型的训练示例图;FIG8 is a diagram showing an example of training an image classification model provided in an embodiment of the present application;
图9为本申请实施例提供的一种图像识别装置的结构示意图;FIG9 is a schematic diagram of the structure of an image recognition device provided in an embodiment of the present application;
图10为本申请实施例提供的一种图像分类模型的训练装置的结构示意图;FIG10 is a schematic diagram of the structure of a training device for an image classification model provided in an embodiment of the present application;
图11是用来实现本申请实施例的电子设备的示意性框图。FIG. 11 is a schematic block diagram of an electronic device for implementing an embodiment of the present application.
具体实施方式Detailed ways
以下结合附图对本申请的示范性实施例做出说明,其中包括本申请实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本申请的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
相关技术中,完全依赖于人工审核并手动录入案件信息,但是,每年一个地区的案件上传数量达到百万规模,其中,每个案件又涉及到多张图片、多次审核,从而给人工审核带来了巨大的挑战。此外,不同审核人员的判断标准不统一,又会影响案件识别的质量,造成入库案件发生歧义。In the related technologies, it is completely dependent on manual review and manual entry of case information. However, the number of cases uploaded in a region reaches millions each year, and each case involves multiple pictures and multiple reviews, which brings huge challenges to manual review. In addition, the judgment standards of different reviewers are not unified, which will affect the quality of case identification and cause ambiguity in the cases stored.
为此,本申请提出了一种图像识别方法,通过获取经过训练的图像分类模型,以及获取采集到的输入图像;采用图像分类模型对输入图像进行分类处理,以从至少一个异常标签和各异常标签关联的背景标签中,确定输入图像的标签;根据输入图像的标签,确定输入图像存在异常标签指示的异常行为,或者确定输入图像存在背景标签指示的背景。To this end, the present application proposes an image recognition method, which obtains a trained image classification model and a collected input image; uses the image classification model to classify the input image to determine the label of the input image from at least one abnormal label and the background labels associated with each abnormal label; based on the label of the input image, determines whether the input image has abnormal behavior indicated by the abnormal label, or determines whether the input image has a background indicated by the background label.
下面参考附图描述本申请实施例的图像识别方法、图像分类模型的训练方法、装置、设备及存储介质。The following describes the image recognition method, image classification model training method, device, equipment and storage medium of the embodiments of the present application with reference to the accompanying drawings.
图1为本申请实施例提供的一种图像识别方法的流程示意图。FIG1 is a flow chart of an image recognition method provided in an embodiment of the present application.
本申请实施例以该图像识别方法被配置于图像识别装置中来举例说明,该图像识别装置可以应用于任一电子设备中,以使该电子设备可以执行图像识别功能。The embodiment of the present application takes the image recognition method being configured in an image recognition device as an example. The image recognition device can be applied to any electronic device so that the electronic device can perform an image recognition function.
其中,电子设备可以为个人电脑(Personal Computer,简称PC)、云端设备、移动设备等,移动设备例如可以为手机、平板电脑、个人数字助理、穿戴式设备、车载设备等具有各种操作系统的硬件设备。Among them, the electronic device can be a personal computer (PC), a cloud device, a mobile device, etc. The mobile device can be, for example, a mobile phone, a tablet computer, a personal digital assistant, a wearable device, a car device, and other hardware devices with various operating systems.
如图1所示,该图像识别方法,可以包括以下步骤:As shown in FIG1 , the image recognition method may include the following steps:
步骤101,获取经过训练的图像分类模型,以及获取采集到的输入图像。Step 101, obtaining a trained image classification model and obtaining a collected input image.
其中,图像分类模型是经过训练样本进行训练得到的,能够对输入图像进行分类处理,以确定输入图像的标签。The image classification model is trained with training samples and can classify the input image to determine the label of the input image.
本申请实施例中,输入图像,可以是执法人员采用成像设备采集得到的图像,也可以是通过设置的街道的摄像头采集得到的图像,等等,在此不做限定。In the embodiment of the present application, the input image may be an image captured by law enforcement personnel using an imaging device, or an image captured by a camera installed on the street, etc., which is not limited here.
可以理解的是,在城市管理过程中,存在商铺占道经营、垃圾乱放等违法案件,执法人员发现违法案件后,可以采集得到案件现场的图像,即采集得到输入图像。It is understandable that in the process of urban management, there are illegal cases such as shops occupying the road and littering. After law enforcement officers discover illegal cases, they can collect images of the scene of the crime, that is, collect input images.
步骤102,采用图像分类模型对输入图像进行分类处理,以从至少一个异常标签和各异常标签关联的背景标签中,确定输入图像的标签。Step 102: classify the input image using an image classification model to determine a label of the input image from at least one abnormal label and background labels associated with each abnormal label.
其中,异常标签,用于指示输入图像存在的异常行为,例如,占道经营、跨店经营,等等。Among them, the abnormal label is used to indicate the abnormal behavior in the input image, such as occupying the road for business, cross-store business, etc.
异常标签关联的背景标签,用于是指输入图像中违章类型的背景信息,例如,异常标签为“垃圾暴露”,与该异常标签关联的背景标签可以为“垃圾桶”;异常标签为“跨店经营”,与该异常标签关联的背景标签可以为“商店铺面”,等等。The background label associated with the abnormal label is used to refer to the background information of the violation type in the input image. For example, if the abnormal label is "garbage exposure", the background label associated with the abnormal label can be "trash can"; if the abnormal label is "cross-store operation", the background label associated with the abnormal label can be "store frontage", and so on.
本申请实施例中,获取到经过训练的图像分类模型和输入图像后,可以将输入图像输入至图像分类模型,以采用图像分类模型对输入图像进行分类处理,以确定输入图像的标签。也就是说,采用图像分类模型确定输入图像的标签为异常标签或者为背景标签。In the embodiment of the present application, after obtaining the trained image classification model and the input image, the input image can be input into the image classification model, so as to classify the input image using the image classification model to determine the label of the input image. In other words, the image classification model is used to determine whether the label of the input image is an abnormal label or a background label.
步骤103,根据输入图像的标签,确定输入图像存在异常标签指示的异常行为,或者确定输入图像存在背景标签指示的背景。Step 103 : determining, based on the label of the input image, whether the input image has abnormal behavior indicated by the abnormal label, or whether the input image has background indicated by the background label.
在一种可能的情况下,图像分类模型确定输入图像的标签为异常标签,则确定输入图像中展示有异常标签指示的异常行为。由此,可以确定输入图像中的案件存在,并未进行销案处理。In one possible case, the image classification model determines that the label of the input image is an abnormal label, and determines that the input image exhibits abnormal behavior indicated by the abnormal label. Therefore, it can be determined that the case in the input image exists and has not been closed.
另一种可能的情况下,采用图像分类模型对输入图像进行分类处理,确定输入图像的标签为背景标签。进一步地,对输入图像进行识别,以确定输入图像中存在有背景标签指示的背景。In another possible case, the input image is classified by using an image classification model to determine that the label of the input image is a background label. Further, the input image is identified to determine that there is a background indicated by the background label in the input image.
本申请实施例的图像识别方法,采用经过训练的图像分类模型对采集到的输入图像进行分类处理,以从至少一个异常标签和各异常标签关联的背景标签中,确定输入图像的标签;根据输入图像的标签,确定输入图像存在异常标签指示的异常行为,或者确定输入图像存在背景标签指示的背景。由此,通过图像分类模型确定输入图像的标签后,根据输入图像的标签,确定输入图像中是否存在异常行为,有效地解决了相关技术中城管违章案件处理过程中需要人工审核,存在审核成本大、周期长等技术问题,极大的减少了案件审核人员的工作量,显著优化了处理效率。The image recognition method of the embodiment of the present application uses a trained image classification model to classify the collected input image to determine the label of the input image from at least one abnormal label and the background labels associated with each abnormal label; according to the label of the input image, it is determined that the input image has abnormal behavior indicated by the abnormal label, or that the input image has a background indicated by the background label. Therefore, after the label of the input image is determined by the image classification model, it is determined whether there is abnormal behavior in the input image according to the label of the input image, which effectively solves the technical problems of the need for manual review in the process of handling urban management violation cases in the related technology, and there are high review costs and long cycles, etc., which greatly reduces the workload of case reviewers and significantly optimizes the processing efficiency.
在上述实施例的基础上,本申请提出了另一种图像识别方法。Based on the above embodiments, the present application proposes another image recognition method.
图2为本申请实施例提供的另一种图像识别方法的流程示意图。FIG2 is a flow chart of another image recognition method provided in an embodiment of the present application.
如图2所示,该图像识别方法,可以包括以下步骤:As shown in FIG2 , the image recognition method may include the following steps:
步骤201,获取经过训练的图像分类模型,以及获取采集到的输入图像。Step 201, obtaining a trained image classification model and obtaining a collected input image.
步骤202,采用图像分类模型对输入图像进行分类处理,以从至少一个异常标签和各异常标签关联的背景标签中,确定输入图像的标签。Step 202: classify the input image using an image classification model to determine a label of the input image from at least one abnormal label and background labels associated with each abnormal label.
本申请实施例中,步骤201至步骤202的实现过程,可以参见上述实施例中,步骤101至步骤102的实现过程,在此不再赘述。In the embodiment of the present application, the implementation process of step 201 to step 202 can refer to the implementation process of step 101 to step 102 in the above embodiment, which will not be repeated here.
步骤203,在输入图像的标签为异常标签的情况下,确定输入图像展示有异常标签指示的异常行为。Step 203 : when the label of the input image is an abnormal label, determine whether the input image exhibits abnormal behavior indicated by the abnormal label.
在一种可能的情况下,采用图像分类模型对输入图像进行分类处理,确定输入图像的标签为异常标签,进一步地,对输入图像进行识别,以确定输入图像展示有异常标签指示的异常行为。由此,可以确定输入图像中的案件存在,并未进行销案处理。In one possible case, the input image is classified using an image classification model to determine that the label of the input image is an abnormal label, and further, the input image is identified to determine that the input image exhibits abnormal behavior indicated by the abnormal label. Thus, it can be determined that the case in the input image exists and has not been closed.
作为一种示例,假设图像分类模型对输入图像进行分类处理,确定输入图像的标签为“垃圾暴露”的情况下,确定输入图像展示有垃圾暴露的行为。由此,可以确定输入图像中的案件存在,该案件并未被处理,可以继续采集该处的图像,采用图像分类模型继续对图像进行分类处理。As an example, suppose the image classification model classifies the input image and determines that the label of the input image is "garbage exposure", then it is determined that the input image shows garbage exposure behavior. Therefore, it can be determined that the case in the input image exists and the case has not been processed. Images of this location can be collected and the image classification model can be used to continue to classify the images.
步骤204,在输入图像的标签为背景标签的情况下,确定输入图像中展示有背景标签指示的背景,且未具有背景标签所关联的异常标签所指示的异常行为。Step 204 : when the label of the input image is a background label, determine that the input image shows a background indicated by the background label and does not have an abnormal behavior indicated by an abnormal label associated with the background label.
在另一种可能的情况下,采用图像分类模型对输入图像进行分类处理,确定输入图像的标签为背景标签。进一步地,对输入图像进行识别,以确定输入图像中展示有背景标签指示的背景,且未具有背景标签所关联的异常标签所指示的异常行为。In another possible case, the input image is classified by using an image classification model to determine that the label of the input image is a background label. Further, the input image is identified to determine that the input image shows a background indicated by the background label and does not have an abnormal behavior indicated by an abnormal label associated with the background label.
作为一种示例,假设图像分类模型对输入图像进行分类处理,确定输入图像的背景标签为“垃圾桶”。进一步地,确定输入图像中展示有垃圾桶,但是并未具有“垃圾暴露”的异常行为。由此,可以确定该输入图像中的违法案件消失,执法人员可以对该案件进行销案处理。As an example, assume that the image classification model classifies the input image and determines that the background label of the input image is "trash can". Further, it is determined that there is a trash can in the input image, but there is no abnormal behavior of "trash exposure". Therefore, it can be determined that the illegal case in the input image has disappeared, and law enforcement officers can close the case.
需要说明的是,上述步骤203和步骤204并非顺序执行过程,而是根据步骤202中图像分类模型确定的输入图像的标签,确实执行步骤203,或者,执行步骤204。It should be noted that the above steps 203 and 204 are not executed sequentially, but step 203 is actually executed, or step 204 is executed, according to the label of the input image determined by the image classification model in step 202.
本申请实施例的图像识别方法,采用经过训练的图像分类模型对采集到的输入图像进行分类处理,以从至少一个异常标签和各异常标签关联的背景标签中,确定输入图像的标签;在输入图像的标签为异常标签的情况下,确定输入图像展示有异常标签指示的异常行为;在输入图像的标签为背景标签的情况下,确定输入图像中展示有背景标签指示的背景,且未具有背景标签所关联的异常标签所指示的异常行为。由此,通过图像分类模型确定输入图像的标签后,根据输入图像中展示的内容,确定输入图像中是否存在异常行为,有效地解决了相关技术中城管违章案件处理过程中需要人工审核,存在审核成本大、周期长等技术问题,极大的减少了案件审核人员的工作量,显著优化了处理效率。The image recognition method of the embodiment of the present application uses a trained image classification model to classify the collected input image to determine the label of the input image from at least one abnormal label and the background labels associated with each abnormal label; when the label of the input image is an abnormal label, it is determined that the input image shows abnormal behavior indicated by the abnormal label; when the label of the input image is a background label, it is determined that the background indicated by the background label is displayed in the input image, and there is no abnormal behavior indicated by the abnormal label associated with the background label. Therefore, after the label of the input image is determined by the image classification model, it is determined whether there is abnormal behavior in the input image based on the content displayed in the input image, which effectively solves the technical problems of the need for manual review in the process of handling urban management violation cases in the related technology, and there are high review costs and long cycles, etc., which greatly reduces the workload of case reviewers and significantly optimizes processing efficiency.
在实际的场景中,图像分类模型对输入图像进行分类处理,确定输入图像的标签可能存在与之前所拍摄的历史图像中的异常行为所属的异常标签不匹配的情况。本申请中可以采用属性识别模型对输入图像进行属性识别,以根据属性识别模型输出的属性值,确定是否对历史异常行为执行核销流程。下面结合图3进行详细介绍,图3为本申请实施例提供的另一种图像识别方法的流程示意图。In an actual scenario, the image classification model classifies the input image and determines that the label of the input image may not match the abnormal label of the abnormal behavior in the historical image taken before. In this application, an attribute recognition model can be used to perform attribute recognition on the input image to determine whether to execute the verification process for the historical abnormal behavior based on the attribute value output by the attribute recognition model. The following is a detailed introduction in conjunction with Figure 3, which is a flow chart of another image recognition method provided in an embodiment of the present application.
如图3所示,该图像识别方法,还可以包括以下步骤:As shown in FIG3 , the image recognition method may further include the following steps:
步骤301,查询输入图像之前所拍摄的历史图像中展示的历史异常行为。Step 301 , querying historical abnormal behaviors displayed in historical images taken before the input image.
其中,历史图像与输入图像的拍摄地点和拍摄目标相同。The historical image has the same shooting location and shooting target as the input image.
可以理解的是,采用图像分类模型对输入图像进行分类处理时,也可以查询输入图像之前所拍摄的历史图像中展示的历史异常行为。It is understandable that when an input image is classified using an image classification model, historical abnormal behaviors displayed in historical images taken before the input image can also be queried.
进一步地,可以根据历史图像中展示的历史异常行为确定历史异常行为所属的异常标签。Furthermore, the abnormal label to which the historical abnormal behavior belongs can be determined based on the historical abnormal behavior displayed in the historical image.
作为一种示例,假设历史图像中的历史异常行为为占用道路经营,则可以确定历史异常行为所属的异常标签为“占道经营”。As an example, assuming that the historical abnormal behavior in the historical image is occupying the road for business, it can be determined that the abnormal label to which the historical abnormal behavior belongs is "occupying the road for business".
步骤302,在历史异常行为所属的异常标签,与输入图像的标签不匹配的情况下,采用属性识别模型对输入图像进行属性识别,以得到至少一个属性的属性值。Step 302: When the abnormal label to which the historical abnormal behavior belongs does not match the label of the input image, an attribute recognition model is used to perform attribute recognition on the input image to obtain an attribute value of at least one attribute.
其中,属性用于指示异常行为,属性值用于指示存在异常行为的概率。The attribute is used to indicate abnormal behavior, and the attribute value is used to indicate the probability of the existence of abnormal behavior.
本申请实施例中,将每一种异常行为作为图像的一个属性,根据属性识别模式输出的属性值确定输入图像是否存在异常行为。In the embodiment of the present application, each abnormal behavior is taken as an attribute of the image, and whether the input image has abnormal behavior is determined according to the attribute value output by the attribute recognition mode.
其中,属性识别模型为采用大量的样本图像进行训练得到的,能够准确识别出图像中是否存在异常行为。Among them, the attribute recognition model is trained by using a large number of sample images, and can accurately identify whether there is abnormal behavior in the image.
本申请实施例中,确定输入图像之前所拍摄的历史图像中展示的历史异常行为所属的异常标签,与输入图像的标签不匹配时,可以采用属性识别模型对输入图像进行属性识别,以得到输入图像中存在的各种异常行为的概率。In an embodiment of the present application, when the abnormal label to which the historical abnormal behavior displayed in the historical image taken before the input image belongs does not match the label of the input image, an attribute recognition model can be used to perform attribute recognition on the input image to obtain the probabilities of various abnormal behaviors existing in the input image.
在一种可能的情况下,输入图像中可能存在多种异常行为,将输入图像输入属性识别模型,属性识别模型可以输出输入图像中存在每一种异常行为的概率。In one possible case, there may be multiple abnormal behaviors in the input image, and the input image is input into the attribute recognition model, and the attribute recognition model can output the probability of each abnormal behavior existing in the input image.
作为一种示例,假设输入图像中存在三种异常行为,采用属性识别模型对输入图像进行属性识别,可以得到三个属性值,分别用于指示存在的三种异常行为的概率。As an example, assuming that there are three abnormal behaviors in the input image, the attribute recognition model is used to perform attribute recognition on the input image, and three attribute values can be obtained, which are respectively used to indicate the probabilities of the three abnormal behaviors.
本申请实施例中,确定输入图像之前所拍摄的历史图像中展示的历史异常行为所属的异常标签,与输入图像的标签匹配时,可以发出继续采集图像的指示信息。In an embodiment of the present application, when it is determined that the abnormal label to which the historical abnormal behavior displayed in the historical image taken before the input image belongs matches the label of the input image, an instruction message to continue collecting images can be issued.
可以理解为,输入图像中的异常行为与历史图像中的异常行为相同,可以发出继续采集图像的指示信息,以使得执法人员继续采集输入图像所处位置的图像,以根据再次采集的图像判断图像中是否仍然存在异常行为。It can be understood that the abnormal behavior in the input image is the same as the abnormal behavior in the historical image, and an instruction message to continue collecting images can be issued so that law enforcement personnel can continue to collect images at the location of the input image to determine whether abnormal behavior still exists in the image based on the re-collected images.
步骤303,从至少一个属性的属性值中,确定指示历史异常行为的目标属性的属性值。Step 303: Determine the attribute value of the target attribute indicating the historical abnormal behavior from the attribute value of at least one attribute.
其中,目标属性用于指示历史图像中展示的历史异常行为。Among them, the target attribute is used to indicate the historical abnormal behavior shown in the historical image.
本申请实施例中,属性识别模型对输入图像进行属性识别,得到至少一个属性的属性值后,可以从至少一个属性的属性值中,确定与历史图像中展示的历史异常行为相同的异常行为的概率。In an embodiment of the present application, the attribute recognition model performs attribute recognition on the input image and obtains the attribute value of at least one attribute. Then, the probability of abnormal behavior that is the same as the historical abnormal behavior shown in the historical image can be determined from the attribute value of at least one attribute.
作为一种示例,假设历史图像中展示的历史异常行为为异常行为A,属性识别模型对输入图像进行属性识别,得到三种异常行为的属性值后,可以在三种异常行为的属性值中确定异常行为A对应的属性值。As an example, assuming that the historical abnormal behavior displayed in the historical image is abnormal behavior A, the attribute recognition model performs attribute recognition on the input image, and after obtaining the attribute values of the three abnormal behaviors, the attribute value corresponding to abnormal behavior A can be determined from the attribute values of the three abnormal behaviors.
步骤304,在目标属性的属性值小于或等于概率阈值的情况下,执行历史异常行为的核销流程。Step 304: When the attribute value of the target attribute is less than or equal to the probability threshold, the cancellation process of the historical abnormal behavior is executed.
其中,核销流程,是指将异常行为从案件管理平台中删除的过程。Among them, the cancellation process refers to the process of deleting abnormal behavior from the case management platform.
其中,概率阈值为预先设定的概率值。The probability threshold is a pre-set probability value.
本申请实施例中,确定属性识别模型输出的指示历史异常行为的目标属性的属性值后,比较以确定目标属性的属性值与概率阈值的大小关系。In the embodiment of the present application, after determining the attribute value of the target attribute indicating the historical abnormal behavior output by the attribute recognition model, a comparison is performed to determine the magnitude relationship between the attribute value of the target attribute and the probability threshold.
在一种可能的情况下,确定目标属性的属性值小于或等于概率阈值,这种情况下,输入图像中存在目标属性指示的异常行为的概率较低,可以执行历史异常行为的核销流程。In one possible case, it is determined that the attribute value of the target attribute is less than or equal to the probability threshold. In this case, the probability of the abnormal behavior indicated by the target attribute existing in the input image is low, and the verification process of the historical abnormal behavior can be executed.
在另一种可能的情况下,确定目标属性的属性值大于概率阈值,这种情况下,可以发出继续采集图像的指示信息,以使得执法人员继续采集输入图像所处位置的图像,以根据再次采集的图像判断图像中是否仍然存在异常行为。In another possible case, it is determined that the attribute value of the target attribute is greater than the probability threshold. In this case, an instruction message to continue collecting images can be issued so that the law enforcement personnel can continue to collect images at the location of the input image to determine whether abnormal behavior still exists in the image based on the re-collected images.
本申请实施例中,通过查询输入图像之前所拍摄的历史图像中展示的历史异常行为,在历史异常行为所属的异常标签,与输入图像的标签不匹配的情况下,采用属性识别模型对输入图像进行属性识别,以得到至少一个属性的属性值,从至少一个属性的属性值中,确定指示历史异常行为的目标属性的属性值小于或等于概率阈值的情况下,执行历史异常行为的核销流程。由此,通过属性识别模型对输入图像进行属性识别,以确定输入图像中存在的异常行为,避免了输入图像中存在多种异常行为,导致异常行为核销失败的情况。In the embodiment of the present application, by querying the historical abnormal behaviors displayed in the historical images taken before the input image, when the abnormal label to which the historical abnormal behavior belongs does not match the label of the input image, the attribute recognition model is used to perform attribute recognition on the input image to obtain the attribute value of at least one attribute, and from the attribute value of at least one attribute, when the attribute value of the target attribute indicating the historical abnormal behavior is determined to be less than or equal to the probability threshold, the historical abnormal behavior cancellation process is executed. Thus, the attribute recognition model is used to perform attribute recognition on the input image to determine the abnormal behaviors present in the input image, thereby avoiding the situation where there are multiple abnormal behaviors in the input image, resulting in the failure of abnormal behavior cancellation.
作为一种示例,如图4所示,图4为本申请实施例提供的一种图像识别方法的示例图。As an example, as shown in FIG4 , FIG4 is an example diagram of an image recognition method provided in an embodiment of the present application.
如图4所示,获取到采集的输入图像后,可以将输入图像输入至图像分类模型,以确定输入图像的异常行为。查询输入图像之前所拍摄的历史图像中展示的历史异常行为,在历史异常行为所属的异常标签,与输入图像的标签不匹配的情况下,采用属性识别模型对输入图像进行属性识别,以得到至少一个属性的属性值。As shown in FIG4 , after the collected input image is obtained, the input image can be input into the image classification model to determine the abnormal behavior of the input image. The historical abnormal behavior shown in the historical image taken before the input image is queried. When the abnormal label to which the historical abnormal behavior belongs does not match the label of the input image, the attribute recognition model is used to perform attribute recognition on the input image to obtain the attribute value of at least one attribute.
在一种可能的情况下,确定指示历史异常行为的目标属性的属性值小于或等于概率阈值,则执行历史异常行为的核销流程。In one possible case, it is determined that the attribute value of the target attribute indicating the historical abnormal behavior is less than or equal to the probability threshold, and then the cancellation process of the historical abnormal behavior is executed.
在另一种可能的情况下,根据属性识别模型输出的至少一个属性的属性值,确定指示历史异常行为的目标属性的属性值大于概率阈值,发出继续采集图像的指示信息。In another possible case, based on the attribute value of at least one attribute output by the attribute recognition model, it is determined that the attribute value of the target attribute indicating historical abnormal behavior is greater than a probability threshold, and indication information for continuing to collect images is issued.
图像分类模型对输入图像进行分类处理,确定输入图像的标签为异常标签的情况下,确定输入图像中展示有异常标签指示的异常行为,该异常行为未被核销。The image classification model performs classification processing on the input image, and when determining that the label of the input image is an abnormal label, determines that the input image exhibits abnormal behavior indicated by the abnormal label, and the abnormal behavior is not cancelled.
图像分类模型对输入图像进行分类处理,确定输入图像的标签为背景标签的情况下,确定输入图像中展示有背景标签指示的背景,且未具有所述背景标签所关联的异常标签所指示的异常行为,则确定该输入图像中的异常行为已结案。The image classification model classifies the input image and determines that the label of the input image is a background label. It is determined that the input image displays a background indicated by the background label and does not have abnormal behavior indicated by the abnormal label associated with the background label. Then, it is determined that the abnormal behavior in the input image has been closed.
在上述实施例中介绍了采用图像分类模型对输入图像进行分类处理,为了训练图像分类模型,需要采集大量的图像作为训练样本。但是,采集的图像中包括了很多无法区分图像所属的异常标签,采用人工标注的方式对训练样本进行标注标签,需要消耗大量的人力成本。下面结合图5介绍如何对图像分类模型进行训练,图5为本申请实施例提供的一种图像分类模型的训练方法的流程示意图。In the above embodiment, it is introduced that an image classification model is used to classify input images. In order to train the image classification model, a large number of images need to be collected as training samples. However, the collected images include many abnormal labels that cannot be distinguished from the images. It takes a lot of manpower to label the training samples manually. The following describes how to train the image classification model in conjunction with Figure 5. Figure 5 is a flow chart of a training method for an image classification model provided in an embodiment of the present application.
如图5所示,该图像分类模型的训练方法可以包括以下步骤:As shown in FIG5 , the training method of the image classification model may include the following steps:
步骤501,获取本轮训练采用的第一样本集合和第二样本集合。Step 501: Obtain a first sample set and a second sample set used in this round of training.
其中,第一样本集合和第二样本集合中的训练样本,分别用于对图像分类模型进行训练和测试。用于测试的第二样本集合中的各训练样本均为标注后的图像。The training samples in the first sample set and the second sample set are used for training and testing the image classification model, respectively. Each training sample in the second sample set used for testing is a labeled image.
本申请实施例中,第一样本集合和第二样本集合中的训练样本,可以是执法人员采用成像设备采集得到的图像,也可以是通过设置的街道的摄像头采集得到的图像,也可以是从服务器获取到的图像,等等,在此不做限定。In the embodiment of the present application, the training samples in the first sample set and the second sample set can be images collected by law enforcement personnel using imaging equipment, or images collected by cameras installed on the street, or images obtained from a server, etc., which are not limited here.
在获取到用于训练的图像后,可以采用随机分组的方式将训练样本划分为第一样本集合和第二样本集合。After the images for training are acquired, the training samples may be divided into a first sample set and a second sample set by random grouping.
例如,获取到训练样本后,可以将20%的训练样本划分至第一样本集合中,将80%的训练样本划分至第二样本集合中。For example, after the training samples are acquired, 20% of the training samples may be divided into the first sample set, and 80% of the training samples may be divided into the second sample set.
在一种可能的情况下,本轮训练采用的第一样本集合和第二样本集合中的训练样本,可以为上一轮训练过程结束后得到的样本集合。In a possible case, the training samples in the first sample set and the second sample set used in the current round of training may be sample sets obtained after the previous round of training process is completed.
步骤502,采用第一样本集合中的训练样本,对图像分类模型进行训练。Step 502: Use the training samples in the first sample set to train the image classification model.
步骤503,采用第二样本集合中的训练样本,对经过训练的图像分类模型进行测试,得到第二样本集合中各训练样本的预测标签和对应的置信度。Step 503: Use the training samples in the second sample set to test the trained image classification model to obtain the predicted label and corresponding confidence of each training sample in the second sample set.
本申请实施例中,获取到本轮训练采用的第一样本集合和第二样本集合后,可以采用第一样本集合中的训练样本,对图像分类模型进行训练,通过调整图像分类模型的模型参数,以使得训练后的图像分类模型能够识别出图像的标签。In an embodiment of the present application, after obtaining the first sample set and the second sample set used in this round of training, the training samples in the first sample set can be used to train the image classification model, and the model parameters of the image classification model can be adjusted so that the trained image classification model can recognize the label of the image.
本申请中,采用第一样本集合中的训练样本对图像分类模型训练结束后,可以采用第二样本集合中的训练样本对经过训练的图像分类模型进行测试,以得到图像分类模型输出的第二样本集合中各训练样本的预测标签和对应的置信度。其中,置信度,用于指示第二样本集合中各训练样本的预测标签和各训练样本的标注标签的匹配程度。In the present application, after the training of the image classification model using the training samples in the first sample set is completed, the trained image classification model can be tested using the training samples in the second sample set to obtain the predicted labels and corresponding confidences of each training sample in the second sample set output by the image classification model. The confidence is used to indicate the degree of match between the predicted labels of each training sample in the second sample set and the annotated labels of each training sample.
可以理解的是,图像分类模型输出的第二样本集合中各训练样本的置信度越高,对应的训练样本为正确样本,置信度越低,对应的训练样本为错误样本。It can be understood that, the higher the confidence of each training sample in the second sample set output by the image classification model, the corresponding training sample is a correct sample, and the lower the confidence, the corresponding training sample is an incorrect sample.
步骤504,将第二样本集合中的目标样本移动至第一样本集合中,以得到下一轮训练所采用的第一样本集合和第二样本集合。Step 504: Move the target samples in the second sample set to the first sample set to obtain the first sample set and the second sample set used for the next round of training.
其中,目标样本,包括预测标签与标注标签匹配,且置信度大于阈值置信度的训练样本。阈值置信度,为预先设定的置信度值。The target sample includes a training sample whose predicted label matches the labeled label and whose confidence is greater than a threshold confidence. The threshold confidence is a preset confidence value.
本申请实施例中,采用第二样本集合中的训练样本,对经过训练的所述图像分类模型进行测试,得到第二样本集合中各训练样本的预测标签和对应的置信度后,可以将预测标签与标注标签匹配,且置信度大于阈值置信度的训练样本作为目标样本。In an embodiment of the present application, the trained image classification model is tested using training samples in the second sample set. After obtaining the predicted labels and corresponding confidence levels of each training sample in the second sample set, the predicted labels can be matched with the labeled labels, and the training samples whose confidence levels are greater than the threshold confidence levels can be used as target samples.
需要说明的是,本轮训练过程中采用的阈值置信度大于下一轮训练采用的阈值置信度,阈值置信度随着模型训练的迭代次数逐渐减小,直至阈值置信度减小至预先设定的某一阈值置信度,将第二样本集合中的训练样本全部移动至第一样本集合中,以采用第一样本集合中的训练样本对图像分类模型进行训练。It should be noted that the threshold confidence used in this round of training is greater than the threshold confidence used in the next round of training. The threshold confidence gradually decreases with the number of iterations of model training until the threshold confidence decreases to a preset threshold confidence. All training samples in the second sample set are moved to the first sample set, so that the image classification model can be trained using the training samples in the first sample set.
本申请实施例中,从第二样本集合中确定目标样本后,可以将目标样本移动至第一样本集合中,以得到下一轮训练所采用的第一样本集合和第二样本集合。In the embodiment of the present application, after the target sample is determined from the second sample set, the target sample can be moved to the first sample set to obtain the first sample set and the second sample set used in the next round of training.
本申请实施例的图像分类模型的训练方法,通过获取本轮训练采用的第一样本集合和第二样本集合,采用第一样本集合中的训练样本,对图像分类模型进行训练,采用第二样本集合中的训练样本,对经过训练的图像分类模型进行测试,得到第二样本集合中各训练样本的预测标签和对应的置信度,将预测标签与标注标签匹配,且置信度大于阈值置信度的训练样本作为目标样本,将目标样本移动至第一样本集合中,以得到下一轮训练所采用的第一样本集合和第二样本集合。由此,实现了自动迭代以清理无用的训练样本,以采用置信度高的训练样本对图像分类模型进行训练,有利于提高图像分类模型的精确度。The training method of the image classification model of the embodiment of the present application obtains the first sample set and the second sample set used in the current round of training, uses the training samples in the first sample set to train the image classification model, uses the training samples in the second sample set to test the trained image classification model, obtains the predicted label and corresponding confidence of each training sample in the second sample set, matches the predicted label with the annotated label, and uses the training sample with confidence greater than the threshold confidence as the target sample, and moves the target sample to the first sample set to obtain the first sample set and the second sample set used in the next round of training. In this way, automatic iteration is achieved to clean up useless training samples, and the image classification model is trained using training samples with high confidence, which is conducive to improving the accuracy of the image classification model.
在一种可能的情况下,在上述步骤503中,采用第二样本集合中的训练样本,对经过训练的图像分类模型进行测试时,可能存在预测标签与标注标签不匹配,且置信度大于阈值置信度的训练样本,为了避免将高置信度的正确样本未移动至第一样本集合,可以对预测标签与标注标签不匹配,且置信度大于阈值置信度的训练样本进行人工复核。下面结合图6进行详细介绍,图6为本申请实施例提供的另一种图像分类模型的训练方法的流程示意图。In one possible case, in the above step 503, when the trained image classification model is tested using the training samples in the second sample set, there may be training samples whose predicted labels do not match the annotated labels and whose confidence is greater than the threshold confidence. In order to avoid the correct samples with high confidence not being moved to the first sample set, the training samples whose predicted labels do not match the annotated labels and whose confidence is greater than the threshold confidence may be manually reviewed. This is described in detail below in conjunction with FIG6 , which is a flow chart of another training method for an image classification model provided in an embodiment of the present application.
如图6所示,该图像分类模型的训练方法,还可以包括以下步骤:As shown in FIG6 , the training method of the image classification model may further include the following steps:
步骤601,发送提示信息。Step 601, sending a prompt message.
其中,提示信息,用于对第二样本集合中,预测标签与标注标签不匹配,且置信度大于阈值置信度的训练样本提示进行人工复核。人工复核,是指用户人工对训练样本的预测标签与标注标签进行复核,以确定预测标签与标注标签是否匹配。The prompt information is used to prompt manual review of the training samples in the second sample set whose predicted labels do not match the annotated labels and whose confidence is greater than the threshold confidence. Manual review refers to the user manually reviewing the predicted labels and annotated labels of the training samples to determine whether the predicted labels match the annotated labels.
本申请实施例中,采用第二样本集合中的训练样本,对经过训练的图像分类模型进行测试后,确定存在预测标签与标注标签不匹配,且置信度大于阈值置信度的训练样本,可以发送提示信息,以提示对预测标签与标注标签不匹配,且置信度大于阈值置信度的训练样本进行人工复核。In an embodiment of the present application, after testing the trained image classification model using training samples in the second sample set, it is determined that there are training samples whose predicted labels do not match the annotated labels and whose confidence is greater than a threshold confidence level, and a prompt message can be sent to prompt manual review of the training samples whose predicted labels do not match the annotated labels and whose confidence is greater than the threshold confidence level.
步骤602,响应于用户复核操作,将经过复核的训练样本作为目标样本移动至第一样本集合中。Step 602: In response to a user review operation, the reviewed training samples are moved as target samples to the first sample set.
在一种可能的情况下,用户对预测标签与标注标签不匹配,且置信度大于阈值置信度的训练样本进行复核后,确定训练样本的预测标签与标注标签不匹配,可以该训练样本未通过人工复核。In one possible case, after the user reviews the training sample whose predicted label does not match the labeled label and whose confidence is greater than a threshold confidence, it is determined that the predicted label of the training sample does not match the labeled label, and the training sample may fail the manual review.
在另一种可能的情况下,用户对预测标签与标注标签不匹配,且置信度大于阈值置信度的训练样本进行复核后,确定训练样本的预测标签与标注标签匹配,可以将经过复核的训练样本作为目标样本移动至第一样本集合中。In another possible case, after the user reviews the training samples whose predicted labels do not match the annotated labels and whose confidence is greater than the threshold confidence, it is determined that the predicted labels of the training samples match the annotated labels, and the reviewed training samples can be moved as target samples to the first sample set.
由此,通过对第二样本集合中,预测标签与标注标签不匹配,且置信度大于阈值置信度的训练样本进行人工复核,将经过复核的训练样本作为目标样本移动至第一样本集合中,以避免筛选掉第二样本集合中高置信度的正确样本。Therefore, by manually reviewing the training samples in the second sample set whose predicted labels do not match the marked labels and whose confidence is greater than the threshold confidence, the reviewed training samples are moved to the first sample set as target samples to avoid screening out the correct samples with high confidence in the second sample set.
本申请实施例中,可以将预先整理得到的训练样本输入图像分类模型,以得到各训练样本的预测标签,以根据预测标签和标注标签,生成目标矩阵,选择预测标签与标注标签不匹配的训练样本作为用于对图像分类模型进行预测的样本,以对各训练样本进行筛选。下面结合图7进行详细介绍,图7为本申请实施例提供的又一种图像分类模型的训练方法的流程示意图。In the embodiment of the present application, the pre-sorted training samples can be input into the image classification model to obtain the predicted labels of each training sample, and the target matrix can be generated according to the predicted labels and the labeled labels, and the training samples whose predicted labels do not match the labeled labels can be selected as the samples for predicting the image classification model, so as to screen each training sample. The following is a detailed introduction in conjunction with Figure 7, which is a flow chart of another image classification model training method provided in the embodiment of the present application.
如图7所示,该图像分类模型的训练方法,可以包括以下步骤:As shown in FIG. 7 , the training method of the image classification model may include the following steps:
步骤701,将多个候选样本输入图像分类模型,以得到各候选样本的预测标签。Step 701: input multiple candidate samples into an image classification model to obtain a predicted label for each candidate sample.
其中,候选样本,可以为执法人员采用成像设备采集得到的图像,也可以是通过设置的街道的摄像头采集得到的图像,也可以是从服务器获取到的图像,等等,在此不做限定。并且,各候选样本中已经标注了异常标签。The candidate samples may be images collected by law enforcement personnel using imaging equipment, images collected by cameras installed on the street, images obtained from a server, etc., and are not limited here. In addition, each candidate sample has been marked with an abnormal label.
本申请实施例中,获取到多个候选样本后,可以将多个候选样本输入图像分类模型,以根据图像分类模型的输出确定各候选样本的预测标签。In an embodiment of the present application, after obtaining multiple candidate samples, the multiple candidate samples can be input into an image classification model to determine a predicted label for each candidate sample based on an output of the image classification model.
步骤702,根据多个候选样本的预测标签和标注标签,生成目标矩阵。Step 702: Generate a target matrix based on the predicted labels and labeled labels of multiple candidate samples.
其中,目标矩阵中的元素表征符合行对应的标注标签,且符合列对应的预测标签的候选样本。Among them, the elements in the target matrix represent candidate samples that meet the annotation labels corresponding to the rows and the predicted labels corresponding to the columns.
可以理解为,采用图像分类模型对多个候选样本进行分类处理,确定各候选样本的预测标签后,可以根据各个候选样本的预测标签和标注标签,生成目标矩阵。It can be understood that after the image classification model is used to classify multiple candidate samples and the predicted labels of each candidate sample are determined, a target matrix can be generated according to the predicted labels and annotation labels of each candidate sample.
作为一种示例,目标矩阵的行对应标注标签,列对应预测标签,假设目标矩阵中第一行第一列对应的候选样本的标注标签与预测标签不匹配,则目标矩阵的第一行第一列的元素为0。目标矩阵中第二行第一列对应的候选样本的标注标签与预测标签相同,则目标矩阵的第二行第一列的元素为1。As an example, the rows of the target matrix correspond to the annotation labels, and the columns correspond to the predicted labels. Assuming that the annotation labels of the candidate samples corresponding to the first row and first column in the target matrix do not match the predicted labels, the elements of the first row and first column of the target matrix are 0. If the annotation labels of the candidate samples corresponding to the second row and first column in the target matrix are the same as the predicted labels, the elements of the second row and first column of the target matrix are 1.
步骤703,从目标矩阵中,获取目标元素。Step 703, obtaining the target element from the target matrix.
其中,目标元素为行对应的标注标签与列对应的预测标签不匹配的元素。Among them, the target element is the element whose annotation label corresponding to the row does not match the predicted label corresponding to the column.
本申请实施例中,根据多个候选样本的预测标签和标注标签,生成目标矩阵后,可以从目标矩阵中获取行对应的标注标签与列对应的预测标签不匹配的元素,以作为目标元素。In an embodiment of the present application, after generating a target matrix based on predicted labels and labeled labels of multiple candidate samples, elements whose labeled labels corresponding to rows do not match predicted labels corresponding to columns can be obtained from the target matrix as target elements.
可以理解为,目标矩阵中行对应的标注类别与列对应的预测类别不匹配的元素表征的候选样本,可能为置信度较低的训练样本。It can be understood that candidate samples represented by elements in the target matrix whose labeled categories corresponding to the rows do not match the predicted categories corresponding to the columns may be training samples with low confidence.
步骤704,根据目标元素表征的候选样本,生成首轮训练采用的第二样本集合。Step 704: Generate a second sample set used in the first round of training based on the candidate samples represented by the target element.
本申请实施例中,从目标矩阵中,获取行对应的标注标签与列对应的预测标签不匹配的目标元素后,可以根据目标元素表征的候选样本,生成首轮训练采用的第二样本集合,以用于对经过训练的图像分类模型进行测试。In an embodiment of the present application, after obtaining the target elements whose labeled labels corresponding to the rows do not match the predicted labels corresponding to the columns from the target matrix, a second sample set used in the first round of training can be generated based on the candidate samples represented by the target elements for testing the trained image classification model.
本申请实施例的图像分类模型的训练方法,将多个候选样本输入图像分类模型,以得到各候选样本的预测标签,根据多个候选样本的预测标签和标注标签,生成目标矩阵,从目标矩阵中,获取目标元素,以根据目标元素表征的候选样本,生成首轮训练采用的第二样本集合。由此,通过将预测标签和标注标签不匹配的候选样本作为当前需要筛选掉的训练样本,以减少人工复核的工作量。The training method of the image classification model of the embodiment of the present application inputs multiple candidate samples into the image classification model to obtain the predicted label of each candidate sample, generates a target matrix based on the predicted labels and labeled labels of the multiple candidate samples, obtains the target element from the target matrix, and generates a second sample set used in the first round of training based on the candidate samples represented by the target element. Thus, the candidate samples whose predicted labels and labeled labels do not match are used as the training samples that need to be screened out at present, so as to reduce the workload of manual review.
作为一种示例,如图8所示,假设样本集合A和样本集合B为初始样本,可以将样本集合A和样本集合B输入图像分类模型,以得到各训练样本的预测标签,根据各训练样本的预测标签和标注标签生成目标矩阵,从目标矩阵中,获取行对应的标注标签与列对应的预测标签不匹配目标元素,生成首轮训练图像分类模型采用的第二样本集合。As an example, as shown in Figure 8, assuming that sample set A and sample set B are initial samples, sample set A and sample set B can be input into the image classification model to obtain the predicted labels of each training sample, and a target matrix is generated according to the predicted labels and annotation labels of each training sample. From the target matrix, the target elements whose annotation labels corresponding to the rows and the predicted labels corresponding to the columns do not match are obtained to generate the second sample set used by the first round of training image classification model.
采用第一样本集合对图像分类模型进行训练,采用第二样本集合中的训练样本,对经过训练的图像分类模型进行测试,得到第二样本集合中各训练样本的预测标签和对应的置信度,将预测标签与标注标签匹配,且置信度大于阈值置信度的训练样本移动至第一样本集合中,以得到下一轮训练所采用的第一样本集合和第二样本集合。The image classification model is trained using the first sample set, and the training samples in the second sample set are used to test the trained image classification model to obtain the predicted labels and corresponding confidence levels of each training sample in the second sample set. The predicted labels are matched with the labeled labels, and the training samples whose confidence levels are greater than the threshold confidence level are moved to the first sample set to obtain the first sample set and the second sample set used for the next round of training.
本申请实施例中,对图像分类模型训练结束后,可以对模型进行评估,评估结果稳定,可以采用经过训练的图像分类模型对图像进行识别。In the embodiment of the present application, after the training of the image classification model is completed, the model can be evaluated. If the evaluation result is stable, the trained image classification model can be used to recognize the image.
为了实现上述实施例,本申请提出了一种图像识别装置。In order to implement the above embodiments, the present application proposes an image recognition device.
图9为本申请实施例提供的一种图像识别装置的结构示意图。FIG. 9 is a schematic diagram of the structure of an image recognition device provided in an embodiment of the present application.
如图9所示,该图像识别装置900,可以包括:获取模块910、输入模块920、第一确定模块930以及第二确定模块940。As shown in FIG. 9 , the image recognition device 900 may include: an acquisition module 910 , an input module 920 , a first determination module 930 , and a second determination module 940 .
其中,获取模块910,用于获取经过训练的图像分类模型,以及获取采集到的输入图像。The acquisition module 910 is used to acquire a trained image classification model and acquire a collected input image.
输入模块920,用于采用图像分类模型对输入图像进行分类处理,以从至少一个异常标签和各异常标签关联的背景标签中,确定输入图像的标签。The input module 920 is used to classify the input image using an image classification model to determine the label of the input image from at least one abnormal label and background labels associated with each abnormal label.
第一确定模块930,用于在输入图像的标签为异常标签的情况下,确定输入图像展示有异常标签指示的异常行为。The first determination module 930 is configured to determine, when the label of the input image is an abnormal label, that the input image exhibits an abnormal behavior indicated by the abnormal label.
第二确定模块940,用于在输入图像的标签为背景标签的情况下,确定输入图像中展示有背景标签指示的背景,且未具有背景标签所关联的异常标签所指示的异常行为。The second determination module 940 is used to determine, when the label of the input image is a background label, that the input image shows a background indicated by the background label and does not have an abnormal behavior indicated by an abnormal label associated with the background label.
作为一种可能的情况,该图像识别装置900,还可以包括:As a possible scenario, the image recognition device 900 may further include:
查询模块,用于查询输入图像之前所拍摄的历史图像中展示的历史异常行为;A query module, used to query historical abnormal behaviors displayed in historical images taken before the input image;
识别模块,用于在历史异常行为所属的异常标签,与输入图像的标签不匹配的情况下,采用属性识别模型对输入图像进行属性识别,以得到至少一个属性的属性值,其中,属性用于指示异常行为,属性值用于指示存在异常行为的概率;A recognition module, configured to use an attribute recognition model to perform attribute recognition on the input image when the abnormal label to which the historical abnormal behavior belongs does not match the label of the input image, so as to obtain an attribute value of at least one attribute, wherein the attribute is used to indicate the abnormal behavior, and the attribute value is used to indicate the probability of the existence of the abnormal behavior;
第三确定模块,用于从至少一个属性的属性值中,确定指示历史异常行为的目标属性的属性值;A third determination module, configured to determine an attribute value of a target attribute indicating historical abnormal behavior from the attribute value of at least one attribute;
处理模块,用于在目标属性的属性值小于或等于概率阈值的情况下,执行历史异常行为的核销流程。The processing module is used to execute the cancellation process of historical abnormal behavior when the attribute value of the target attribute is less than or equal to the probability threshold.
作为另一种可能的情况,该图像识别装置900,还可以包括:As another possible situation, the image recognition device 900 may further include:
第一发出模块,用于在历史异常行为所属的异常标签,与输入图像的标签匹配的情况下,发出继续采集图像的指示信息。The first sending module is used to send instruction information for continuing to collect images when the abnormal label to which the historical abnormal behavior belongs matches the label of the input image.
作为另一种可能的情况,该图像识别装置900,还可以包括:As another possible situation, the image recognition device 900 may further include:
第二发出模块,用于在目标属性的属性值大于概率阈值的情况下,发出继续采集图像的指示信息。The second sending module is used to send instruction information to continue collecting images when the attribute value of the target attribute is greater than the probability threshold.
需要说明的是,前述对图像识别方法实施例的解释说明也适用于该图像识别装置,此处不再赘述。It should be noted that the above explanations and descriptions of the embodiment of the image recognition method are also applicable to the image recognition device and will not be repeated here.
本申请实施例的图像识别装置,采用经过训练的图像分类模型对采集到的输入图像进行分类处理,以从至少一个异常标签和各异常标签关联的背景标签中,确定输入图像的标签;在输入图像的标签为异常标签的情况下,确定输入图像展示有异常标签指示的异常行为;在输入图像的标签为背景标签的情况下,确定输入图像中展示有背景标签指示的背景,且未具有背景标签所关联的异常标签所指示的异常行为。由此,通过图像分类模型确定输入图像的标签后,根据输入图像中展示的内容,确定输入图像中是否存在异常行为,有效地解决了相关技术中城管违章案件处理过程中需要人工审核,存在审核成本大、周期长等技术问题,极大的减少了案件审核人员的工作量,显著优化了处理效率。The image recognition device of the embodiment of the present application uses a trained image classification model to classify the collected input image to determine the label of the input image from at least one abnormal label and the background labels associated with each abnormal label; when the label of the input image is an abnormal label, it is determined that the input image shows abnormal behavior indicated by the abnormal label; when the label of the input image is a background label, it is determined that the input image shows the background indicated by the background label, and does not have abnormal behavior indicated by the abnormal label associated with the background label. Therefore, after determining the label of the input image through the image classification model, it is determined whether there is abnormal behavior in the input image based on the content displayed in the input image, which effectively solves the technical problems of the need for manual review in the process of handling urban management violation cases in the related technology, and there are high review costs and long cycles, etc., which greatly reduces the workload of case reviewers and significantly optimizes processing efficiency.
为了实现上述实施例,本申请提出了一种图像分类模型的训练装置。In order to implement the above embodiment, the present application proposes a training device for an image classification model.
图10为本申请实施例提供的一种图像分类模型的训练装置的结构示意图。FIG10 is a schematic diagram of the structure of a training device for an image classification model provided in an embodiment of the present application.
其中,图像分类模型用于执行上述实施例中所述的图像识别方法。Among them, the image classification model is used to execute the image recognition method described in the above embodiment.
如图10所示,该图像分类模型的训练装置1000,可以包括:获取模块1010、训练模块1020、测试模块1030以及第一移动模块1040。As shown in FIG. 10 , the training device 1000 for the image classification model may include: an acquisition module 1010 , a training module 1020 , a testing module 1030 and a first movement module 1040 .
其中,获取模块1010,用于获取本轮训练采用的第一样本集合和第二样本集合。The acquisition module 1010 is used to acquire the first sample set and the second sample set used in this round of training.
训练模块1020,用于采用第一样本集合中的训练样本,对图像分类模型进行训练。The training module 1020 is used to train the image classification model using the training samples in the first sample set.
测试模块1030,用于采用第二样本集合中的训练样本,对经过训练的图像分类模型进行测试,得到第二样本集合中各训练样本的预测标签和对应的置信度。The testing module 1030 is used to test the trained image classification model using the training samples in the second sample set to obtain the predicted label and the corresponding confidence of each training sample in the second sample set.
第一移动模块1040,用于将第二样本集合中的目标样本移动至第一样本集合中,以得到下一轮训练所采用的第一样本集合和第二样本集合;其中,目标样本,包括预测标签与标注标签匹配,且置信度大于阈值置信度的训练样本。The first moving module 1040 is used to move the target sample in the second sample set to the first sample set to obtain the first sample set and the second sample set used for the next round of training; wherein the target sample includes a training sample whose predicted label matches the marked label and whose confidence is greater than a threshold confidence.
作为一种可能的情况,本轮训练采用的阈值置信度大于下一轮训练采用的阈值置信度。As a possible situation, the threshold confidence adopted in this round of training is greater than the threshold confidence adopted in the next round of training.
作为另一种可能的情况,该图像分类模型的训练装置1000,还可以包括:As another possible situation, the image classification model training device 1000 may further include:
发送模块,用于发送提示信息,其中,所述提示信息,用于对所述第二样本集合中,所述预测标签与标注标签不匹配,且置信度大于阈值置信度的训练样本提示进行人工复核;A sending module, used for sending prompt information, wherein the prompt information is used for prompting manual review of the training samples in the second sample set, in which the predicted label does not match the marked label and the confidence is greater than a threshold confidence;
第二移动模块,用于响应于用户复核操作,将经过复核的训练样本作为所述目标样本移动至所述第一样本集合中。The second moving module is used to move the reviewed training samples as the target samples to the first sample set in response to the user's review operation.
作为另一种可能的情况,该图像分类模型的训练装置1000,还可以包括:As another possible situation, the image classification model training device 1000 may further include:
输入模块,用于将多个候选样本输入所述图像分类模型,以得到各所述候选样本的预测标签;An input module, used to input multiple candidate samples into the image classification model to obtain a predicted label of each candidate sample;
第一生成模块,用于根据多个所述候选样本的预测标签和标注标签,生成目标矩阵;其中,所述目标矩阵中的元素表征符合行对应的标注标签,且符合列对应的预测标签的候选样本;A first generating module is used to generate a target matrix according to the predicted labels and labeled labels of the plurality of candidate samples; wherein the elements in the target matrix represent candidate samples that meet the labeled labels corresponding to the rows and meet the predicted labels corresponding to the columns;
获取模块,用于从所述目标矩阵中,获取目标元素,其中,所述目标元素为行对应的标注标签与列对应的预测标签不匹配的元素;An acquisition module, used to acquire a target element from the target matrix, wherein the target element is an element whose labeled label corresponding to a row does not match the predicted label corresponding to a column;
第二生成模块,用于根据所述目标元素表征的候选样本,生成首轮训练采用的所述第二样本集合。The second generating module is used to generate the second sample set used in the first round of training according to the candidate samples represented by the target element.
需要说明的是,前述对图像分类模型的训练方法实施例的解释说明也适用于该图像分类模型的训练装置,此处不再赘述。It should be noted that the above explanation of the embodiment of the training method for the image classification model is also applicable to the training device for the image classification model, and will not be repeated here.
本申请实施例的图像分类模型的训练装置,通过获取本轮训练采用的第一样本集合和第二样本集合,采用第一样本集合中的训练样本,对图像分类模型进行训练,采用第二样本集合中的训练样本,对经过训练的图像分类模型进行测试,得到第二样本集合中各训练样本的预测标签和对应的置信度,将预测标签与标注标签匹配,且置信度大于阈值置信度的训练样本作为目标样本,将目标样本移动至第一样本集合中,以得到下一轮训练所采用的第一样本集合和第二样本集合。由此,实现了自动迭代以清理无用的训练样本,以采用置信度高的训练样本对图像分类模型进行训练,有利于提高图像分类模型的精确度。The training device of the image classification model of the embodiment of the present application obtains the first sample set and the second sample set used in the current round of training, uses the training samples in the first sample set to train the image classification model, uses the training samples in the second sample set to test the trained image classification model, obtains the predicted label and corresponding confidence of each training sample in the second sample set, matches the predicted label with the annotated label, and uses the training sample with confidence greater than the threshold confidence as the target sample, and moves the target sample to the first sample set to obtain the first sample set and the second sample set used in the next round of training. In this way, automatic iteration is achieved to clean up useless training samples, and the image classification model is trained using training samples with high confidence, which is conducive to improving the accuracy of the image classification model.
为了实现上述实施例,本申请提出了一种电子设备,包括:In order to implement the above embodiment, the present application proposes an electronic device, including:
至少一个处理器;以及at least one processor; and
与所述至少一个处理器通信连接的存储器;其中,a memory communicatively connected to the at least one processor; wherein,
所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行上述实施例中所述的图像识别方法,或者,执行上述实施例中所述的模型的训练方法。The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the image recognition method described in the above embodiment, or execute the model training method described in the above embodiment.
为了实现上述实施例,本申请提出了一种存储有计算机指令的非瞬时计算机可读存储介质,其中,所述计算机指令用于使所述计算机执行上述实施例中所述的图像识别方法,或者,执行上述实施例中所述的模型的训练方法。In order to implement the above embodiments, the present application proposes a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute the image recognition method described in the above embodiments, or to execute the model training method described in the above embodiments.
为了实现上述实施例,本申请提出了一种计算机程序产品,包括计算机程序,所述计算机程序在被处理器执行时实现上述实施例中所述的图像识别方法,或者,执行上述实施例中所述的模型的训练方法。In order to implement the above embodiments, the present application proposes a computer program product, including a computer program, which, when executed by a processor, implements the image recognition method described in the above embodiments, or executes the model training method described in the above embodiments.
根据本申请的实施例,本申请还提供了一种电子设备、一种可读存储介质和一种计算机程序产品。According to an embodiment of the present application, the present application also provides an electronic device, a readable storage medium and a computer program product.
图11示出了可以用来实施本申请的实施例的示例电子设备1100的示意性框图。电子设备旨在表示各种形式的数字计算机,诸如,膝上型计算机、台式计算机、工作台、个人数字助理、服务器、刀片式服务器、大型计算机、和其它适合的计算机。电子设备还可以表示各种形式的移动装置,诸如,个人数字处理、蜂窝电话、智能电话、可穿戴设备和其它类似的计算装置。本文所示的部件、它们的连接和关系、以及它们的功能仅仅作为示例,并且不意在限制本文中描述的和/或者要求的本申请的实现。Figure 11 shows a schematic block diagram of an example electronic device 1100 that can be used to implement an embodiment of the present application. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and/or required herein.
如图11所示,设备1100包括计算单元1101,其可以根据存储在ROM(Read-OnlyMemory,只读存储器)1102中的计算机程序或者从存储单元1108加载到RAM(Random AccessMemory,随机访问/存取存储器)1103中的计算机程序,来执行各种适当的动作和处理。在RAM1103中,还可存储设备1100操作所需的各种程序和数据。计算单元1101、ROM1102以及RAM1103通过总线1104彼此相连。I/O(Input/Output,输入/输出)接口1105也连接至总线1104。As shown in FIG. 11 , the device 1100 includes a computing unit 1101, which can perform various appropriate actions and processes according to a computer program stored in a ROM (Read-Only Memory) 1102 or a computer program loaded from a storage unit 1108 to a RAM (Random Access Memory) 1103. In the RAM 1103, various programs and data required for the operation of the device 1100 can also be stored. The computing unit 1101, the ROM 1102, and the RAM 1103 are connected to each other via a bus 1104. An I/O (Input/Output) interface 1105 is also connected to the bus 1104.
设备1100中的多个部件连接至I/O接口1105,包括:输入单元1106,例如键盘、鼠标等;输出单元1107,例如各种类型的显示器、扬声器等;存储单元1108,例如磁盘、光盘等;以及通信单元1109,例如网卡、调制解调器、无线通信收发机等。通信单元1109允许设备1100通过诸如因特网的计算机网络和/或各种电信网络与其他设备交换信息/数据。A number of components in the device 1100 are connected to the I/O interface 1105, including: an input unit 1106, such as a keyboard, a mouse, etc.; an output unit 1107, such as various types of displays, speakers, etc.; a storage unit 1108, such as a disk, an optical disk, etc.; and a communication unit 1109, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 1109 allows the device 1100 to exchange information/data with other devices through a computer network such as the Internet and/or various telecommunication networks.
计算单元1101可以是各种具有处理和计算能力的通用和/或专用处理组件。计算单元1101的一些示例包括但不限于CPU(Central Processing Unit,中央处理单元)、GPU(Graphic Processing Units,图形处理单元)、各种专用的AI(Artificial Intelligence,人工智能)计算芯片、各种运行机器学习模型算法的计算单元、DSP(Digital SignalProcessor,数字信号处理器)、以及任何适当的处理器、控制器、微控制器等。计算单元1101执行上文所描述的各个方法和处理,例如图像识别方法,或者模型的训练方法。例如,在一些实施例中,图像识别方法,或者模型的训练方法可被实现为计算机软件程序,其被有形地包含于机器可读介质,例如存储单元1108。在一些实施例中,计算机程序的部分或者全部可以经由ROM1102和/或通信单元1109而被载入和/或安装到设备1100上。当计算机程序加载到RAM1103并由计算单元1101执行时,可以执行上文描述的方法的一个或多个步骤。备选地,在其他实施例中,计算单元1101可以通过其他任何适当的方式(例如,借助于固件)而被配置为执行图像识别方法,或者图像分类模型的训练方法。The computing unit 1101 may be a variety of general and/or special processing components with processing and computing capabilities. Some examples of the computing unit 1101 include, but are not limited to, a CPU (Central Processing Unit), a GPU (Graphic Processing Units), various dedicated AI (Artificial Intelligence) computing chips, various computing units running machine learning model algorithms, a DSP (Digital Signal Processor), and any appropriate processor, controller, microcontroller, etc. The computing unit 1101 performs the various methods and processes described above, such as an image recognition method, or a model training method. For example, in some embodiments, the image recognition method, or the model training method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 1108. In some embodiments, part or all of the computer program may be loaded and/or installed on the device 1100 via the ROM 1102 and/or the communication unit 1109. When the computer program is loaded into the RAM 1103 and executed by the computing unit 1101, one or more steps of the method described above may be performed. Alternatively, in other embodiments, the computing unit 1101 may be configured to execute an image recognition method, or a training method for an image classification model, in any other appropriate manner (eg, by means of firmware).
本文中以上描述的系统和技术的各种实施方式可以在数字电子电路系统、集成电路系统、FPGA(Field Programmable Gate Array,现场可编程门阵列)、ASIC(Application-Specific Integrated Circuit,专用集成电路)、ASSP(Application Specific StandardProduct,专用标准产品)、SOC(System On Chip,芯片上系统的系统)、CPLD(ComplexProgrammable Logic Device,复杂可编程逻辑设备)、计算机硬件、固件、软件、和/或它们的组合中实现。这些各种实施方式可以包括:实施在一个或者多个计算机程序中,该一个或者多个计算机程序可在包括至少一个可编程处理器的可编程系统上执行和/或解释,该可编程处理器可以是专用或者通用可编程处理器,可以从存储系统、至少一个输入装置、和至少一个输出装置接收数据和指令,并且将数据和指令传输至该存储系统、该至少一个输入装置、和该至少一个输出装置。Various embodiments of the systems and techniques described above herein may be implemented in digital electronic circuit systems, integrated circuit systems, FPGAs (Field Programmable Gate Arrays), ASICs (Application-Specific Integrated Circuits), ASSPs (Application Specific Standard Products), SOCs (System On Chips), CPLDs (Complex Programmable Logic Devices), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: being implemented in one or more computer programs that may be executed and/or interpreted on a programmable system including at least one programmable processor that may be a dedicated or general-purpose programmable processor that may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
用于实施本申请的方法的程序代码可以采用一个或多个编程语言的任何组合来编写。这些程序代码可以提供给通用计算机、专用计算机或其他可编程数据处理装置的处理器或控制器,使得程序代码当由处理器或控制器执行时使流程图和/或框图中所规定的功能/操作被实施。程序代码可以完全在机器上执行、部分地在机器上执行,作为独立软件包部分地在机器上执行且部分地在远程机器上执行或完全在远程机器或服务器上执行。The program code for implementing the method of the present application can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, implements the functions/operations specified in the flow chart and/or block diagram. The program code can be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
在本申请的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、RAM、ROM、EPROM(Electrically Programmable Read-Only-Memory,可擦除可编程只读存储器)或快闪存储器、光纤、CD-ROM(Compact Disc Read-Only Memory,便捷式紧凑盘只读存储器)、光学储存设备、磁储存设备、或上述内容的任何合适组合。In the context of the present application, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include electrical connections based on one or more lines, portable computer disks, hard disks, RAM, ROM, EPROM (Electrically Programmable Read-Only-Memory) or flash memory, optical fiber, CD-ROM (Compact Disc Read-Only Memory), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
为了提供与用户的交互,可以在计算机上实施此处描述的系统和技术,该计算机具有:用于向用户显示信息的显示装置(例如,CRT(Cathode-Ray Tube,阴极射线管)或者LCD(Liquid Crystal Display,液晶显示器)监视器);以及键盘和指向装置(例如,鼠标或者轨迹球),用户可以通过该键盘和该指向装置来将输入提供给计算机。其它种类的装置还可以用于提供与用户的交互;例如,提供给用户的反馈可以是任何形式的传感反馈(例如,视觉反馈、听觉反馈、或者触觉反馈);并且可以用任何形式(包括声输入、语音输入或者、触觉输入)来接收来自用户的输入。To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (Cathode-Ray Tube) or LCD (Liquid Crystal Display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
可以将此处描述的系统和技术实施在包括后台部件的计算系统(例如,作为数据服务器)、或者包括中间件部件的计算系统(例如,应用服务器)、或者包括前端部件的计算系统(例如,具有图形用户界面或者网络浏览器的用户计算机,用户可以通过该图形用户界面或者该网络浏览器来与此处描述的系统和技术的实施方式交互)、或者包括这种后台部件、中间件部件、或者前端部件的任何组合的计算系统中。可以通过任何形式或者介质的数字数据通信(例如,通信网络)来将系统的部件相互连接。通信网络的示例包括:LAN(LocalArea Network,局域网)、WAN(Wide Area Network,广域网)、互联网和区块链网络。The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: LAN (Local Area Network), WAN (Wide Area Network), the Internet, and blockchain networks.
计算机系统可以包括客户端和服务器。客户端和服务器一般远离彼此并且通常通过通信网络进行交互。通过在相应的计算机上运行并且彼此具有客户端-服务器关系的计算机程序来产生客户端和服务器的关系。服务器可以是云服务器,又称为云计算服务器或云主机,是云计算服务体系中的一项主机产品,以解决了传统物理主机与VPS服务("Virtual Private Server",或简称"VPS")中,存在的管理难度大,业务扩展性弱的缺陷。服务器也可以为分布式系统的服务器,或者是结合了区块链的服务器。A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.
其中,需要说明的是,人工智能是研究使计算机来模拟人的某些思维过程和智能行为(如学习、推理、思考、规划等)的学科,既有硬件层面的技术也有软件层面的技术。人工智能硬件技术一般包括如传感器、专用人工智能芯片、云计算、分布式存储、大数据处理等技术;人工智能软件技术主要包括计算机视觉技术、语音识别技术、自然语言处理技术以及机器学习/深度学习、大数据处理技术、知识图谱技术等几大方向。It should be noted that artificial intelligence is a discipline that studies how computers can simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.), and includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, as well as machine learning/deep learning, big data processing technology, knowledge graph technology, and other major directions.
应该理解,可以使用上面所示的各种形式的流程,重新排序、增加或删除步骤。例如,本发公开中记载的各步骤可以并行地执行也可以顺序地执行也可以不同的次序执行,只要能够实现本申请公开的技术方案所期望的结果,本文在此不进行限制。It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution disclosed in this application can be achieved, and this document is not limited here.
上述具体实施方式,并不构成对本申请保护范围的限制。本领域技术人员应该明白的是,根据设计要求和其他因素,可以进行各种修改、组合、子组合和替代。任何在本申请的精神和原则之内所作的修改、等同替换和改进等,均应包含在本申请保护范围之内。The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.
Claims (18)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202011598490.1A CN112613569B (en) | 2020-12-29 | 2020-12-29 | Image recognition method, image classification model training method and device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202011598490.1A CN112613569B (en) | 2020-12-29 | 2020-12-29 | Image recognition method, image classification model training method and device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN112613569A CN112613569A (en) | 2021-04-06 |
| CN112613569B true CN112613569B (en) | 2024-04-09 |
Family
ID=75249101
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202011598490.1A Active CN112613569B (en) | 2020-12-29 | 2020-12-29 | Image recognition method, image classification model training method and device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN112613569B (en) |
Families Citing this family (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113360693B (en) * | 2021-05-31 | 2024-08-09 | 北京百度网讯科技有限公司 | Method and device for determining image tag, electronic equipment and storage medium |
| CN113344064A (en) * | 2021-05-31 | 2021-09-03 | 北京百度网讯科技有限公司 | Event processing method and device |
| CN113554062B (en) * | 2021-06-25 | 2023-08-01 | 北京百度网讯科技有限公司 | Training method, device and storage medium for multi-classification model |
| CN116229175B (en) * | 2022-03-18 | 2023-12-26 | 北京百度网讯科技有限公司 | Image processing method, device, equipment and storage medium |
| CN115019218B (en) * | 2022-08-08 | 2022-11-15 | 阿里巴巴(中国)有限公司 | Image processing method and processor |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109829629A (en) * | 2019-01-07 | 2019-05-31 | 平安科技(深圳)有限公司 | Generation method, device, computer equipment and the storage medium of risk analysis reports |
| CN110097451A (en) * | 2019-04-01 | 2019-08-06 | 中国银联股份有限公司 | A kind of monitoring method and device of banking |
| CN110874646A (en) * | 2020-01-16 | 2020-03-10 | 支付宝(杭州)信息技术有限公司 | An exception handling method, device and electronic device for federated learning |
| CN111553355A (en) * | 2020-05-18 | 2020-08-18 | 城云科技(中国)有限公司 | Method for detecting and informing management of store owners based on surveillance video |
| CN112036509A (en) * | 2020-09-30 | 2020-12-04 | 北京百度网讯科技有限公司 | Method and apparatus for training image recognition models |
Family Cites Families (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7412629B2 (en) * | 2005-06-09 | 2008-08-12 | International Business Machines Corporation | Method to override daughterboard slots marked with power fault |
| US7949716B2 (en) * | 2007-01-24 | 2011-05-24 | Mcafee, Inc. | Correlation and analysis of entity attributes |
| US8763114B2 (en) * | 2007-01-24 | 2014-06-24 | Mcafee, Inc. | Detecting image spam |
| US20090138332A1 (en) * | 2007-11-23 | 2009-05-28 | Dimitri Kanevsky | System and method for dynamically adapting a user slide show presentation to audience behavior |
| US11282198B2 (en) * | 2018-11-21 | 2022-03-22 | Enlitic, Inc. | Heat map generating system and methods for use therewith |
-
2020
- 2020-12-29 CN CN202011598490.1A patent/CN112613569B/en active Active
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109829629A (en) * | 2019-01-07 | 2019-05-31 | 平安科技(深圳)有限公司 | Generation method, device, computer equipment and the storage medium of risk analysis reports |
| CN110097451A (en) * | 2019-04-01 | 2019-08-06 | 中国银联股份有限公司 | A kind of monitoring method and device of banking |
| CN110874646A (en) * | 2020-01-16 | 2020-03-10 | 支付宝(杭州)信息技术有限公司 | An exception handling method, device and electronic device for federated learning |
| CN111553355A (en) * | 2020-05-18 | 2020-08-18 | 城云科技(中国)有限公司 | Method for detecting and informing management of store owners based on surveillance video |
| CN112036509A (en) * | 2020-09-30 | 2020-12-04 | 北京百度网讯科技有限公司 | Method and apparatus for training image recognition models |
Non-Patent Citations (3)
| Title |
|---|
| Trends and Challenges in Mono and Multi Biometrics;Mohamed Deriche ET AL;《 2008 First Workshops on Image Processing Theory, Tools and Applications》;全文 * |
| 深度卷积网络及其在乳腺病理图像分析中的应用;王冠皓;《中国知网硕士雪薇论文电子期刊》;第第2016年卷卷(第第1期期);全文 * |
| 社交网络异常用户识别技术综述;仲丽君;杨文忠;袁婷婷;向进勇;;计算机工程与应用(16);全文 * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN112613569A (en) | 2021-04-06 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN112613569B (en) | Image recognition method, image classification model training method and device | |
| WO2021017679A1 (en) | Address information parsing method and apparatus, system and data acquisition method | |
| CN113361578B (en) | Training method and device for image processing model, electronic equipment and storage medium | |
| WO2021174812A1 (en) | Data cleaning method and apparatus for profile, and medium and electronic device | |
| CN112488043B (en) | Unmanned aerial vehicle target detection method based on edge intelligence | |
| WO2022105336A1 (en) | Image classification method and electronic device | |
| WO2023056723A1 (en) | Fault diagnosis method and apparatus, and electronic device and storage medium | |
| CN113051911B (en) | Methods, devices, equipment, media and program products for extracting sensitive words | |
| CN112181490B (en) | Method, device, equipment and medium for identifying function category in function point evaluation method | |
| CN111338692B (en) | Vulnerability classification method, device and electronic device based on vulnerability code | |
| CN110688536A (en) | Label prediction method, device, equipment and storage medium | |
| CN115099239B (en) | A resource identification method, device, equipment and storage medium | |
| CN117372424B (en) | A defect detection method, device, equipment and storage medium | |
| CN114692778A (en) | Multi-modal sample set generation method, training method and device for intelligent inspection | |
| CN118643470A (en) | A multi-modal large model training optimization method and device in the electric power vertical field | |
| WO2025129964A1 (en) | Image labeling method and apparatus, device, and storage medium | |
| CN111738290B (en) | Image detection method, model construction and training method, device, equipment and medium | |
| CN117094391A (en) | Causal event pair processing method, causal event pair processing device, causal event pair processing computer equipment and storage medium | |
| CN114842192B (en) | A damage identification model, damage identification method and system for aircraft engine blades | |
| CN114116688B (en) | Data processing and data quality inspection method, device and readable storage medium | |
| CN118295842A (en) | Data processing method, device and server for transaction system abnormal event | |
| CN110807082B (en) | Quality selective examination item determining method, system, electronic equipment and readable storage medium | |
| CN113706207B (en) | Order success rate analysis method, device, equipment and medium based on semantic analysis | |
| CN116340831A (en) | An information classification method, device, electronic equipment and storage medium | |
| CN116310520A (en) | Target detection method, target detection device, electronic equipment and storage medium |
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 | ||
| TR01 | Transfer of patent right |
Effective date of registration: 20250924 Address after: 315000 Zhejiang Province Ningbo City Cixi City Gutang Street KaiFa Road 1277# (Shangri-La Building) Room 2310 Patentee after: Ningbo Dijiu Intellectual Property Operation Co.,Ltd. Country or region after: China Address before: 100085 Beijing, Haidian District, No. ten on the ground floor, No. 10 Baidu building, layer 2 Patentee before: BEIJING BAIDU NETCOM SCIENCE AND TECHNOLOGY Co.,Ltd. Country or region before: China |