[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN109376786A - An image classification method, apparatus, terminal device and readable storage medium - Google Patents

An image classification method, apparatus, terminal device and readable storage medium Download PDF

Info

Publication number
CN109376786A
CN109376786A CN201811284267.2A CN201811284267A CN109376786A CN 109376786 A CN109376786 A CN 109376786A CN 201811284267 A CN201811284267 A CN 201811284267A CN 109376786 A CN109376786 A CN 109376786A
Authority
CN
China
Prior art keywords
image
activation value
class
images
sample
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.)
Pending
Application number
CN201811284267.2A
Other languages
Chinese (zh)
Inventor
乔宇
庄培钦
王亚立
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Institute of Advanced Technology of CAS
Original Assignee
Shenzhen Institute of Advanced Technology of CAS
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Institute of Advanced Technology of CAS filed Critical Shenzhen Institute of Advanced Technology of CAS
Priority to CN201811284267.2A priority Critical patent/CN109376786A/en
Publication of CN109376786A publication Critical patent/CN109376786A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • Health & Medical Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Image Analysis (AREA)

Abstract

本发明适用于图像处理技术领域,提供了图像分类方法、装置、终端设备及可读存储介质,所述方法包括:通过已知类别图像对深度卷积神经网络进行训练,获取网络训练模型;根据所述网络训练模型对所述已知类别图像中的每一类样本分别建立概率分布模型;根据所述概率分布模型修正所述已知类别图像的激活值;根据所述已知类别图像数据的激活值获取未知类别图像的激活值;根据所述已知类别图像的激活值以及所述未知类别图像的激活值,对图像进行分类。通过本发明可以对在实际应用中对已知类别图像中训练集合类别之外的图像进行合理准确的分类。

The present invention is applicable to the technical field of image processing, and provides an image classification method, device, terminal device and readable storage medium. The method includes: training a deep convolutional neural network by using images of known categories to obtain a network training model; The network training model establishes a probability distribution model for each type of sample in the known category image; corrects the activation value of the known category image according to the probability distribution model; The activation value obtains the activation value of the image of the unknown category; the images are classified according to the activation value of the image of the known category and the activation value of the image of the unknown category. The present invention can reasonably and accurately classify images out of the training set category in the known category images in practical applications.

Description

一种图像分类方法、装置、终端设备及可读存储介质An image classification method, apparatus, terminal device and readable storage medium

技术领域technical field

本发明属于图像处理技术领域,尤其涉及一种图像分类方法、装置、终端设备及可读存储介质。The invention belongs to the technical field of image processing, and in particular relates to an image classification method, device, terminal device and readable storage medium.

背景技术Background technique

图像分类可以通过计算机对图像的特征数据进行提取、处理与分析,识别出不同的目标与对象,按照不同的特性对图像进行分类。Image classification can extract, process and analyze the characteristic data of the image through the computer, identify different targets and objects, and classify the images according to different characteristics.

目前,在进行图像分类时,基于深度神经网络的算法,利用训练好的图像分类模型对已知图像数据进行分类,其中,训练好的图像分类模型是根据在相同的类别空间内的训练图像数据和测试图像数据而生成;或者根据某一类的正确分类的图像样本激活值进行对未知图像类别的判定;然而对于在已知图像类别的训练集之外的未知类别的图像则无法进行合理的分类,以及存在图像分类不准确的缺陷。At present, when performing image classification, the algorithm based on deep neural network uses a trained image classification model to classify known image data, wherein the trained image classification model is based on the training image data in the same category space. and test image data; or determine the unknown image category according to the activation value of the correctly classified image sample of a certain category; however, for the unknown category of images outside the training set of known image categories, it is impossible to make reasonable judgments. classification, as well as the defects of inaccurate image classification.

发明内容SUMMARY OF THE INVENTION

有鉴于此,本发明实施例提供了一种图像分类方法、装置、终端设备及可读存储介质,以解决现有技术中然而对于在已知图像类别的训练集之外的未知类别的图像则无法进行合理的分类,以及存在图像分类不准确的缺陷的问题。In view of this, the embodiments of the present invention provide an image classification method, apparatus, terminal device, and readable storage medium, so as to solve the problem in the prior art for images of unknown categories outside the training set of known image categories. Reasonable classification is not possible, and there is a problem of inaccurate image classification defects.

本发明实施例的第一方面提供了一种图像分类方法,包括:A first aspect of the embodiments of the present invention provides an image classification method, including:

通过已知类别图像对深度卷积神经网络进行训练,获取网络训练模型;The deep convolutional neural network is trained through the known category images to obtain the network training model;

根据所述网络训练模型对所述已知类别图像中的每一类样本分别建立概率分布模型;According to the network training model, a probability distribution model is separately established for each type of sample in the known type of image;

根据所述概率分布模型修正所述已知类别图像的激活值;Modify the activation value of the known category image according to the probability distribution model;

根据所述已知类别图像数据的激活值获取未知类别图像的激活值;Obtain the activation value of the unknown category image according to the activation value of the known category image data;

根据所述已知类别图像的激活值以及所述未知类别图像的激活值,对图像进行分类。The images are classified according to the activation values of the known class images and the activation values of the unknown class images.

在一个实施例中,通过已知类别图像对深度卷积神经网络进行训练,获取网络训练模型,包括:In one embodiment, a deep convolutional neural network is trained by using images of known categories to obtain a network training model, including:

将获取的所述已知类别图像划分为训练集与测试集;Divide the acquired images of known categories into a training set and a test set;

通过所述训练集的图像训练所述深度卷积神经网络,通过所述测试集的图像对所述深度卷积神经网络进行分类性能的测试,输出网络分类结果;The deep convolutional neural network is trained by the images of the training set, the classification performance of the deep convolutional neural network is tested by the images of the test set, and the network classification result is output;

通过损失函数对所述网络分类结果进行监督运算,获取监督运算结果;Perform a supervised operation on the network classification result through a loss function to obtain a supervised operation result;

根据所述监督运算结果调整所述深度卷积神经网络的网络参数。Adjust the network parameters of the deep convolutional neural network according to the result of the supervision operation.

在一个实施例中,根据所述网络训练模型对所述已知类别图像中的每一类样本分别建立概率分布模型,包括:In one embodiment, according to the network training model, a probability distribution model is separately established for each type of sample in the known type of image, including:

获取所述已知类别图像中每一类样本的均值向量;Obtain the mean vector of each class of samples in the known class image;

计算所述已知类别图像中每一类样本与所述均值向量之间的距离;Calculate the distance between each class of samples in the known class image and the mean vector;

根据所述距离,按预设比例从每一类样本中选取若干个输入样本;According to the distance, select a number of input samples from each type of samples according to a preset ratio;

根据所述若干个输入样本估计与输入样本类别对应的所述概率分布模型的模型参数。The model parameters of the probability distribution model corresponding to the input sample categories are estimated according to the several input samples.

在一个实施例中,根据所述概率分布模型修正所述已知类别图像的激活值,包括:In one embodiment, correcting the activation value of the known category image according to the probability distribution model includes:

通过所述网络训练模型提取所述已知类别图像中测试样本的第一激活值;Extracting the first activation value of the test sample in the known category image by using the network training model;

根据所述第一激活值,从所述测试样本中选取预设数量的样本类别;According to the first activation value, a preset number of sample categories are selected from the test samples;

根据与所述预设数量的样本类别对应的所述概率分布模型以及所述样本类别中的测试样本的第一激活值,计算所述预设数量的样本类别中的测试样本的所属概率;calculating, according to the probability distribution model corresponding to the preset number of sample categories and the first activation value of the test samples in the sample category, the probability of belonging to the test samples in the preset number of sample categories;

根据所述所属概率修正所述预设数量的样本类别中的测试样本的第一激活值,获取第二激活值。The first activation value of the test samples in the preset number of sample categories is modified according to the belonging probability, and the second activation value is obtained.

在一个实施例中,根据所述已知类别图像数据的激活值获取未知类别图像的激活值,包括:In one embodiment, obtaining the activation value of the unknown category image according to the activation value of the known category image data includes:

根据选取的预设数量的样本类别中的测试样本的所述第一激活值以及所述第二激活值,计算未知类别图像的激活值计算公式为:Calculate the activation value of the unknown category image according to the first activation value and the second activation value of the test sample in the selected preset number of sample categories The calculation formula is:

其中,为测试样本的第一激活值,为修正后的第二激活值,C为已知类别图像的总类别个数,c为总类别个数中的任一第c类样本。in, is the first activation value of the test sample, is the corrected second activation value, C is the total number of categories of images of known categories, and c is any c-th sample in the total number of categories.

在一个实施例中,根据所述已知类别图像的激活值以及所述未知类别图像的激活值,对图像进行分类,包括:In one embodiment, classifying images according to the activation value of the known category image and the activation value of the unknown category image includes:

将所述已知类别的图像的激活值与未知类别图像的激活值进行归一化处理,获取图像的新激活值;Normalize the activation value of the image of the known category and the activation value of the image of the unknown category to obtain a new activation value of the image;

从所述新激活值中选出激活值最大的当前测试图像所对应的待定类别值;Select the undetermined category value corresponding to the current test image with the largest activation value from the new activation values;

判断所述待定类别值是否与所述未知类别值相对应;judging whether the pending category value corresponds to the unknown category value;

若是,则拒绝识别所述当前测试图像,并判定所述当前测试图像为未定义类别;If so, refuse to identify the current test image, and determine that the current test image is an undefined category;

若否,则判断所述当前测图像对应的激活值是否小于预设阈值;If not, then determine whether the activation value corresponding to the current measurement image is less than a preset threshold;

若是,则拒绝识别所述当前测试图像,并判定所述当前测试图像为未定义类别;If so, refuse to identify the current test image, and determine that the current test image is an undefined category;

若否,则判定所述当前测试图像属于已知类别,对所述当前测试图像进行已知类别的分类。If not, it is determined that the current test image belongs to a known category, and the current test image is classified into a known category.

本发明实施例的第二方面提供了一种图像分类装置,包括:A second aspect of the embodiments of the present invention provides an image classification apparatus, including:

第一模型获取单元,用于通过已知类别图像对深度卷积神经网络进行训练,获取网络训练模型;a first model obtaining unit, used for training a deep convolutional neural network by using images of known categories to obtain a network training model;

第二模型获取单元,用于根据所述网络训练模型对所述已知类别图像中的每一类样本分别建立概率分布模型;a second model obtaining unit, configured to respectively establish a probability distribution model for each type of sample in the known type of image according to the network training model;

修正单元,用于根据所述概率分布模型修正所述已知类别图像的激活值;a correction unit, configured to correct the activation value of the known category image according to the probability distribution model;

激活值获取单元,用于根据所述已知类别图像数据的激活值获取未知类别图像的激活值;an activation value obtaining unit, configured to obtain the activation value of the unknown class image according to the activation value of the known class image data;

图像分类判定单元,用于根据所述已知类别图像的激活值以及所述未知类别图像的激活值,对图像进行分类。An image classification determination unit, configured to classify images according to the activation value of the known class image and the activation value of the unknown class image.

在一个实施例中,所述第一模型获取单元包括:In one embodiment, the first model obtaining unit includes:

数据划分模块,用于将获取的所述已知类别图像划分为训练集与测试集;a data division module, used to divide the acquired images of known categories into a training set and a test set;

第一结果生成模块,用于通过所述训练集的图像数据训练所述深度卷积神经网络,通过所述测试集的图像数据对训练后的所述深度卷积神经网络进行分类性能的测试,输出网络分类结果;a first result generation module, used for training the deep convolutional neural network by using the image data of the training set, and performing a classification performance test on the trained deep convolutional neural network by using the image data of the test set, Output network classification results;

第二结果生成模块,用于通过损失函数对所述网络分类结果进行监督运算,获取监督运算结果;A second result generation module, configured to perform a supervised operation on the network classification result through a loss function, and obtain a supervised operation result;

参数调整模块,用于根据所述监督运算结果调整所述深度卷积神经网络的网络参数。A parameter adjustment module, configured to adjust the network parameters of the deep convolutional neural network according to the result of the supervision operation.

本发明实施例的第三方面提供了一种终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述图像分类方法的步骤。A third aspect of the embodiments of the present invention provides a terminal device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, when the processor executes the computer program Steps to implement the above image classification method.

本发明实施例的第四方面提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现上述图像分类方法的步骤。A fourth aspect of the embodiments of the present invention provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, implements the steps of the above image classification method.

本发明实施例与现有技术相比存在的有益效果是:通过本发明实施例,通过已知类别图像对深度卷积神经网络进行训练,获取网络训练模型;根据所述网络训练模型对所述已知类别图像中的每一类样本分别建立概率分布模型;根据所述概率分布模型修正所述已知类别图像的激活值;根据所述已知类别图像数据的激活值获取未知类别图像的激活值;根据所述已知类别图像的激活值以及所述未知类别图像的激活值,对图像进行分类;通过对深度卷积神经网络的训练,优化了对图像的识别能力,提升了网络训练模型对图像分类的性能;通过对每一类样本建立概率分布模型以及对图像激活值的修正,可以更好的刻画图像的分类,提升了图像分类的准确性与合理性,避免了对未知类别的图像被错分的问题;实现了对在实际应用中对已知类别图像中训练集合类别之外的图像的合理分类;具有较强的易用性与实用性。Compared with the prior art, the embodiments of the present invention have the following beneficial effects: through the embodiments of the present invention, a deep convolutional neural network is trained by using images of known categories to obtain a network training model; A probability distribution model is established for each type of sample in the known category image; the activation value of the known category image is corrected according to the probability distribution model; the activation value of the unknown category image is obtained according to the activation value of the known category image data. According to the activation value of the known category image and the activation value of the unknown category image, the image is classified; through the training of the deep convolutional neural network, the recognition ability of the image is optimized, and the network training model is improved. The performance of image classification; by establishing a probability distribution model for each type of samples and modifying the image activation value, the image classification can be better described, the accuracy and rationality of image classification can be improved, and the unknown classification can be avoided. The problem of images being misclassified; it realizes the reasonable classification of images other than the training set category in the known category images in practical applications; it has strong ease of use and practicability.

附图说明Description of drawings

为了更清楚地说明本发明实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions in the embodiments of the present invention more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only for the present invention. In some embodiments, for those of ordinary skill in the art, other drawings can also be obtained according to these drawings without any creative effort.

图1是本发明实施例一提供的图像分类方法的实现流程示意图;FIG. 1 is a schematic diagram of an implementation flowchart of an image classification method provided in Embodiment 1 of the present invention;

图2是本发明实施例一提供的损失函数对网络监督的示意图;2 is a schematic diagram of network supervision provided by a loss function according to Embodiment 1 of the present invention;

图3是本发明实施例一提供的获取网络训练模型的实现流程示意图;3 is a schematic diagram of an implementation process flow of acquiring a network training model provided by Embodiment 1 of the present invention;

图4是本发明实施例一提供的建立概率分布模型的实现流程示意图;4 is a schematic diagram of an implementation process flow of establishing a probability distribution model provided by Embodiment 1 of the present invention;

图5是本发明实施例一提供的修正激活值的实现流程示意图;FIG. 5 is a schematic flowchart of an implementation of a modified activation value provided in Embodiment 1 of the present invention;

图6是本发明实施例一提供的对图像进行分类的实现流程示意图;6 is a schematic diagram of an implementation flowchart for classifying images provided in Embodiment 1 of the present invention;

图7是本发明实施例二提供的图像分类装置的示意图;7 is a schematic diagram of an image classification apparatus provided in Embodiment 2 of the present invention;

图8是本发明实施例提供的终端设备的示意图。FIG. 8 is a schematic diagram of a terminal device provided by an embodiment of the present invention.

具体实施方式Detailed ways

以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本发明实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本发明。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本发明的描述。In the following description, for the purpose of illustration rather than limitation, specific details such as specific system structures and technologies are set forth in order to provide a thorough understanding of the embodiments of the present invention. However, it will be apparent to those skilled in the art that the present invention may be practiced in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.

应当理解,当在本说明书和所附权利要求书中使用时,术语“包括”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。It is to be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described feature, integer, step, operation, element and/or component, but does not exclude one or more other features , whole, step, operation, element, component and/or the presence or addition of a collection thereof.

还应当理解,在此本发明说明书中所使用的术语仅仅是出于描述特定实施例的目的而并不意在限制本发明。如在本发明说明书和所附权利要求书中所使用的那样,除非上下文清楚地指明其它情况,否则单数形式的“一”、“一个”及“该”意在包括复数形式。It is also to be understood that the terminology used in this specification of the present invention is for the purpose of describing particular embodiments only and is not intended to limit the present invention. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural unless the context clearly dictates otherwise.

本发明的说明书和权利要求书及上述附图中的术语“包括”以及它们任何变形,意图在于覆盖不排他的包含。例如包含一系列步骤或单元的过程、方法或系统、产品或设备没有限定于已列出的步骤或单元,而是可选地还包括没有列出的步骤或单元,或可选地还包括对于这些过程、方法、产品或设备固有的其它步骤或单元。此外,术语“第一”、“第二”和“第三”等是用于区别不同对象,而非用于描述特定顺序。The term "comprising" and any variations thereof in the description and claims of the present invention and the above drawings are intended to cover non-exclusive inclusions. For example, a process, method or system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes unlisted steps or units, or optionally also includes Other steps or units inherent in these processes, methods, products or devices. Also, the terms "first," "second," and "third," etc. are used to distinguish between different objects, rather than to describe a particular order.

还应当进一步理解,在本发明说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。It should further be understood that, as used in this specification and the appended claims, the term "and/or" refers to and including any and all possible combinations of one or more of the associated listed items .

为了说明本发明所述的技术方案,下面通过具体实施例来进行说明。In order to illustrate the technical solutions of the present invention, the following specific embodiments are used for description.

参见图1,是本发明实施例提供的图像分类方法的实现流程示意图,该方法旨在解决目前图像分类方法不能直接扩展应用去识别在网络模型训练过程中未出现过的图像类别,图像分类方法缺乏迁移以及灵活性的问题。通过该方法不仅能够实现对目前已发现、记录的图像类别进行合理正确的识别与分类,还可以对未知类别的图像进行选出,满足了基于开集图像识别应用场景的实际需求。如图所示,该方法包括以下步骤:Referring to FIG. 1, it is a schematic diagram of the implementation process of the image classification method provided by the embodiment of the present invention. The method aims to solve the problem that the current image classification method cannot be directly extended and applied to identify image categories that have not appeared in the network model training process. The image classification method Lack of migration and flexibility issues. This method can not only realize reasonable and correct identification and classification of image categories that have been discovered and recorded, but also select images of unknown categories, which meets the actual needs of open-set image recognition application scenarios. As shown in the figure, the method includes the following steps:

步骤S101,通过已知类别图像对深度卷积神经网络进行训练,获取网络训练模型。In step S101, a deep convolutional neural network is trained by using images of known categories to obtain a network training model.

在本发明实施例中,所述已知类别图像为选取的固定类别的图片在闭集的条件下对深度卷积神经网络进行训练;相对于开集条件下的图像的类别均为已知的类别,而开集条件下的图像则包括未知类别的图像。已知类别图像包括用于对深度卷机神经网络训练图像以及测试图像,训练图像的类别空间与测试图像的类别空间完全相同;例如,已知类别图像包括500张图像,共包含5个类别,每个类别包括100张,其中80张属于训练图像,20张属于测试图像。In the embodiment of the present invention, the image of the known category is a selected picture of a fixed category, and the deep convolutional neural network is trained under the condition of the closed set; the categories of the images under the condition of the open set are all known category, while the images in the open set condition include images of unknown categories. Known category images include training images and test images for deep convolutional neural networks, and the category space of training images is exactly the same as that of test images; for example, known category images include 500 images, including a total of 5 categories, Each category includes 100 images, of which 80 belong to training images and 20 belong to testing images.

另外,根据已知类别图像的数据集的类别数目以及数据集的复杂程度,选择对应的分类基础网络,例如所选择的基础网络可以包括残差网络ResNet50网络,但不仅限于该网络。In addition, according to the number of categories of the dataset of known category images and the complexity of the dataset, the corresponding classification basic network is selected. For example, the selected basic network may include the residual network ResNet50 network, but is not limited to this network.

需要说明的是,在通过已知类别图像对深度卷积神经网络进行训练过程中,对于网络训练模型输出结果还设置了网络监督部分;网络监督部分通过损失函数计算深度卷积神经网络的损失函数值,反向传播实现网络训练模型的梯度回转,对深度卷积神经网络进行优化以及参数的更新,提高深度卷积神经网络在训练阶段的图像识别能力。所述的损失函数可以包括多种损失函数的叠加,例如利用交叉熵损失函数和中心损失函数共同监督网络分类结果,如图2所示损失函数对网络监督的示意图,在深度卷积神经网络输入图像后,经过网络训练模型输出结果,由交叉熵损失函数以及中心损失函数对网络训练模型进行监督,利用监督结果回转梯度,促使网络训练模型参数的更新,提高网络训练模型图像的识别能力。It should be noted that in the process of training the deep convolutional neural network through the known category images, a network supervision part is also set for the output results of the network training model; the network supervision part calculates the loss function of the deep convolutional neural network through the loss function. value, backpropagation realizes the gradient rotation of the network training model, optimizes the deep convolutional neural network and updates the parameters, and improves the image recognition ability of the deep convolutional neural network in the training stage. The loss function can include the superposition of various loss functions. For example, the cross-entropy loss function and the center loss function are used to jointly supervise the network classification results. As shown in Figure 2, the loss function is a schematic diagram of network supervision. After the image is outputted by the network training model, the network training model is supervised by the cross entropy loss function and the central loss function, and the gradient is reversed by using the supervision result to promote the update of the parameters of the network training model and improve the image recognition ability of the network training model.

作为步骤S101一个具体实现的实施例,如图3所示的获取网络训练模型的实现流程示意图,通过已知类别图像对深度卷积神经网络进行训练,获取网络训练模型,包括:As a specific implementation example of step S101, as shown in the schematic diagram of the implementation flow of obtaining a network training model as shown in FIG. 3 , the deep convolutional neural network is trained through known category images, and the network training model is obtained, including:

步骤S1011,将获取的所述已知类别图像划分为训练集与测试集。Step S1011, dividing the acquired images of known categories into a training set and a test set.

步骤S1012,通过所述训练集的图像训练所述深度卷积神经网络,通过所述测试集的图像对所述深度卷积神经网络进行分类性能的测试,输出网络分类结果。Step S1012: Train the deep convolutional neural network by using the images in the training set, test the classification performance of the deep convolutional neural network by using the images in the test set, and output a network classification result.

在本实施例中,收集整理已知类别图像的数据集,将数据集作为一个闭合空间集合进行划分,可以划分为训练集和测试;例如,已知类别图像的数据集包括500张图像,共包含5个类别,每个类别包括100张,其中80张属于训练集,20张属于测试集;测试集与训练具有相同的类别空间,均包含5种类别的图像。通过训练集的图像训练深度卷积神经网络,利用测试集的图像检测深度卷积神经网络的分类性能,并输出网络分类结果。In this embodiment, a dataset of images of known categories is collected and sorted, and the dataset is divided as a closed space set, which can be divided into training set and test; for example, the dataset of images of known categories includes 500 images, a total of Contains 5 categories, each category includes 100 images, of which 80 belong to the training set and 20 belong to the test set; the test set has the same category space as the training, and both contain 5 categories of images. The deep convolutional neural network is trained through the images of the training set, the classification performance of the deep convolutional neural network is detected by the images of the test set, and the network classification results are output.

步骤S1013,通过损失函数对所述网络分类结果进行监督运算,获取监督运算结果。Step S1013, performing a supervised operation on the network classification result through a loss function to obtain a supervised operation result.

在本实施例中,所设置的损失函数可以是多种损失函数的叠加,其中包括交叉熵损失函数(Cross-Entropy Loss),表达式为:In this embodiment, the set loss function may be a superposition of multiple loss functions, including a cross-entropy loss function (Cross-Entropy Loss), and the expression is:

其中,x为输入网络训练模型的图像,C为数据集中图像类别的总数量,yi表示输入的图像是否属于第i类图像(1表示属于,0表示不属于),P(yi|x)表示输入的图像属于第i类的概率。Among them, x is the image input to the network training model, C is the total number of image categories in the dataset, y i indicates whether the input image belongs to the i-th category image (1 means belonging, 0 means not belonging), P(y i |x ) represents the probability that the input image belongs to the i-th class.

所设置的损失函数还包括中心损失函数(Center Loss),对网络分类结果进行监督,所述的中心损失函数表示为:The set loss function also includes a center loss function (Center Loss), which supervises the network classification results. The center loss function is expressed as:

Lcenter=0.5*||x-xc|| (2),L center = 0.5*||xx c || (2),

其中,x表示输入的图像经过深度卷积神经网络所提取的特征,xc表示输入的图像所属的类别的中心特征向量。Among them, x represents the feature extracted by the input image through the deep convolutional neural network, and x c represents the central feature vector of the category to which the input image belongs.

在对深度卷积神经网络的训练过程中,结合上述两种损失函数,利用两种损失函数对深度卷积神经网络共同监督,从而得到综合损失函数,表达式为:In the training process of the deep convolutional neural network, combined with the above two loss functions, the two loss functions are used to jointly supervise the deep convolutional neural network, so as to obtain the comprehensive loss function, which is expressed as:

Ltotal=λcross_entropyLcross_entropycenterLcenter (3),L total = λ cross_entropy L cross_entropy + λ center L center (3),

其中,λcross_entropy和λcenter分别表示两种损失函数对应的权重,通常将λcross_entropy设置为1,将λcenter设置为8×10-7Among them, λ cross_entropy and λ center respectively represent the corresponding weights of the two loss functions, usually λ cross_entropy is set to 1, and λ center is set to 8×10 -7 .

通过设置的损失函数,计算深度卷积神经网络的损失函数值,将损失函数值反向传播,实现深度卷积神经网络的梯度回传,从而生成监督运算结果。Through the set loss function, the loss function value of the deep convolutional neural network is calculated, and the loss function value is back-propagated to realize the gradient return of the deep convolutional neural network, thereby generating the supervised operation result.

步骤S1014,根据所述监督运算结果调整所述深度卷积神经网络的网络参数。Step S1014: Adjust the network parameters of the deep convolutional neural network according to the result of the supervision operation.

在本实施例中,网络参数为在深度卷积神经网络学习之前设置的超参数,包括但不限于深度卷积神经网络的学习率以及批量大小等,通过选取合适的超参数,进行训练获取参数数据,经过损失函数监督运算,不断更新优化所设置的深度卷积神经网络的超参数,选择更优的超参数,提升网络的图像识别分类性能。In this embodiment, the network parameters are hyperparameters set before the deep convolutional neural network learning, including but not limited to the learning rate and batch size of the deep convolutional neural network, and parameters are obtained by selecting appropriate hyperparameters for training The data is supervised by the loss function, and the hyperparameters of the deep convolutional neural network that are set are continuously updated and optimized, and better hyperparameters are selected to improve the image recognition and classification performance of the network.

通过本实施例,利用多种损失函数共同对网络分类结果进行监督,除了引入交叉熵函数,同时还设置了中心损失函数,有利于在训练过程中减小图像中每一类样本的类内距离,增加不同类别的样本之间的类间距离,使分类结果更具有区分性;同时,中心损失函数还有利于后续每一类样本中心向量的计算;在综合两种损失函数比例时,对两种损失函数采用加权的方式进行结合,提升了网络训练模型的图像分类的准确度。Through this embodiment, a variety of loss functions are used to jointly supervise the network classification results. In addition to the introduction of the cross entropy function, a central loss function is also set, which is beneficial to reduce the intra-class distance of each type of samples in the image during the training process. , increase the inter-class distance between samples of different categories, and make the classification results more distinguishable; at the same time, the center loss function is also conducive to the calculation of the center vector of each class of samples in the future; when synthesizing the ratio of the two loss functions, the two These loss functions are combined in a weighted way, which improves the accuracy of image classification of the network training model.

步骤S102,根据所述网络训练模型对所述已知类别图像中的每一类样本分别建立概率分布模型。Step S102 , respectively establishing a probability distribution model for each type of sample in the known type of image according to the network training model.

在本实施例中,已知类别图像中的每一类样本的分布存在一定概率性,通过训练好的网络训练模型为每一类样本分别建立一个对应的概率分布模型,在确定概率分布模型之前,需要通过已有的样本计算出与该类样本对应的模型参数,进而确定每一类中的样本的所属概率分布,为判定图像是否属于已知类别提供概率判断。In this embodiment, it is known that the distribution of each class of samples in the class images has a certain probability, and a corresponding probability distribution model is established for each class of samples through the trained network training model. Before determining the probability distribution model , it is necessary to calculate the model parameters corresponding to this class of samples through the existing samples, and then determine the probability distribution of the samples in each class, so as to provide a probability judgment for determining whether the image belongs to a known class.

通过概率分布模型,对图像各个类别的样本分布的进行分析,可以更好地刻画图像分类,按概率判定图像是否属于某个类别,提升网络训练模型的图像分类的准确性。Through the probability distribution model, the analysis of the sample distribution of each category of the image can better describe the image classification, determine whether the image belongs to a certain category according to the probability, and improve the accuracy of the image classification of the network training model.

作为步骤S102一个具体实现的实施例,如图4所示的建立概率分布模型的实现流程示意图,根据所述网络训练模型对所述已知类别图像中的每一类样本分别建立概率分布模型,包括:As a specific implementation example of step S102, as shown in FIG. 4 , as shown in the schematic diagram of the implementation flow of establishing a probability distribution model, a probability distribution model is respectively established for each type of sample in the known category image according to the network training model, include:

步骤S1021,获取所述已知类别图像中每一类样本的均值向量。Step S1021: Obtain the mean vector of each type of sample in the known type of image.

在本实施例中,选出已知类别图像中训练集中分类正确的样本,通过网络训练模型计算输入图像的激活值(activation),输入图像为分类正确的样本,计算每一类样本激活值的平均值,获取每一类样本的均值向量(mean vector),计算公式为:In this embodiment, the correctly classified samples in the training set among the known categories of images are selected, the activation value (activation) of the input image is calculated through the network training model, the input image is the correctly classified sample, and the activation value of each type of sample activation value is calculated. The average value is obtained to obtain the mean vector of each type of samples. The calculation formula is:

其中,uc为第c类样本的均值向量,Nc为第c类分类正确的样本数量,为第c类样本中的第n个样本的激活值。Among them, uc is the mean vector of the samples of the c -th class, and N c is the number of correctly classified samples of the c-th class, is the activation value of the nth sample in the c-th sample.

通过网络训练模型提取每一类正确分类样本的激活值,计算每一类样本对应的均值向量。The activation value of each class of correctly classified samples is extracted through the network training model, and the mean vector corresponding to each class of samples is calculated.

步骤S1022,计算所述已知类别图像中每一类样本与所述均值向量之间的距离。Step S1022: Calculate the distance between each class of samples in the known class image and the mean vector.

在本实施例中,在已知类别图像的训练集中,针对分类正确的样本,计算每一类样本与该类样本的均值向量之间的距离,所述的距离可以包括欧式距离(Euclideandistance)和余弦距离(Cosine distance),在此不做限定。以欧式距离(Euclideandistance)和余弦距离(Cosine distance)计算方式为例,将计算出的欧式距离deuclidea和余弦距离dcosine通过加权结合,作为最终的距离,计算公式为:In this embodiment, in the training set of images of known categories, for the correctly classified samples, the distance between each category of samples and the mean vector of the category of samples is calculated, and the distance may include Euclidean distance (Euclidean distance) and Cosine distance, which is not limited here. Taking the calculation methods of Euclidean distance and cosine distance as an example, the calculated Euclidean distance d euclidea and cosine distance d cosine are combined by weighting as the final distance. The calculation formula is:

dtotal=λeuclideandeuclideancosinedcosine (5);d total = λ euclidean d euclidean + λ cosine d cosine (5);

其中,λeuclidean和λcosine分别为对应两种距离的加权系数,λeuclidean设定为1/200,λcosine设定为1。Among them, λ euclidean and λ cosine are the weighting coefficients corresponding to the two distances, respectively, λ euclidean is set to 1/200, and λ cosine is set to 1.

步骤S1023,根据所述距离,按预设比例从每一类样本中选取若干个输入样本。Step S1023, according to the distance, select a number of input samples from each type of samples according to a preset ratio.

在本实施例中,对每一类样本计算出的最终距离,根据极值估计理论,将计算的最终距离按大小排序,以预设比例获取若干数量的样本,所选取的样本为对应的最终距离值排序靠前的样本,即距离较大的若干个样本。In this embodiment, for the final distance calculated for each type of samples, according to the extreme value estimation theory, the calculated final distances are sorted by size, a number of samples are obtained in a preset ratio, and the selected samples are the corresponding final distances. The samples with the highest distance value, that is, the samples with larger distances.

按预设比例获取若干样本数量的计算公式为:The formula for obtaining a number of samples according to a preset ratio is:

Ndf=λNc (6);N df =λN c (6);

其中,Nc为第c类正确分类的样本数目,λ为从第c类样本中选取样本的比例,λ可以取值20%~40%,Ndf为第c类样本中选取的用于作为输入样本的数量。Among them, N c is the number of samples that are correctly classified in the c class, λ is the proportion of samples selected from the c class samples, λ can be 20% to 40%, and N df is the c class sample selected for use as a Enter the number of samples.

将选取的某一类的若干个样本作为概率分布模型的输入样本,根据输入的样本估计与该类样本对应的概率分布模型中的模型参数。Several selected samples of a certain class are used as input samples of the probability distribution model, and model parameters in the probability distribution model corresponding to the samples of this class are estimated according to the input samples.

步骤S1024,根据所述若干个输入样本估计与输入样本类别对应的所述概率分布模型的模型参数。Step S1024, estimating model parameters of the probability distribution model corresponding to the input sample categories according to the plurality of input samples.

在本实施例中,所述的概率分布模型可以为韦伯分布模型,该概率分布模型的表达式为:In this embodiment, the probability distribution model may be a Weber distribution model, and the expression of the probability distribution model is:

其中,wn为某一类输入样本输入韦伯分布模型估计的概率,atest为对输入样本提取的激活值,α为选取的激活值较大的样本类别的个数,n取值范围为[1,α],γ为韦伯分布模型概率大小的控制系数,τn、κn、λn表示第n个韦伯分布模型的参数。Among them, w n is the probability that a certain type of input sample is input into the Weber distribution model, a test is the activation value extracted from the input sample, α is the number of selected sample categories with larger activation values, and the value range of n is [ 1,α], γ is the control coefficient of the probability of the Weber distribution model, τ n , κ n , λ n represent the parameters of the nth Weber distribution model.

将选取的输入样本输入上述表达式(7),通过控制选取韦伯分布尾部的样本比例,可以计算出对应样本类别的韦伯分布模型的参数,根据每一组参数,确定一个与某一类样本相对应的韦伯分布模型。Input the selected input samples into the above expression (7), and by controlling the sample ratio of the tail of the Weber distribution, the parameters of the Weber distribution model corresponding to the sample category can be calculated. The corresponding Weber distribution model.

通过本实施例,在确定每一类样本的概率分布模型时,首先计算出每一类样本的均值向量,即中心向量,计算该类样本与该类样本均值向量的距离,按一定比例选取样本,作为输入样本估计概率分布模型的模型参数;在计算距离时采用了欧式距离与余弦距离的结合,基于样本概率分布的角度,利用每一类样本与对应的中心向量的距离估计出相应概率模型,提升了概率分布模型估计的准确度;可以根据概率分布模型获取输入的测试样本是否属于某一类样本以及相应属于该类样本的概率,提升了图像分类的性能以及图像分类的正确性,更具有实用性。Through this embodiment, when determining the probability distribution model of each type of sample, first calculate the mean vector of each type of sample, that is, the center vector, calculate the distance between this type of sample and this type of sample mean vector, and select samples according to a certain proportion. , as the model parameters of the estimated probability distribution model for the input samples; the combination of Euclidean distance and cosine distance is used in the calculation of the distance, and the corresponding probability model is estimated by the distance between each type of sample and the corresponding center vector based on the angle of the sample probability distribution. , which improves the estimation accuracy of the probability distribution model; whether the input test sample belongs to a certain class of samples and the corresponding probability of belonging to this class of samples can be obtained according to the probability distribution model, which improves the performance of image classification and the correctness of image classification. Practical.

步骤S103,根据所述概率分布模型修正所述已知类别图像的激活值。Step S103, correcting the activation value of the known category image according to the probability distribution model.

在本实施例中,根据已知类别图像的训练集与测试集的图像,通过将测试图像输入网络训练模型,可以提取出测试图像对应的激活值,所提取的激活值为在归一化函数处理之前的输出的激活值。In this embodiment, according to the images of the training set and the test set of known images, by inputting the test image into the network training model, the activation value corresponding to the test image can be extracted, and the extracted activation value is in the normalized function The activation value of the output before processing.

由概率分布模型计算出某一类别的测试图像属于该类别的概率值,将概率值与该测试图像的激活值相乘得到修正后的激活值。The probability value that a test image of a certain category belongs to the category is calculated by the probability distribution model, and the corrected activation value is obtained by multiplying the probability value by the activation value of the test image.

具体的,如图5所示的修正激活值的实现流程示意图,根据所述概率分布模型修正所述已知类别图像的激活值,包括:Specifically, as shown in the schematic flowchart of the implementation of correcting the activation value as shown in FIG. 5 , correcting the activation value of the known category image according to the probability distribution model includes:

步骤S1031,通过所述网络训练模型提取所述已知类别图像中测试样本的第一激活值。Step S1031, extracting the first activation value of the test sample in the known category image through the network training model.

在本实施例中,将已知类别图形中的不同类别的测试样本输入网络训练模型,可以提取出不同类别的测试样本的第一激活值atest,所述的第一激活值为在对测试样本激活值进行归一化函数处理之前的激活值。In this embodiment, the test samples of different categories in the known category graph are input into the network training model, and the first activation value a test of the test samples of different categories can be extracted, and the first activation value is in the pair test. The sample activation value is the activation value before normalization function processing.

需要说明的是,在本实施例中,第一激活值不代表只有一个激活值,而是针对不同类别的测试样本获取的没有经过归一化函数处理的多个激活值。It should be noted that, in this embodiment, the first activation value does not represent only one activation value, but multiple activation values obtained for different categories of test samples that have not been processed by a normalization function.

步骤S1032,根据所述第一激活值,从所述测试样本中选取预设数量的样本类别。Step S1032: Select a preset number of sample categories from the test samples according to the first activation value.

在本实施例中,依据极值估计理论,针对多个样本类别,将获取的第一激活值按大小排序,选取排在靠前的激活值较大的预设数量的样本类别,例如选取的样本类别的个数为α个。In this embodiment, according to the extreme value estimation theory, for multiple sample categories, the obtained first activation values are sorted by size, and a preset number of sample categories with larger activation values are selected. The number of sample categories is α.

步骤S1033,根据与所述预设数量的样本类别对应的所述概率分布模型以及所述样本类别中的测试样本的第一激活值,计算所述预设数量的样本类别中的测试样本的所属概率。Step S1033, according to the probability distribution model corresponding to the preset number of sample categories and the first activation value of the test samples in the sample category, calculate the belonging of the test samples in the preset number of sample categories probability.

在本实施例中,根据步骤S1024确定的概率分布模型的表达式(7),以及在样本类别中选取的样本激活值较大的测试样本激活值,计算出所选的测试样本对应属于某一类别的所属概率。In this embodiment, according to the expression (7) of the probability distribution model determined in step S1024, and the activation value of the test sample selected in the sample category with a larger activation value, it is calculated that the selected test sample corresponds to a certain The probability of belonging to the category.

需要说明的是,在概率分布模型中加入了概率控制系数γ,降低了概率值,避免了出现某特定类别的测试样本的激活值占据主要成分,而使部分样本被错分未知图片类别的问题。It should be noted that the probability control coefficient γ is added to the probability distribution model, which reduces the probability value and avoids the occurrence of the activation value of a specific category of test samples occupying the main component, so that some samples are misclassified as unknown picture categories. .

步骤S1034,根据所述所属概率修正所述预设数量的样本类别中的测试样本的第一激活值,获取第二激活值。Step S1034, correcting the first activation value of the test samples in the preset number of sample categories according to the belonging probability, and obtaining a second activation value.

在本实施例中,通过概率分布模型获取测试样本的所属概率,根据所属概率修正所选取的激活值较大的样本类别的测试样本激活值,修正的计算公式为:In this embodiment, the probability of belonging to the test sample is obtained through the probability distribution model, and the activation value of the selected test sample of the sample category with a larger activation value is corrected according to the probability of belonging, and the revised calculation formula is:

其中,为选取出的激活值较大的样本类别中的测试样本的第一激活值,wc为所述测试样本对应的所属概率,为所述测试样本的第二激活值。in, is the first activation value of the test sample in the selected sample category with a larger activation value, w c is the corresponding probability of the test sample, is the second activation value of the test sample.

通过本实施例,通过选取已知类别图像中测试样本激活值较大的样本类别,将测试样本的激活值输入概率分布模型计算测试样本的所属概率,根据所属概率对测试样本的原始激活值进行修正,获取修正后的激活值,更好的控制了测试样本激活值的大小,防止了某一特定类别的样本激活值占主要成分,而导致部分样本被错分未知图像类别的问题,提高了图像分类的准确度。Through this embodiment, by selecting a sample category with a larger activation value of the test sample in the known category images, the activation value of the test sample is input into the probability distribution model to calculate the probability of belonging of the test sample, and the original activation value of the test sample is calculated according to the probability of belonging. Correction, obtain the corrected activation value, better control the size of the activation value of the test sample, and prevent the sample activation value of a specific category from occupying the main component, which leads to the problem that some samples are wrongly classified into unknown image categories, which improves the Image classification accuracy.

步骤S104,根据所述已知类别图像数据的激活值获取未知类别图像的激活值。Step S104, obtaining the activation value of the unknown category image according to the activation value of the known category image data.

在本实施例中,针对所选取的α个样本类别,根据测试样本的第一激活值和第二激活值,构造未知类别图像的激活值。In this embodiment, for the selected α sample categories, the activation value of the image of the unknown category is constructed according to the first activation value and the second activation value of the test sample.

具体的,根据所述已知类别图像数据的激活值获取未知类别图像的激活值,包括:Specifically, obtaining the activation value of the unknown category image according to the activation value of the known category image data includes:

根据样本类别中的测试样本的所述第一激活值以及所述第二激活值,计算未知类别图像的激活值计算公式为:Calculate the activation value of the unknown category image according to the first activation value and the second activation value of the test sample in the sample category The calculation formula is:

其中,为测试样本的第一激活值,为修正后的第二激活值,C为已知类别图像的总类别个数,c为总类别个数中的任一第c类样本。in, is the first activation value of the test sample, is the corrected second activation value, C is the total number of categories of images of known categories, and c is any c-th sample in the total number of categories.

步骤S105,根据所述已知类别图像的激活值以及所述未知类别图像的激活值,对图像进行分类。Step S105, classify the images according to the activation value of the known category image and the activation value of the unknown category image.

在本实施例中,经过对未知类别图像的激活值的构造,结合已知类别图像的激活值,形成C+1维的激活值,其中C为已知类别图像闭集条件下类别总数;对C+1维的激活值进行归一化处理,将闭集条件下的图像分类扩展为在开集条件下的图像分类。In this embodiment, through the construction of the activation value of the unknown category image, combined with the activation value of the known category image, the activation value of C+1 dimension is formed, where C is the total number of categories under the condition of the closed set of the known category image; The activation value of C+1 dimension is normalized, and the image classification under the condition of closed set is extended to the image classification under the condition of open set.

具体的,如图6所示的对图像进行分类的实现流程示意图,根据所述已知类别图像的激活值以及所述未知类别图像的激活值,对图像进行分类,包括:Specifically, as shown in the schematic diagram of the implementation process of classifying images as shown in FIG. 6 , classifying images according to the activation value of the known category image and the activation value of the unknown category image includes:

步骤S1051,将所述已知类别的图像的激活值与未知类别图像的激活值进行归一化处理,获取图像的新激活值,。Step S1051, normalize the activation value of the image of the known category and the activation value of the image of the unknown category to obtain a new activation value of the image.

在本实施例中,利用归一化函数softmax函数对修正后的C+1微激活值进行归一化,即对已知类别图像的激活值和未知类别图像的激活值均进行归一化处理,得到新的范围属于0到1的新的C+1维激活值,所述的新激活值包含未知类别图像的激活值,新激活值的计算公式为:In this embodiment, the normalization function softmax function is used to normalize the corrected C+1 micro-activation value, that is, the activation value of the known category image and the activation value of the unknown category image are both normalized. , to obtain a new C+1-dimensional activation value with a new range from 0 to 1, the new activation value includes the activation value of the unknown category image, and the calculation formula of the new activation value is:

其中,为修正后的第c类图像的激活值,pc为经过归一化后当前测试图像属于第c类图像的概率。in, is the activation value of the corrected image of class c, and p c is the probability that the current test image belongs to the image of class c after normalization.

根据公式(10)可以获取C+1维的概率向量PcAccording to formula (10), the probability vector P c of C+1 dimension can be obtained.

步骤S1052,从所述新激活值中选出激活值最大的当前测试图像所对应的待定类别值。Step S1052: Select the pending category value corresponding to the current test image with the largest activation value from the new activation values.

在本实施例中,对C+1维的概率向量进行索引,提取出新激活值中最大的激活值,获取与最大的激活值对应当前测试图像,进一步获取当前测试图像对应的待定类别值c*In this embodiment, the C+1-dimensional probability vector is indexed, the largest activation value among the new activation values is extracted, the current test image corresponding to the largest activation value is obtained, and the pending category value c corresponding to the current test image is further obtained. * .

步骤S1053,判断所述待定类别值是否与所述未知类别值相对应。Step S1053, judging whether the pending category value corresponds to the unknown category value.

在本实施例中,根据获取的当前测试图像对应的待定类别值c*,判断待定类别值c*是否与未知类别值C+1相等。In this embodiment, according to the acquired pending category value c * corresponding to the current test image, it is determined whether the pending category value c * is equal to the unknown category value C+1.

步骤S1054,若是,则拒绝识别所述当前测试图像,并判定所述当前测试图像为未定义类别。Step S1054, if yes, refuse to identify the current test image, and determine that the current test image is of an undefined category.

在本实施例中,若待定类别值c*与未知类别值C+1相等,则对当前测试图像执行拒绝识别,判定当前测试图像为未定义类别,实现在开集图像情况对图像的分类。In this embodiment, if the undetermined category value c * is equal to the unknown category value C+1, the current test image is rejected and identified, and the current test image is determined to be an undefined category, thereby realizing image classification in the case of an open set of images.

步骤S1055,若否,则判断所述当前测图像对应的激活值是否小于预设阈值。Step S1055, if no, determine whether the activation value corresponding to the current measurement image is less than a preset threshold.

在本实施例中,设定图像识别的阈值,提取当前测试图像经过归一化处理后的激活值,判定当前测试图片的激活值是否小于预设的图像识别的阈值。所述的预设阈值可以为拒绝阈值,即系统拒绝识别图像的阈值;或者还可以为接受阈值,即系统可以接受图像识别结果的阈值。In this embodiment, the threshold for image recognition is set, the normalized activation value of the current test image is extracted, and it is determined whether the activation value of the current test image is smaller than the preset threshold for image recognition. The preset threshold may be a rejection threshold, that is, a threshold at which the system refuses to recognize an image; or it may be an acceptance threshold, that is, a threshold that the system can accept the image recognition result.

步骤S1056,若是,则拒绝识别所述当前测试图像,并判定所述当前测试图像为未定义类别。Step S1056, if yes, refuse to identify the current test image, and determine that the current test image is of an undefined category.

在本实施例中,若当前测图像对应的激活值小于预设阈值,则拒绝识别所述当前测试图像,并将当前测试图像判定为未定义类别;从而实现了在遇到已知类别图像的训练集之外的图像时,也可以对图像进行合理正确的分类。In this embodiment, if the activation value corresponding to the current test image is smaller than the preset threshold, the current test image is refused to be recognized, and the current test image is judged to be of an undefined category; thus, when encountering images of known categories Images outside the training set can also be classified reasonably correctly.

步骤S1057,若否,则判定所述当前测试图像属于已知类别,对所述当前测试图像进行已知类别的分类。Step S1057, if not, it is determined that the current test image belongs to a known category, and the current test image is classified into a known category.

在本实施例中,若当前测试图像不属于未定义类别时,则按照闭集图像情况对已知类别图像进行分类,判定当前测试图像属于已知类别c*In this embodiment, if the current test image does not belong to the undefined category, the images of the known category are classified according to the closed-set image situation, and it is determined that the current test image belongs to the known category c * .

通过本实施例,选取一定类别的图片在闭集图像条件下训练深度卷积神经网络模型,通过选取合适的超参数,更新网络参数,获取图像分类性能良好的网络训练模型;对闭集图像条件下各个样类别估计对应的概率分布模型,合理刻画各个类别的样本分布概率;通过样本分布概率对闭集图像条件下的图像激活值进行修正,构造未知类别的激活值,将所有激活值归一化处理,利用归一化后的激活值对开机图像条件下对图像进行识别,对未知类别图像实现拒识,将已知类别图像正确分类,提高了图像分类的合理性与准确度,满足实际应用场景的需求,更具实用性。Through this embodiment, a certain category of pictures is selected to train a deep convolutional neural network model under the condition of closed-set images, and by selecting appropriate hyperparameters, the network parameters are updated to obtain a network training model with good image classification performance; The probability distribution model corresponding to each sample category is estimated below, and the sample distribution probability of each category is reasonably described; the activation value of the image under the condition of the closed set image is corrected by the sample distribution probability, the activation value of the unknown category is constructed, and all activation values are normalized. It uses the normalized activation value to identify the image under the condition of the boot image, realizes the rejection of the image of the unknown category, and correctly classifies the image of the known category, which improves the rationality and accuracy of the image classification and meets the actual needs. The needs of application scenarios are more practical.

需要说明的是,本领域技术人员在本发明揭露的技术范围内,可容易想到的其他排序方案也应在本发明的保护范围之内,在此不一一赘述。It should be noted that, those skilled in the art can easily think of other sorting solutions within the technical scope disclosed by the present invention, which should also be within the protection scope of the present invention, and will not be repeated here.

应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本发明实施例的实施过程构成任何限定。It should be understood that the size of the sequence numbers of the steps in the above embodiments does not mean the sequence of execution, and the execution sequence of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.

实施例二Embodiment 2

参见图7,是本发明实施例提供的图像分类装置的示意图,为了便于说明,仅示出了与本发明实施例相关的部分。Referring to FIG. 7 , it is a schematic diagram of an image classification apparatus provided by an embodiment of the present invention. For convenience of description, only parts related to the embodiment of the present invention are shown.

所述图像分类装置包括:The image classification device includes:

第一模型获取单元71,用于通过已知类别图像对深度卷积神经网络进行训练,获取网络训练模型;The first model obtaining unit 71 is used for training the deep convolutional neural network by using images of known categories to obtain a network training model;

第二模型获取单元72,用于根据所述网络训练模型对所述已知类别图像中的每一类样本分别建立概率分布模型;A second model obtaining unit 72, configured to respectively establish a probability distribution model for each type of sample in the known type of image according to the network training model;

修正单元73,用于根据所述概率分布模型修正所述已知类别图像的激活值;A correction unit 73, configured to correct the activation value of the known category image according to the probability distribution model;

激活值获取单元74,用于根据所述已知类别图像数据的激活值获取未知类别图像的激活值;an activation value obtaining unit 74, configured to obtain the activation value of the unknown class image according to the activation value of the known class image data;

图像分类判定单元75,用于根据所述已知类别图像的激活值以及所述未知类别图像的激活值,对图像进行分类。The image classification determination unit 75 is configured to classify images according to the activation value of the known class image and the activation value of the unknown class image.

可选的,所述第一模型获取单元包括:Optionally, the first model obtaining unit includes:

数据划分模块,用于将获取的所述已知类别图像划分为训练集与测试集;a data division module, used to divide the acquired images of known categories into a training set and a test set;

第一结果生成模块,用于通过所述训练集的图像训练所述深度卷积神经网络,通过所述测试集的图像对所述深度卷积神经网络进行分类性能的测试,输出网络分类结果;a first result generation module, configured to train the deep convolutional neural network through images in the training set, test the classification performance of the deep convolutional neural network through images in the test set, and output a network classification result;

第二结果生成模块,用于通过损失函数对所述网络分类结果进行监督运算,获取监督运算结果;A second result generation module, configured to perform a supervised operation on the network classification result through a loss function, and obtain a supervised operation result;

参数调整模块,用于根据所述监督运算结果调整所述深度卷积神经网络的网络参数。A parameter adjustment module, configured to adjust the network parameters of the deep convolutional neural network according to the result of the supervision operation.

通过本实施例,选取一定类别的图片在闭集图像条件下训练深度卷积神经网络模型,通过选取合适的超参数,更新网络参数,获取图像分类性能良好的网络训练模型;对闭集图像条件下各个样类别估计对应的概率分布模型,合理刻画各个类别的样本分布概率;通过样本分布概率对闭集图像条件下的图像激活值进行修正,构造未知类别的激活值,将所有激活值归一化处理,利用归一化后的激活值对开机图像条件下对图像进行识别,对未知类别图像实现拒识,将已知类别图像正确分类,提高了图像分类的合理性与准确度,满足实际应用场景的需求。Through this embodiment, a certain category of pictures is selected to train a deep convolutional neural network model under the condition of closed-set images, and by selecting appropriate hyperparameters, the network parameters are updated to obtain a network training model with good image classification performance; The probability distribution model corresponding to each sample category is estimated below, and the sample distribution probability of each category is reasonably described; the image activation value under the condition of closed-set image is corrected by the sample distribution probability, the activation value of the unknown category is constructed, and all activation values are normalized. It uses the normalized activation value to identify the image under the condition of the boot image, realizes the rejection of the image of the unknown category, and correctly classifies the image of the known category, which improves the rationality and accuracy of the image classification and meets the actual needs. application scenario requirements.

所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述移动终端的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述移动终端中模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example for illustration. In practical applications, the above-mentioned functions can be allocated by different functional units and modules as required. , that is, dividing the internal structure of the mobile terminal into different functional units or modules to complete all or part of the functions described above. Each functional module in the embodiment may be integrated in one processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit, and the above-mentioned integrated units may be implemented in the form of hardware. , can also be implemented in the form of software functional units. In addition, the specific names of the functional modules are only for the convenience of distinguishing from each other, and are not used to limit the protection scope of the present application. For the specific working process of the modules in the above mobile terminal, reference may be made to the corresponding process in the foregoing method embodiments, and details are not described herein again.

实施例三Embodiment 3

图8是本发明一实施例提供的终端设备的示意图。如图8所示,该实施例的终端设备8包括:处理器80、存储器81以及存储在所述存储器81中并可在所述处理器80上运行的计算机程序82。所述处理器80执行所述计算机程序82时实现上述各个图形分类方法实施例中的步骤,例如图1所示的步骤101至105。或者,所述处理器80执行所述计算机程序82时实现上述各装置实施例中各模块/单元的功能,例如图7所示模块71至75的功能。FIG. 8 is a schematic diagram of a terminal device provided by an embodiment of the present invention. As shown in FIG. 8 , the terminal device 8 of this embodiment includes: a processor 80 , a memory 81 , and a computer program 82 stored in the memory 81 and executable on the processor 80 . When the processor 80 executes the computer program 82, the steps in each of the above embodiments of the graphic classification method are implemented, for example, steps 101 to 105 shown in FIG. 1 . Alternatively, when the processor 80 executes the computer program 82, the functions of the modules/units in the above-mentioned apparatus embodiments, for example, the functions of the modules 71 to 75 shown in FIG. 7 are implemented.

示例性的,所述计算机程序82可以被分割成一个或多个模块/单元,所述一个或者多个模块/单元被存储在所述存储器81中,并由所述处理器80执行,以完成本发明。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描述所述计算机程序82在所述终端设备8中的执行过程。例如,所述计算机程序82可以被分割成第一模型获取单元、第二模型获取单元、修正单元、激活值获取单元、图像分类判定单元,各模块具体功能如下:Exemplarily, the computer program 82 may be divided into one or more modules/units, and the one or more modules/units are stored in the memory 81 and executed by the processor 80 to complete the this invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program 82 in the terminal device 8 . For example, the computer program 82 can be divided into a first model acquisition unit, a second model acquisition unit, a correction unit, an activation value acquisition unit, and an image classification determination unit. The specific functions of each module are as follows:

第一模型获取单元,用于通过已知类别图像对深度卷积神经网络进行训练,获取网络训练模型;a first model obtaining unit, used for training a deep convolutional neural network by using images of known categories to obtain a network training model;

第二模型获取单元,用于根据所述网络训练模型对所述已知类别图像中的每一类样本分别建立概率分布模型;a second model obtaining unit, configured to respectively establish a probability distribution model for each type of sample in the known type of image according to the network training model;

修正单元,用于根据所述概率分布模型修正所述已知类别图像的激活值;a correction unit, configured to correct the activation value of the known category image according to the probability distribution model;

激活值获取单元,用于根据所述已知类别图像数据的激活值获取未知类别图像的激活值;an activation value obtaining unit, configured to obtain the activation value of the unknown class image according to the activation value of the known class image data;

图像分类判定单元,用于根据所述已知类别图像的激活值以及所述未知类别图像的激活值,对图像进行分类。An image classification determination unit, configured to classify images according to the activation value of the known class image and the activation value of the unknown class image.

所述终端设备8可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。所述终端设备可包括,但不仅限于,处理器80、存储器81。本领域技术人员可以理解,图8仅仅是终端设备8的示例,并不构成对终端设备8的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述终端设备还可以包括输入输出设备、网络接入设备、总线等。The terminal device 8 may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server. The terminal device may include, but is not limited to, the processor 80 and the memory 81 . Those skilled in the art can understand that FIG. 8 is only an example of the terminal device 8, and does not constitute a limitation on the terminal device 8, and may include more or less components than those shown in the figure, or combine some components, or different components For example, the terminal device may further include an input and output device, a network access device, a bus, and the like.

所称处理器80可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The so-called processor 80 may be a central processing unit (Central Processing Unit, CPU), and may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), Off-the-shelf programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.

所述存储器81可以是装置/终端设备8的内部存储单元,例如终端设备8的硬盘或内存。所述存储器81也可以是所述终端设备8的外部存储设备,例如所述终端设备8上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器81还可以既包括所述终端设备8的内部存储单元也包括外部存储设备。所述存储器81用于存储所述计算机程序以及所述终端设备所需的其他程序和数据。所述存储器81还可以用于暂时地存储已经输出或者将要输出的数据。The memory 81 may be an internal storage unit of the device/terminal device 8 , such as a hard disk or a memory of the terminal device 8 . The memory 81 may also be an external storage device of the terminal device 8, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) equipped on the terminal device 8. card, flash card (Flash Card) and so on. Further, the memory 81 may also include both an internal storage unit of the terminal device 8 and an external storage device. The memory 81 is used to store the computer program and other programs and data required by the terminal device. The memory 81 can also be used to temporarily store data that has been output or will be output.

所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本发明的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. Module completion, that is, dividing the internal structure of the device into different functional units or modules to complete all or part of the functions described above. Each functional unit and module in the embodiment may be integrated in one processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit, and the above-mentioned integrated units may adopt hardware. It can also be realized in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing from each other, and are not used to limit the protection scope of the present invention. For the specific working processes of the units and modules in the above-mentioned system, reference may be made to the corresponding processes in the foregoing method embodiments, which will not be repeated here.

在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the foregoing embodiments, the description of each embodiment has its own emphasis. For parts that are not described or described in detail in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.

本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of the present invention.

在本发明所提供的实施例中,应该理解到,所揭露的装置/终端设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/终端设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。In the embodiments provided by the present invention, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other manners. For example, the apparatus/terminal device embodiments described above are only illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units. Or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.

另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.

所述集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明实现上述实施例方法中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质等。需要说明的是,所述计算机可读介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读介质不包括是电载波信号和电信信号。The integrated modules/units, if implemented in the form of software functional units and sold or used as independent products, may be stored in a computer-readable storage medium. Based on this understanding, the present invention can implement all or part of the processes in the methods of the above embodiments, and can also be completed by instructing relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the program is executed by the processor, the steps of the foregoing method embodiments can be implemented. Wherein, the computer program includes computer program code, and the computer program code may be in the form of source code, object code, executable file or some intermediate form, and the like. The computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM, Read-Only Memory) , Random Access Memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable media may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction, for example, in some jurisdictions, according to legislation and patent practice, the computer-readable media Excluded are electrical carrier signals and telecommunication signals.

以上所述实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围,均应包含在本发明的保护范围之内。The above-mentioned embodiments are only used to illustrate the technical solutions of the present invention, but not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it is still possible to implement the foregoing implementations. The technical solutions described in the examples are modified, or some technical features thereof are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the within the protection scope of the present invention.

Claims (10)

1. An image classification method, comprising:
training the deep convolution neural network through the known class image to obtain a network training model;
respectively establishing a probability distribution model for each type of sample in the known type of image according to the network training model;
correcting the activation value of the known class image according to the probability distribution model;
acquiring an activation value of an unknown class image according to the activation value of the known class image data;
and classifying the images according to the activation values of the known class images and the activation values of the unknown class images.
2. The image classification method of claim 1, wherein training the deep convolutional neural network with known class images to obtain a network training model comprises:
dividing the acquired known class images into a training set and a test set;
training the deep convolutional neural network through the images of the training set, testing the classification performance of the deep convolutional neural network through the images of the test set, and outputting a network classification result;
performing supervision operation on the network classification result through a loss function to obtain a supervision operation result;
and adjusting the network parameters of the deep convolutional neural network according to the supervision operation result.
3. The image classification method according to claim 1, wherein the establishing of the probability distribution model for each class of samples in the known class of images according to the network training model comprises:
obtaining a mean vector of each type of sample in the known type of image;
calculating the distance between each type of sample in the known type of image and the mean vector;
selecting a plurality of input samples from each type of samples according to the distance and a preset proportion;
and estimating model parameters of the probability distribution model corresponding to the input sample category according to the input samples.
4. The image classification method of claim 1, wherein modifying the activation values of the images of the known class according to the probability distribution model comprises:
extracting a first activation value of a test sample in the known class image through the network training model;
selecting a preset number of sample categories from the test samples according to the first activation value;
calculating the probability of the test samples in the sample classes of the preset number according to the probability distribution model corresponding to the sample classes of the preset number and the first activation value of the test samples in the sample classes;
and correcting the first activation values of the test samples in the preset number of sample categories according to the probability to obtain second activation values.
5. The image classification method of claim 4, wherein obtaining the activation value of the unknown class of image from the activation value of the known class of image data comprises:
calculating the activation value of the unknown class image according to the first activation value and the second activation value of the test samples in the selected preset number of sample classesThe calculation formula is as follows:
wherein,to test the first activation value of the sample,and C is any class C sample in the total class number.
6. The image classification method according to claim 1, wherein classifying an image according to the activation value of the known class image and the activation value of the unknown class image comprises:
normalizing the activation value of the image of the known type and the activation value of the image of the unknown type to obtain a new activation value of the image;
selecting a pending class value corresponding to the current test image with the maximum activation value from the new activation values;
judging whether the undetermined class value corresponds to the unknown class value;
if so, refusing to identify the current test image, and judging that the current test image is in an undefined class;
if not, judging whether the activation value corresponding to the current image to be detected is smaller than a preset threshold value;
if so, refusing to identify the current test image, and judging that the current test image is in an undefined class;
if not, judging that the current test image belongs to a known class, and classifying the current test image according to the known class.
7. An image classification apparatus, comprising:
the first model acquisition unit is used for training the deep convolution neural network through the known class image to acquire a network training model;
the second model obtaining unit is used for respectively establishing a probability distribution model for each type of sample in the known type of image according to the network training model;
the correcting unit is used for correcting the activation value of the known class image according to the probability distribution model;
the activation value acquisition unit is used for acquiring the activation value of the unknown class image according to the activation value of the known class image data;
and the image classification judging unit is used for classifying the images according to the activation values of the known class images and the activation values of the unknown class images.
8. The image classification device according to claim 7, wherein the first model acquisition unit includes:
the data dividing module is used for dividing the acquired known class images into a training set and a test set;
the first result generation module is used for training the deep convolutional neural network through the images of the training set, testing the classification performance of the deep convolutional neural network through the images of the test set and outputting a network classification result;
the second result generation module is used for carrying out supervision operation on the network classification result through a loss function to obtain a supervision operation result;
and the parameter adjusting module is used for adjusting the network parameters of the deep convolutional neural network according to the supervision operation result.
9. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any of claims 1 to 6 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 6.
CN201811284267.2A 2018-10-31 2018-10-31 An image classification method, apparatus, terminal device and readable storage medium Pending CN109376786A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811284267.2A CN109376786A (en) 2018-10-31 2018-10-31 An image classification method, apparatus, terminal device and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811284267.2A CN109376786A (en) 2018-10-31 2018-10-31 An image classification method, apparatus, terminal device and readable storage medium

Publications (1)

Publication Number Publication Date
CN109376786A true CN109376786A (en) 2019-02-22

Family

ID=65390741

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811284267.2A Pending CN109376786A (en) 2018-10-31 2018-10-31 An image classification method, apparatus, terminal device and readable storage medium

Country Status (1)

Country Link
CN (1) CN109376786A (en)

Cited By (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109919241A (en) * 2019-03-15 2019-06-21 中国人民解放军国防科技大学 Hyperspectral unknown class target detection method based on probability model and deep learning
CN109977781A (en) * 2019-02-26 2019-07-05 上海上湖信息技术有限公司 Method for detecting human face and device, readable storage medium storing program for executing
CN110059754A (en) * 2019-04-22 2019-07-26 厦门大学 A kind of batch data steganography method, terminal device and storage medium
CN110135505A (en) * 2019-05-20 2019-08-16 北京达佳互联信息技术有限公司 Image classification method, device, computer equipment and computer readable storage medium
CN110147456A (en) * 2019-04-12 2019-08-20 中国科学院深圳先进技术研究院 A kind of image classification method, device, readable storage medium storing program for executing and terminal device
CN110222704A (en) * 2019-06-12 2019-09-10 北京邮电大学 A kind of Weakly supervised object detection method and device
CN110472675A (en) * 2019-07-31 2019-11-19 Oppo广东移动通信有限公司 Image classification method, image classification device, storage medium and electronic equipment
CN110472681A (en) * 2019-08-09 2019-11-19 北京市商汤科技开发有限公司 The neural metwork training scheme and image procossing scheme of knowledge based distillation
CN110567967A (en) * 2019-08-20 2019-12-13 武汉精立电子技术有限公司 Display panel detection method, system, terminal device and computer readable medium
CN110751675A (en) * 2019-09-03 2020-02-04 平安科技(深圳)有限公司 Urban pet activity track monitoring method based on image recognition and related equipment
CN110826713A (en) * 2019-10-25 2020-02-21 广州思德医疗科技有限公司 Method and device for acquiring special convolution kernel
CN110909760A (en) * 2019-10-12 2020-03-24 中国人民解放军国防科技大学 Image open set identification method based on convolutional neural network
CN111612010A (en) * 2020-05-21 2020-09-01 京东方科技集团股份有限公司 Image processing method, apparatus, device, and computer-readable storage medium
WO2020191988A1 (en) * 2019-03-23 2020-10-01 南京智慧光信息科技研究院有限公司 New category identification method and robot system based on fuzzy theory and deep learning
CN111930935A (en) * 2020-06-19 2020-11-13 普联国际有限公司 Image classification method, device, equipment and storage medium
CN112508062A (en) * 2020-11-20 2021-03-16 普联国际有限公司 Open set data classification method, device, equipment and storage medium
CN112541905A (en) * 2020-12-16 2021-03-23 华中科技大学 Product surface defect identification method based on lifelong learning convolutional neural network
CN113705446A (en) * 2021-08-27 2021-11-26 电子科技大学 Open set identification method for individual radiation source
CN113743443A (en) * 2021-05-31 2021-12-03 高新兴科技集团股份有限公司 Image evidence classification and identification method and device
CN115083442A (en) * 2022-04-29 2022-09-20 马上消费金融股份有限公司 Data processing method, data processing device, electronic equipment and computer readable storage medium
CN116071600A (en) * 2023-02-17 2023-05-05 中国科学院地理科学与资源研究所 Crop remote sensing identification method and device based on multi-classification probability

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107229942A (en) * 2017-04-16 2017-10-03 北京工业大学 A kind of convolutional neural networks rapid classification method based on multiple graders
CN107506799A (en) * 2017-09-01 2017-12-22 北京大学 A kind of opener classification based on deep neural network is excavated and extended method and device
CN107622272A (en) * 2016-07-13 2018-01-23 华为技术有限公司 A kind of image classification method and device
CN107895170A (en) * 2017-10-31 2018-04-10 天津大学 A kind of Dropout regularization methods based on activation value sensitiveness
CN107967484A (en) * 2017-11-14 2018-04-27 中国计量大学 A kind of image classification method based on multiresolution
CN108596258A (en) * 2018-04-27 2018-09-28 南京邮电大学 A kind of image classification method based on convolutional neural networks random pool
CN108710831A (en) * 2018-04-24 2018-10-26 华南理工大学 A kind of small data set face recognition algorithms based on machine vision

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107622272A (en) * 2016-07-13 2018-01-23 华为技术有限公司 A kind of image classification method and device
CN107229942A (en) * 2017-04-16 2017-10-03 北京工业大学 A kind of convolutional neural networks rapid classification method based on multiple graders
CN107506799A (en) * 2017-09-01 2017-12-22 北京大学 A kind of opener classification based on deep neural network is excavated and extended method and device
CN107895170A (en) * 2017-10-31 2018-04-10 天津大学 A kind of Dropout regularization methods based on activation value sensitiveness
CN107967484A (en) * 2017-11-14 2018-04-27 中国计量大学 A kind of image classification method based on multiresolution
CN108710831A (en) * 2018-04-24 2018-10-26 华南理工大学 A kind of small data set face recognition algorithms based on machine vision
CN108596258A (en) * 2018-04-27 2018-09-28 南京邮电大学 A kind of image classification method based on convolutional neural networks random pool

Cited By (34)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109977781A (en) * 2019-02-26 2019-07-05 上海上湖信息技术有限公司 Method for detecting human face and device, readable storage medium storing program for executing
CN109919241A (en) * 2019-03-15 2019-06-21 中国人民解放军国防科技大学 Hyperspectral unknown class target detection method based on probability model and deep learning
CN109919241B (en) * 2019-03-15 2020-09-29 中国人民解放军国防科技大学 Detection method of hyperspectral unknown category target based on probabilistic model and deep learning
WO2020191988A1 (en) * 2019-03-23 2020-10-01 南京智慧光信息科技研究院有限公司 New category identification method and robot system based on fuzzy theory and deep learning
CN110147456A (en) * 2019-04-12 2019-08-20 中国科学院深圳先进技术研究院 A kind of image classification method, device, readable storage medium storing program for executing and terminal device
CN110147456B (en) * 2019-04-12 2023-01-24 中国科学院深圳先进技术研究院 Image classification method, device, readable storage medium and terminal equipment
CN110059754A (en) * 2019-04-22 2019-07-26 厦门大学 A kind of batch data steganography method, terminal device and storage medium
CN110135505B (en) * 2019-05-20 2021-09-17 北京达佳互联信息技术有限公司 Image classification method and device, computer equipment and computer readable storage medium
CN110135505A (en) * 2019-05-20 2019-08-16 北京达佳互联信息技术有限公司 Image classification method, device, computer equipment and computer readable storage medium
CN110222704B (en) * 2019-06-12 2022-04-01 北京邮电大学 Weak supervision target detection method and device
CN110222704A (en) * 2019-06-12 2019-09-10 北京邮电大学 A kind of Weakly supervised object detection method and device
CN110472675A (en) * 2019-07-31 2019-11-19 Oppo广东移动通信有限公司 Image classification method, image classification device, storage medium and electronic equipment
CN110472681A (en) * 2019-08-09 2019-11-19 北京市商汤科技开发有限公司 The neural metwork training scheme and image procossing scheme of knowledge based distillation
CN110567967B (en) * 2019-08-20 2022-06-17 武汉精立电子技术有限公司 Display panel detection method, system, terminal device and computer readable medium
CN110567967A (en) * 2019-08-20 2019-12-13 武汉精立电子技术有限公司 Display panel detection method, system, terminal device and computer readable medium
CN110751675A (en) * 2019-09-03 2020-02-04 平安科技(深圳)有限公司 Urban pet activity track monitoring method based on image recognition and related equipment
CN110751675B (en) * 2019-09-03 2023-08-11 平安科技(深圳)有限公司 Urban pet activity track monitoring method based on image recognition and related equipment
CN110909760A (en) * 2019-10-12 2020-03-24 中国人民解放军国防科技大学 Image open set identification method based on convolutional neural network
CN110826713A (en) * 2019-10-25 2020-02-21 广州思德医疗科技有限公司 Method and device for acquiring special convolution kernel
CN110826713B (en) * 2019-10-25 2022-06-10 广州思德医疗科技有限公司 Method and device for acquiring special convolution kernel
CN111612010A (en) * 2020-05-21 2020-09-01 京东方科技集团股份有限公司 Image processing method, apparatus, device, and computer-readable storage medium
CN111930935B (en) * 2020-06-19 2024-06-07 普联国际有限公司 Image classification method, device, equipment and storage medium
CN111930935A (en) * 2020-06-19 2020-11-13 普联国际有限公司 Image classification method, device, equipment and storage medium
CN112508062A (en) * 2020-11-20 2021-03-16 普联国际有限公司 Open set data classification method, device, equipment and storage medium
CN112541905B (en) * 2020-12-16 2022-08-05 华中科技大学 A Product Surface Defect Recognition Method Based on Lifelong Learning Convolutional Neural Network
CN112541905A (en) * 2020-12-16 2021-03-23 华中科技大学 Product surface defect identification method based on lifelong learning convolutional neural network
CN113743443A (en) * 2021-05-31 2021-12-03 高新兴科技集团股份有限公司 Image evidence classification and identification method and device
CN113743443B (en) * 2021-05-31 2024-05-17 高新兴科技集团股份有限公司 Image evidence classification and recognition method and device
CN113705446B (en) * 2021-08-27 2023-04-07 电子科技大学 Open set identification method for individual radiation source
CN113705446A (en) * 2021-08-27 2021-11-26 电子科技大学 Open set identification method for individual radiation source
CN115083442A (en) * 2022-04-29 2022-09-20 马上消费金融股份有限公司 Data processing method, data processing device, electronic equipment and computer readable storage medium
CN115083442B (en) * 2022-04-29 2023-08-08 马上消费金融股份有限公司 Data processing method, device, electronic equipment and computer readable storage medium
CN116071600A (en) * 2023-02-17 2023-05-05 中国科学院地理科学与资源研究所 Crop remote sensing identification method and device based on multi-classification probability
CN116071600B (en) * 2023-02-17 2023-08-04 中国科学院地理科学与资源研究所 Crop remote sensing identification method and device based on multi-classification probability

Similar Documents

Publication Publication Date Title
CN109376786A (en) An image classification method, apparatus, terminal device and readable storage medium
CN110163300B (en) An image classification method, device, electronic device and storage medium
WO2019200782A1 (en) Sample data classification method, model training method, electronic device and storage medium
CN110472675B (en) Image classification method, image classification device, storage medium and electronic equipment
CN110717554B (en) Image recognition method, electronic device, and storage medium
WO2021089013A1 (en) Spatial graph convolutional network training method, electronic device and storage medium
CN109242002A (en) High dimensional data classification method, device and terminal device
CN114998695B (en) Method and system for improving image recognition speed
CN110874604A (en) Model training method and terminal equipment
CN110672323B (en) A method and device for evaluating bearing health status based on neural network
TWI754515B (en) Image detection and related model training method, equipment and computer readable storage medium
CN108694346A (en) A kind of Ship Radiated-Noise signal recognition method based on two-stage CNN
CN108021908A (en) Face age bracket recognition methods and device, computer installation and readable storage medium storing program for executing
CN109104257B (en) Wireless signal detection method and device
CN114419378B (en) Image classification method and device, electronic equipment and medium
CN115546554A (en) Sensitive image identification method, device, equipment and computer readable storage medium
CN110633630B (en) Behavior identification method and device and terminal equipment
CN117033956A (en) Data processing method, system, electronic equipment and medium based on data driving
CN111930935B (en) Image classification method, device, equipment and storage medium
CN116503896A (en) Fish image classification method, device and equipment
CN114219051A (en) Image classification method, classification model training method and device and electronic equipment
CN113688655A (en) Method and device for identifying interference signal, computer equipment and storage medium
CN112508062A (en) Open set data classification method, device, equipment and storage medium
CN109492046A (en) The failure judgment method and device and computer readable storage medium of integrated model
CN114648646B (en) Image classification method and device

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190222