WO2022141258A1 - 一种图像分类方法、计算机设备和存储介质 - Google Patents

一种图像分类方法、计算机设备和存储介质 Download PDF

Info

Publication number
WO2022141258A1
WO2022141258A1 PCT/CN2020/141643 CN2020141643W WO2022141258A1 WO 2022141258 A1 WO2022141258 A1 WO 2022141258A1 CN 2020141643 W CN2020141643 W CN 2020141643W WO 2022141258 A1 WO2022141258 A1 WO 2022141258A1
Authority
WO
WIPO (PCT)
Prior art keywords
feature map
activation function
dynamic
channel
intermediate feature
Prior art date
Application number
PCT/CN2020/141643
Other languages
English (en)
French (fr)
Inventor
王东
程骏
张惊涛
胡淑萍
顾在旺
郭渺辰
刘业鹏
庞建新
Original Assignee
深圳市优必选科技股份有限公司
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 深圳市优必选科技股份有限公司 filed Critical 深圳市优必选科技股份有限公司
Priority to PCT/CN2020/141643 priority Critical patent/WO2022141258A1/zh
Publication of WO2022141258A1 publication Critical patent/WO2022141258A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition

Definitions

  • the present application relates to the field of image technology, and in particular, to an image classification method, a computer device and a storage medium.
  • CNN convolutional neural networks
  • the ReLU (Revised Linear Unit) activation function is a milestone technology in the field of neural networks. It can simply and directly improve the forward and backpropagation performance of deep convolutional neural networks. It has a wide range of applications in classical networks such as ResNet and MobileNet. Compared with the previously used Sigmoid activation function, Sigmoid is prone to gradient disappearance when the number of network layers is deep, and ReLU does not generate a small gradient. When the input is less than zero, the output of some neurons will be zero, so It leads to the sparsity of the network and alleviates the occurrence of overfitting.
  • an embodiment of the present application provides an image classification method, the method comprising:
  • the image classification model includes a convolution layer, and the convolution layer corresponds to a dynamic activation function
  • the convolution layer is used to perform convolution processing on the input feature map to obtain an intermediate feature map
  • the dynamic activation function includes dynamic parameters
  • the dynamic parameters are generated according to the intermediate feature map
  • the dynamic activation function It is used to perform nonlinear mapping on the intermediate feature map to obtain an output feature map.
  • an embodiment of the present application provides a computer device, including a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the processor is caused to perform the following steps:
  • the image classification model includes a convolution layer, and the convolution layer corresponds to a dynamic activation function
  • the convolution layer is used to perform convolution processing on the input feature map to obtain an intermediate feature map
  • the dynamic activation function includes dynamic parameters
  • the dynamic parameters are generated according to the intermediate feature map
  • the dynamic activation function It is used to perform nonlinear mapping on the intermediate feature map to obtain an output feature map.
  • an embodiment of the present application provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, causes the processor to perform the following steps:
  • the image classification model includes a convolution layer, and the convolution layer corresponds to a dynamic activation function
  • the convolution layer is used to perform convolution processing on the input feature map to obtain an intermediate feature map
  • the dynamic activation function includes dynamic parameters
  • the dynamic parameters are generated according to the intermediate feature map
  • the dynamic activation function It is used to perform nonlinear mapping on the intermediate feature map to obtain an output feature map.
  • the embodiment of the present application solves the problem that the activation function cannot be changed for different input feature maps by determining the dynamic activation function according to the dynamic parameters generated by the intermediate feature map, and applying the dynamic activation function to the image classification model. Beneficial effect of improving the classification accuracy of neural network models.
  • Fig. 1 is the application environment diagram of the image classification method in one embodiment
  • FIG. 2 is a flowchart of an image classification method in one embodiment
  • FIG. 3 is a flowchart of a method for generating dynamic parameters in one embodiment
  • FIG. 4 is a flowchart of a method for generating a dynamic channel activation function weighting factor in one embodiment
  • FIG. 5 is a schematic diagram of the generation and activation process of the dynamic activation function in one embodiment
  • step S120 is a specific flowchart of step S120 in the image classification method in one embodiment
  • FIG. 7 is a structural block diagram of a computer device in one embodiment.
  • FIG. 1 is an application environment diagram of an image classification method in one embodiment.
  • the image classification method is applied to an image classification system.
  • the image classification system includes a terminal 110 and a server 120 .
  • the terminal 110 and the server 120 are connected through a network, and the terminal 110 may be a desktop terminal or a mobile terminal, and the mobile terminal may be at least one of a mobile phone, a tablet computer, a notebook computer, and the like.
  • the server 120 can be implemented by an independent server or a server cluster composed of multiple servers.
  • the terminal 110 is configured to acquire the image to be classified, and the server 120 is configured to use the image to be classified as an input feature map, and use a pre-trained image classification model to obtain the classification category of the image to be classified.
  • the image classification model includes a convolution layer, the convolution layer corresponds to a dynamic activation function, and the convolution layer is used to perform convolution processing on the input feature map to obtain an intermediate feature map, and the dynamic activation function includes a dynamic activation function.
  • the dynamic parameter is generated according to the intermediate feature map, and the dynamic activation function is used to perform nonlinear mapping on the intermediate feature map to obtain an output feature map.
  • an image classification method is provided.
  • the method can be applied to both a terminal and a server, and this embodiment is described by taking the application to a terminal as an example.
  • the image classification method specifically includes the following steps:
  • the image classification model includes a convolution layer, and the convolution layer corresponds to a dynamic activation function, the convolution layer is used to perform convolution processing on the input feature map to obtain an intermediate feature map, the dynamic activation function includes dynamic parameters, and the dynamic parameters are generated according to the intermediate feature map, and the dynamic The activation function is used to non-linearly map the intermediate feature map to obtain an output feature map.
  • the method can be applied to the ILSVRC (ImageNet Large Scale Visual Recognition Challenge) competition.
  • the images to be classified are 100,000 images, and the final classification category includes 1000 categories.
  • the method can also be directly applied to image classification with less datasets. Specifically, first obtain images to be classified, there may be multiple images to be classified, and then input these images to be classified into a pre-trained image classification model in turn, and finally the image classification model can output the classification category of each image to be classified .
  • the image classification model includes a convolution layer, that is, the image classification model is a convolutional neural network model, so the image classification model includes a convolution layer, and the convolution layer corresponds to a dynamic activation function.
  • the image classification model obtains the image to be classified. Then, the image to be classified is used as the input feature map of the image classification model, and the convolution layer performs convolution processing on the input feature map to obtain an intermediate feature map. After the intermediate feature map is obtained, the intermediate feature map is input to the dynamic activation function corresponding to the convolutional layer, and the dynamic activation function will non-linearly map the intermediate feature map to obtain the output feature map.
  • the obtained output feature map is continuously input to the pooling layer, fully connected layer and output layer of the image classification model, and the classification category of the image to be classified can be obtained.
  • the dynamic activation function includes dynamic parameters, and the dynamic parameters are generated according to the intermediate feature map. Therefore, after obtaining the intermediate feature map, the image classification model will first generate dynamic parameters according to the intermediate feature map, so as to determine the dynamic activation function, and then dynamically. The activation function will non-linearly map the intermediate feature map to obtain the output feature map.
  • the embodiment of the present application solves the problem that the activation function cannot be changed for different input feature maps by determining the dynamic activation function according to the dynamic parameters generated by the intermediate feature map, and applying the dynamic activation function to the image classification model. Beneficial effect of improving the classification accuracy of neural network models.
  • a method for generating dynamic parameters is also provided, and the method for generating dynamic parameters specifically includes the following steps:
  • the dynamic activation function is composed of N activation functions and N activation function weight factors, wherein each activation function corresponds to an activation function weight factor, that is, the activation function weight factor is a dynamic parameter of the dynamic activation function.
  • the image classification model further includes a dynamic parameter generation module, which is established based on an attention mechanism and used to generate an activation function weight factor, that is, a dynamic parameter.
  • the dynamic parameter generation module first performs an adaptive pooling (Adaptive Average Pooling) operation on the intermediate feature map to obtain the first one-dimensional vector, wherein the intermediate feature map is a three-dimensional tensor, and the adaptive pooling
  • the spatial size of the intermediate feature map can be specified, so that the intermediate feature map can be converted into a one-dimensional vector, that is, the first one-dimensional vector, and then the first one-dimensional vector is input to the fully-connected layer (Fully-Connected) of the dynamic parameter generation module.
  • the fully connected layer can change the dimension of the vector, thereby converting the length of the first one-dimensional vector to obtain the second one-dimensional vector, so that the length of the second one-dimensional vector is equal to the number of activation function weight factors.
  • the dynamic parameter generation module normalizes the second one-dimensional vector, and normalizes it through the normalization function (Normalize) and the logistic regression function (Softmax) to obtain the activation function weight factor of the dynamic activation function, Among them, the normalization function can normalize each value of the second one-dimensional vector to between 0 and 1, and the logistic regression function makes the sum of all values 1, avoiding the output value of the dynamic activation function finally obtained. If it is too large, dynamic parameters are generated according to the intermediate feature map, that is, the activation function weight factor of the dynamic activation function corresponding to each convolutional layer is generated.
  • a first one-dimensional vector is obtained by performing an adaptive pooling operation on the intermediate feature map; the length of the first one-dimensional vector is converted by a fully connected layer to obtain a second one-dimensional vector;
  • the second one-dimensional vector is normalized to obtain the activation function weight factor of the dynamic activation function, so that the dynamic activation function depends on the intermediate feature map, which solves the problem that the activation function cannot be changed for different input feature maps. , and obtained the beneficial effect of improving the classification accuracy of the neural network model.
  • a method for generating a dynamic channel activation function weight factor is also provided, and the method for generating a dynamic channel activation function weight factor specifically includes the following steps:
  • the input feature map is a three-dimensional tensor C ⁇ W ⁇ H, where C represents the number of channels of the input feature map, W ⁇ H represents the spatial resolution of the input feature map, and each channel corresponds to a channel input feature map , the convolution layer is used to convolve the input feature map of each channel to obtain the channel intermediate feature map corresponding to each channel.
  • the dynamic activation function includes C ⁇ N dynamic channel activation functions, each channel corresponds to N dynamic channel activation functions, and each dynamic channel activation function corresponds to a dynamic channel activation function.
  • Weight factor the weight factor of each dynamic channel activation function is generated according to the channel intermediate feature map, and the dynamic channel activation function is used to non-linearly map the corresponding channel intermediate feature map to obtain the output channel feature map.
  • the dynamic channel activation function weight factor of the channel when generating the dynamic channel activation function weight factor of the channel, first perform an adaptive pooling operation on the channel intermediate feature map of the channel to obtain a third one-dimensional vector of length 1, where The length of the third one-dimensional vector is the number of channels in the intermediate feature map of the channel. Because the intermediate feature map of the channel corresponds to one channel, the length of the third one-dimensional vector is 1, and then the length of the third-dimensional vector is converted by the fully connected layer.
  • the length of the fourth one-dimensional vector is the number of dynamic channel activation functions, that is, the number of dynamic channel activation function weighting factors finally obtained, and finally the fourth one-dimensional vector A normalization process is performed to obtain the dynamic channel activation function weight factors of the N dynamic channel activation functions.
  • the dimension of the feature map x is W x *H x *C x
  • the spatial resolution of the feature map is W x *H x
  • the number of channels is C x
  • the dynamic activation function includes 2 ⁇ C x dynamic channel activation functions, that is, each Each channel corresponds to 2 dynamic channel activation functions, and the intermediate feature map will generate 2 ⁇ C x dynamic channel activation function weight factors through the dynamic parameter generation module.
  • the dynamic activation function f g(x) (x) is N, that is, the weighted average result of two different activation functions
  • ReLU6(x c ) represents the ReLU6 activation function to the intermediate feature
  • the nonlinear mapping of graph x, whose dynamic channel activation function weight factor is HardSwish(x c ) represents the nonlinear mapping of the HardSwish activation function to the intermediate feature map x, and its dynamic channel activation function weight factor is Then the dynamic activation function f g(x) (x c ) of the intermediate feature map x c of the c-th channel of the intermediate feature map x can be:
  • an adaptive pooling operation is performed on the intermediate feature map of the channel to obtain a third one-dimensional vector of length 1; the length of the third-dimensional vector is converted by a fully connected layer to obtain a length of N a fourth one-dimensional vector; normalizing the fourth one-dimensional vector to obtain the dynamic channel activation function weight factors of the N dynamic channel activation functions.
  • step S120 specifically includes the following steps:
  • the image classification model performs classification
  • the image to be classified is used as the first input feature map and input to the first convolutional layer of the pre-trained image classification model.
  • layer to obtain the first intermediate feature map then determine the first activation function weight factor of the first dynamic activation function according to the first intermediate feature map, and use the first dynamic activation function to perform nonlinear mapping on the first intermediate feature map to obtain the first Output feature map.
  • the first output feature map to the second convolutional layer to obtain a second intermediate feature map
  • determine the second activation function weight factor of the second dynamic activation function according to the second intermediate feature map and use the second
  • the dynamic activation function performs nonlinear mapping on the second intermediate feature map to obtain the second output feature map, and so on, input the N-1th output feature map to the tail layer convolution layer to obtain the Nth intermediate feature map, and then according to the The N intermediate feature map determines the Nth activation function weight factor of the Nth dynamic activation function, and uses the Nth dynamic activation function to non-linearly map the Nth intermediate feature map to obtain the final output feature map of the tail layer convolution layer.
  • the performance and classification accuracy of the neural network model can be significantly improved by only adding a small amount of extra computational overhead and parameter amount. .
  • Figure 7 shows an internal structure diagram of a computer device in one embodiment.
  • the computer device may be a terminal or a server.
  • the computer device includes a processor, memory and a network interface connected by a system bus.
  • the memory includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium of the computer device stores an operating system, and also stores a computer program, which, when executed by the processor, enables the processor to implement the image classification method.
  • a computer program may also be stored in the internal memory, and when executed by the processor, the computer program may cause the processor to execute the image classification method.
  • FIG. 7 is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer equipment to which the solution of the present application is applied. Include more or fewer components than shown in the figures, or combine certain components, or have a different arrangement of components.
  • a computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the following steps:
  • the image classification model includes a convolution layer, and the convolution layer corresponds to a dynamic activation function, where the convolution layer is used to perform convolution processing on the input feature map to obtain an intermediate feature map, the dynamic activation function includes dynamic parameters, and the dynamic parameters are generated according to the intermediate feature map, The dynamic activation function is used to non-linearly map the intermediate feature map to obtain an output feature map.
  • the dynamic activation function is composed of N activation functions and N activation function weight factors, each of the activation functions corresponds to one of the activation function weight factors, and the activation function weight factor is the Dynamic parameters of the dynamic activation function.
  • the generation of the dynamic parameters includes: performing an adaptive pooling operation on the intermediate feature map to obtain a first one-dimensional vector; converting the length of the first one-dimensional vector through a fully connected layer to obtain a second one-dimensional vector; normalize the second one-dimensional vector to obtain an activation function weight factor of the dynamic activation function.
  • the input feature map includes C channels, each of the channels corresponds to a channel input feature map, and the convolution layer is configured to perform convolution processing on each of the channel input feature maps to obtain each channel.
  • the dynamic activation function includes C ⁇ N dynamic channel activation functions, each channel corresponds to N dynamic channel activation functions, and each dynamic channel activation function corresponds to one dynamic channel activation function
  • a function weighting factor each of the dynamic channel activation function weighting factors is generated according to the channel intermediate feature map, and the dynamic channel activation function is used to non-linearly map the corresponding channel intermediate feature map to obtain an output channel feature map.
  • the generation of the dynamic channel activation function weight factor includes: performing an adaptive pooling operation on the channel intermediate feature map to obtain a third one-dimensional vector with a length of 1; The length of the third three-dimensional vector is converted to obtain a fourth one-dimensional vector of length N; the fourth one-dimensional vector is normalized to obtain the dynamic channel activation function weighting factors of the N dynamic channel activation functions.
  • the image to be classified is used as the first input feature map, which is input to the first convolutional layer of the pre-trained image classification model to obtain the first intermediate feature map; the first intermediate feature map is determined according to the first intermediate feature map.
  • activation function weight factor use the first dynamic activation function to non-linearly map the first intermediate feature map to obtain a first output feature map; input the first output feature map to the second convolution layer to obtain second intermediate feature map; determining a second activation function weight factor of the second dynamic activation function according to the second intermediate feature map; using the second dynamic activation function to perform nonlinear mapping on the second intermediate feature map to obtain the first Two output feature maps until the final output feature map of the tail layer convolution layer is obtained; the classification category of the to-be-classified image is determined according to the final output feature map.
  • the image classification model is a MobileNet-V3 model
  • the dynamic activation function includes a ReLU6 activation function and a HardSwish activation function.
  • a computer-readable storage medium which stores a computer program, and when the computer program is executed by a processor, causes the processor to perform the following steps:
  • the image classification model includes a convolution layer, and the convolution layer corresponds to a dynamic activation function, where the convolution layer is used to perform convolution processing on the input feature map to obtain an intermediate feature map, the dynamic activation function includes dynamic parameters, and the dynamic parameters are generated according to the intermediate feature map, The dynamic activation function is used to non-linearly map the intermediate feature map to obtain an output feature map.
  • the dynamic activation function is composed of N activation functions and N activation function weight factors, each of the activation functions corresponds to one of the activation function weight factors, and the activation function weight factor is the Dynamic parameters of the dynamic activation function.
  • the generation of the dynamic parameters includes: performing an adaptive pooling operation on the intermediate feature map to obtain a first one-dimensional vector; converting the length of the first one-dimensional vector through a fully connected layer to obtain a second one-dimensional vector; normalize the second one-dimensional vector to obtain an activation function weight factor of the dynamic activation function.
  • the input feature map includes C channels, each of the channels corresponds to a channel input feature map, and the convolution layer is configured to perform convolution processing on each of the channel input feature maps to obtain each channel.
  • the dynamic activation function includes C ⁇ N dynamic channel activation functions, each channel corresponds to N dynamic channel activation functions, and each dynamic channel activation function corresponds to one dynamic channel activation function
  • a function weighting factor each of the dynamic channel activation function weighting factors is generated according to the channel intermediate feature map, and the dynamic channel activation function is used to non-linearly map the corresponding channel intermediate feature map to obtain an output channel feature map.
  • the generation of the dynamic channel activation function weight factor includes: performing an adaptive pooling operation on the channel intermediate feature map to obtain a third one-dimensional vector with a length of 1; The length of the third three-dimensional vector is converted to obtain a fourth one-dimensional vector of length N; the fourth one-dimensional vector is normalized to obtain the dynamic channel activation function weighting factors of the N dynamic channel activation functions.
  • the image to be classified is used as the first input feature map, which is input to the first convolutional layer of the pre-trained image classification model to obtain the first intermediate feature map; the first intermediate feature map is determined according to the first intermediate feature map.
  • activation function weight factor use the first dynamic activation function to non-linearly map the first intermediate feature map to obtain a first output feature map; input the first output feature map to the second convolution layer to obtain second intermediate feature map; determining a second activation function weight factor of the second dynamic activation function according to the second intermediate feature map; using the second dynamic activation function to perform nonlinear mapping on the second intermediate feature map to obtain the first Two output feature maps until the final output feature map of the tail layer convolution layer is obtained; the classification category of the to-be-classified image is determined according to the final output feature map.
  • the image classification model is a MobileNet-V3 model
  • the dynamic activation function includes a ReLU6 activation function and a HardSwish activation function.
  • Nonvolatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory may include random access memory (RAM) or external cache memory.
  • RAM is available in various forms such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Road (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
  • SRAM static RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDRSDRAM double data rate SDRAM
  • ESDRAM enhanced SDRAM
  • SLDRAM synchronous chain Road (Synchlink) DRAM
  • SLDRAM synchronous chain Road (Synchlink) DRAM
  • Rambus direct RAM
  • DRAM direct memory bus dynamic RAM
  • RDRAM memory bus dynamic RAM

Abstract

本申请实施例公开了一种图像分类方法、计算机设备和存储介质。该方法包括:获取待分类图像;将所述待分类图像作为输入特征图,使用预先训练好的图像分类模型得到所述待分类图像的分类类别,所述图像分类模型包括卷积层,所述卷积层对应一个动态激活函数,所述卷积层用于对所述输入特征图进行卷积处理得到中间特征图,所述动态激活函数包括动态参数,所述动态参数是根据所述中间特征图生成的,所述动态激活函数用于对所述中间特征图进行非线性映射得到输出特征图。本申请实施例实现了提升神经网络模型分类准确性。

Description

一种图像分类方法、计算机设备和存储介质 技术领域
本申请涉及图像技术领域,尤其涉及一种图像分类方法、计算机设备和存储介质。
背景技术
随着科学技术的飞速发展,神经网络模型被应用至越来越多的领域当中,其中应用最广泛的是图像分类,进行图像分类时常采用卷积神经网络(CNN),在分类的过程中,需要使用激活函数来完成输入特征图的卷积。
ReLU(修正线性单元)激活函数是神经网络领域的里程碑技术,它可以简单直接地改善深度卷积神经网络的前向和反向传播性能,在ResNet、MobileNet等经典网络具有着广泛的应用。相较于之前使用的Sigmoid激活函数,Sigmoid在网络层数较深时容易出现梯度消失的现象,而ReLU并不会产生较小的梯度,输入小于零时会使部分神经元输出为零,从而导致网络的稀疏性,缓解过拟合的产生。
在图像分类的过程中,不同的输入特征图适应于不同的激活函数,但是现有的激活函数,无论是ReLU激活函数还是其衍生形式,譬如ReLU6、Leaky ReLU、PreLu、HardSwish等激活函数,这些激活函数均属于静态激活函数,对于不同的输入特征图来说,激活函数无法改变,从而导致分类的准确性下降。
申请内容
基于此,有必要针对上述问题,提出了一种图像分类方法、计算机设备和存储介质。
第一方面,本申请实施例提供一种图像分类方法,所述方法包括:
获取待分类图像;
将所述待分类图像作为输入特征图,使用预先训练好的图像分类模型得到所述待分类图像的分类类别,所述图像分类模型包括卷积层,所述卷积层对应一个动态激活函数,所述卷积层用于对所述输入特征图进行卷积处理得到中间特征图, 所述动态激活函数包括动态参数,所述动态参数是根据所述中间特征图生成的,所述动态激活函数用于对所述中间特征图进行非线性映射得到输出特征图。
第二方面,本申请实施例提供一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述计算机程序被所述处理器执行时,使得所述处理器执行以下步骤:
获取待分类图像;
将所述待分类图像作为输入特征图,使用预先训练好的图像分类模型得到所述待分类图像的分类类别,所述图像分类模型包括卷积层,所述卷积层对应一个动态激活函数,所述卷积层用于对所述输入特征图进行卷积处理得到中间特征图,所述动态激活函数包括动态参数,所述动态参数是根据所述中间特征图生成的,所述动态激活函数用于对所述中间特征图进行非线性映射得到输出特征图。
第三方面,本申请实施例提供一种计算机可读存储介质,存储有计算机程序,所述计算机程序被处理器执行时,使得所述处理器执行以下步骤:
获取待分类图像;
将所述待分类图像作为输入特征图,使用预先训练好的图像分类模型得到所述待分类图像的分类类别,所述图像分类模型包括卷积层,所述卷积层对应一个动态激活函数,所述卷积层用于对所述输入特征图进行卷积处理得到中间特征图,所述动态激活函数包括动态参数,所述动态参数是根据所述中间特征图生成的,所述动态激活函数用于对所述中间特征图进行非线性映射得到输出特征图。
本申请实施例通过根据所述中间特征图生成的动态参数确定动态激活函数,将动态激活函数应用至图像分类模型,解决了对于不同的输入特征图来说,激活函数无法改变的问题,获得了提升神经网络模型分类准确性的有益效果。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图示出的结构获得其他的附图。
其中:
图1为一个实施例中图像分类方法的应用环境图;
图2为一个实施例中图像分类方法的流程图;
图3为一个实施例中动态参数的生成方法的流程图;
图4为一个实施例中动态通道激活函数权重因子的生成方法的流程图;
图5为一个实施例中动态激活函数的生成和激活流程的示意图;
图6为一个实施例中图像分类方法中步骤S120的具体流程图;
图7为一个实施例中计算机设备的结构框图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
图1为一个实施例中图像分类方法的应用环境图。参照图1,该图像分类方法应用于图像分类系统。该图像分类系统包括终端110和服务器120。终端110和服务器120通过网络连接,终端110具体可以是台式终端或移动终端,移动终端具体可以是手机、平板电脑、笔记本电脑等中的至少一种。服务器120可以用独立的服务器或者是多个服务器组成的服务器集群来实现。终端110用于获取待分类图像,服务器120用于将所述待分类图像作为输入特征图,使用预先训练好的图像分类模型得到所述待分类图像的分类类别。所述图像分类模型包括卷积层,所述卷积层对应一个动态激活函数,所述卷积层用于对所述输入特征图进行卷积处理得到中间特征图,所述动态激活函数包括动态参数,所述动态参数是根据所述中间特征图生成的,所述动态激活函数用于对所述中间特征图进行非线性映射得到输出特征图。
如图2所示,在一个实施例中,提供了一种图像分类方法。该方法既可以应用于终端,也可以应用于服务器,本实施例以应用于终端举例说明。该图像分类 方法具体包括如下步骤:
S110、获取待分类图像。
S120、将所述待分类图像作为输入特征图,使用预先训练好的图像分类模型得到所述待分类图像的分类类别,所述图像分类模型包括卷积层,所述卷积层对应一个动态激活函数,所述卷积层用于对所述输入特征图进行卷积处理得到中间特征图,所述动态激活函数包括动态参数,所述动态参数是根据所述中间特征图生成的,所述动态激活函数用于对所述中间特征图进行非线性映射得到输出特征图。
本实施例中,该方法可以应用于ILSVRC(ImageNet Large Scale Visual Recognition Challenge)竞赛中,在大数据集的ILSVRC竞赛中,使用的待分类图像为10万张图像,最后的分类类别包括1000类,此外该方法也可以直接应用于数据集较少的图像分类中。具体的,首先获取待分类图像,待分类图像可以为多个,然后将这些待分类图像依次输入至预先训练好的图像分类模型,最后该图像分类模型就可以输出每个待分类图像的分类类别。
其中,图像分类模型包括卷积层,即图像分类模型为卷积神经网络模型,因此述图像分类模型中包括卷积层,卷积层对应了一个动态激活函数,图像分类模型在获得待分类图像后,待分类图像作为该图像分类模型的输入特征图,卷积层会对输入特征图进行卷积处理得到中间特征图。得到中间特征图后,将该中间特征图输入至与该卷积层对应的动态激活函数,动态激活函数将对中间特征图进行非线性映射得到输出特征图。此时将得到的输出特征图继续输入至该图像分类模型的池化层、全连接层和输出层,就可以得到待分类图像的分类类别。进一步的,动态激活函数包括动态参数,而动态参数是根据中间特征图生成的,因此得到该中间特征图后,图像分类模型首先会根据中间特征图生成动态参数,从而确定动态激活函数,然后动态激活函数才将对中间特征图进行非线性映射得到输出特征图。
本申请实施例通过根据所述中间特征图生成的动态参数确定动态激活函数,将动态激活函数应用至图像分类模型,解决了对于不同的输入特征图来说,激活函数无法改变的问题,获得了提升神经网络模型分类准确性的有益效果。
在一个实施例中,如图3所示,还提供了一种动态参数的生成方法,该动态参数的生成方法具体包括如下步骤:
S210、对所述中间特征图进行自适应池化操作以得到第一一维向量。
S220、通过全连接层对所述第一一维向量的长度进行转换以得到第二一维向量。
S230、对所述第二一维向量进行归一化处理以得到动态激活函数的激活函数权重因子。
本实施例中,动态激活函数是由N个激活函数和N个激活函数权重因子组成的,其中每个激活函数对应一个激活函数权重因子,即激活函数权重因子为动态激活函数的动态参数。该图像分类模型还包括动态参数生成模块,该动态参数生成模块基于注意力机制建立,用来生成激活函数权重因子,即动态参数。具体的,获得中间特征图后,动态参数生成模块首先对中间特征图进行自适应池化(Adaptive Average Pooling)操作以得到第一一维向量,其中中间特征图是一个三维张量,自适应池化可以指定中间特征图的空间尺寸,从而将中间特征图转换为一个一维向量,即第一一维向量,然后将第一一维向量输入至动态参数生成模块的全连接层(Fully-Connected Layer),全连接层可以改变向量的维度,从而对第一一维向量的长度进行转换以得到第二一维向量,使得第二一维向量的长度和激活函数权重因子的数量相等。最后,动态参数生成模块对第二一维向量进行归一化处理,通过归一化函数(Normalize)和逻辑回归函数(Softmax)进行归一化处理,从而得到动态激活函数的激活函数权重因子,其中,归一化函数可以将第二一维向量的每个数值归一化到0-1之间,逻辑回归函数使得所有数值的加和为1,避免了最后得到的动态激活函数的输出值过大,由此根据中间特征图生成动态参数,即生成每层卷积层对应的动态激活函数的激活函数权重因子。
本申请实施例通过对所述中间特征图进行自适应池化操作以得到第一一维向量;通过全连接层对所述第一一维向量的长度进行转换以得到第二一维向量;对所述第二一维向量进行归一化处理以得到动态激活函数的激活函数权重因子,使得动态激活函数依赖于中间特征图,解决了对于不同的输入特征图来说,激活 函数无法改变的问题,获得了提升神经网络模型分类准确性的有益效果。
在一个实施例中,如图4所示,还提供了一种动态通道激活函数权重因子的生成方法,该动态通道激活函数权重因子的生成方法具体包括如下步骤:
S310、对所述通道中间特征图进行自适应池化操作以得到长度为1的第三一维向量。
S320、通过全连接层对所述第三维向量的长度进行转换以得到长度为N的第四一维向量。
S330、对所述第四一维向量进行归一化处理以得到N个所述动态通道激活函数的动态通道激活函数权重因子。
本实施例中,输入特征图为一个三维张量C×W×H,其中C表示输入特征图的通道数,W×H表示输入特征图的空间分辨率,每个通道对应一个通道输入特征图,卷积层用于对每个通道输入特征图进行卷积处理得到每个通道对应的通道中间特征图。相应的,对于输入特征图的每个通道来说,动态激活函数包括C×N个动态通道激活函数,每个通道对应N个动态通道激活函数,每个动态通道激活函数对应一个动态通道激活函数权重因子,每个动态通道激活函数权重因子是根据通道中间特征图生成的,动态通道激活函数用于对相应的通道中间特征图进行非线性映射得到输出通道特征图。
具体的,对于每一个通道来说,生成该通道的动态通道激活函数权重因子时,首先将该通道的通道中间特征图进行自适应池化操作以得到长度为1的第三一维向量,其中第三一维向量的长度为该通道中间特征图的通道数,因该通道中间特征图对应一个通道,第三一维向量的长度为1,然后通过全连接层对第三维向量的长度进行转换以得到长度为N的第四一维向量,其中第四一维向量的长度为动态通道激活函数的个数,即最后得到的动态通道激活函数权重因子的个数,最后对第四一维向量进行归一化处理以得到N个动态通道激活函数的动态通道激活函数权重因子。
进一步的,对于MobileNet-V3模型来说,实验表明浅层网络的激活函数适合选择ReLU6激活函数,而经过多层卷积后,后半段的深层网络适合替换为 HardSwish激活函数,将中间特征图视为一个整体时,示例性的,一并参照图5,当图像分类模型为MobileNet-V3模型时,此时动态激活函数包括ReLU6激活函数和HardSwish激活函数,即N=2,此时假设中间特征图x的维度是W x*H x*C x,特征图的空间分辨率W x*H x,通道数量为C x,那么动态激活函数包括2×C x个动态通道激活函数,即每个通道对应2个动态通道激活函数,中间特征图经过动态参数生成模块将生成2×C x个动态通道激活函数权重因子。此时在中间特征图x固定的条件下,动态激活函数f g(x)(x)是N个,即2个不同激活函数的加权平均结果,ReLU6(x c)表示ReLU6激活函数对中间特征图x的非线性映射,其动态通道激活函数权重因子为
Figure PCTCN2020141643-appb-000001
HardSwish(x c)表示HardSwish激活函数对中间特征图x的非线性映射,其动态通道激活函数权重因子为
Figure PCTCN2020141643-appb-000002
那么对于中间特征图x的第c个通道的中间特征图x c的动态激活函数f g(x)(x c)可以为:
Figure PCTCN2020141643-appb-000003
以此类推,中间特征图x的C x个通道都通过这种方式激活输出,最后将C x个通道的输出结果按照通道拼接,得到最终的输出特征图y=f g(x)(x)。
本申请实施例通过对所述通道中间特征图进行自适应池化操作以得到长度为1的第三一维向量;通过全连接层对所述第三维向量的长度进行转换以得到长度为N的第四一维向量;对所述第四一维向量进行归一化处理以得到N个所述动态通道激活函数的动态通道激活函数权重因子。解决了对于不同的输入特征图来说,激活函数无法改变的问题,获得了提升神经网络模型分类准确性的有益效果。
在一个实施例中,如图6所示,步骤S120具体包括如下步骤:
S410、将所述待分类图像作为第一输入特征图,输入至预先训练好的图像分类模型的首层卷积层以得到第一中间特征图。
S420、根据所述第一中间特征图确定第一动态激活函数的第一激活函数权重因子。
S430、使用所述第一动态激活函数对所述第一中间特征图进行非线性映射得 到第一输出特征图。
S440、将所述第一输出特征图输入至第二层卷积层以得到第二中间特征图。
S450、根据所述第二中间特征图确定第二动态激活函数的第二激活函数权重因子。
S460、使用所述第二动态激活函数对所述第二中间特征图进行非线性映射得到第二输出特征图,直至得到尾层卷积层的最终输出特征图。
S470、根据所述最终输出特征图确定所述待分类图像的分类类别。
本实施例中,卷积层为多个,因此在图像分类模型执行分类时,具体的,首先将待分类图像作为第一输入特征图,输入至预先训练好的图像分类模型的首层卷积层以得到第一中间特征图,然后根据第一中间特征图确定第一动态激活函数的第一激活函数权重因子,并使用第一动态激活函数对第一中间特征图进行非线性映射得到第一输出特征图。进一步的,将第一输出特征图输入至第二层卷积层以得到第二中间特征图,然后根据第二中间特征图确定第二动态激活函数的第二激活函数权重因子,并使用第二动态激活函数对第二中间特征图进行非线性映射得到第二输出特征图,依此类推,将第N-1输出特征图输入至尾层卷积层以得到第N中间特征图,然后根据第N中间特征图确定第N动态激活函数的第N激活函数权重因子,并使用第N动态激活函数对第N中间特征图进行非线性映射得到尾层卷积层的最终输出特征图。
本申请实施例通过将动态激活函数应用至卷积神经网络模型,对于多层卷积层来说,仅仅增加微量的额外计算开销和参数量,便可以显著提高神经网络模型的性能和分类准确性。
图7示出了一个实施例中计算机设备的内部结构图。该计算机设备具体可以是终端,也可以是服务器。如图7所示,该计算机设备包括通过系统总线连接的处理器、存储器和网络接口。其中,存储器包括非易失性存储介质和内存储器。该计算机设备的非易失性存储介质存储有操作系统,还可存储有计算机程序,该计算机程序被处理器执行时,可使得处理器实现图像分类方法。该内存储器中也可储存有计算机程序,该计算机程序被处理器执行时,可使得处理器执行图像分 类方法。本领域技术人员可以理解,图7中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
在一个实施例中,提出了一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述计算机程序被所述处理器执行时,使得所述处理器执行以下步骤:
获取待分类图像;将所述待分类图像作为输入特征图,使用预先训练好的图像分类模型得到所述待分类图像的分类类别,所述图像分类模型包括卷积层,所述卷积层对应一个动态激活函数,所述卷积层用于对所述输入特征图进行卷积处理得到中间特征图,所述动态激活函数包括动态参数,所述动态参数是根据所述中间特征图生成的,所述动态激活函数用于对所述中间特征图进行非线性映射得到输出特征图。
在一个实施例中,所述动态激活函数是由N个激活函数和N个激活函数权重因子组成,每个所述激活函数对应一个所述激活函数权重因子,所述激活函数权重因子为所述动态激活函数的动态参数。
在一个实施例中,所述动态参数的生成包括:对所述中间特征图进行自适应池化操作以得到第一一维向量;通过全连接层对所述第一一维向量的长度进行转换以得到第二一维向量;对所述第二一维向量进行归一化处理以得到动态激活函数的激活函数权重因子。
在一个实施例中,所述输入特征图包括C个通道,每个所述通道对应一个通道输入特征图,所述卷积层用于对每个所述通道输入特征图进行卷积处理得到每个通道对应的通道中间特征图;所述动态激活函数包括C×N个动态通道激活函数,每个所述通道对应N个动态通道激活函数,每个所述动态通道激活函数对应一个动态通道激活函数权重因子,每个所述动态通道激活函数权重因子是根据所述通道中间特征图生成的,所述动态通道激活函数用于对相应的通道中间特征图进行非线性映射得到输出通道特征图。
在一个实施例中,所述动态通道激活函数权重因子的生成包括:对所述通道中间特征图进行自适应池化操作以得到长度为1的第三一维向量;通过全连接层对所述第三维向量的长度进行转换以得到长度为N的第四一维向量;对所述第四一维向量进行归一化处理以得到N个所述动态通道激活函数的动态通道激活函数权重因子。
在一个实施例中,所述卷积层为多个,所述将所述待分类图像作为输入特征图,使用预先训练好的图像分类模型得到所述待分类图像的分类类别包括:将所述待分类图像作为第一输入特征图,输入至预先训练好的图像分类模型的首层卷积层以得到第一中间特征图;根据所述第一中间特征图确定第一动态激活函数的第一激活函数权重因子;使用所述第一动态激活函数对所述第一中间特征图进行非线性映射得到第一输出特征图;将所述第一输出特征图输入至第二层卷积层以得到第二中间特征图;根据所述第二中间特征图确定第二动态激活函数的第二激活函数权重因子;使用所述第二动态激活函数对所述第二中间特征图进行非线性映射得到第二输出特征图,直至得到尾层卷积层的最终输出特征图;根据所述最终输出特征图确定所述待分类图像的分类类别。
在一个实施例中,所述图像分类模型为MobileNet-V3模型,所述动态激活函数包括ReLU6激活函数和HardSwish激活函数。
在一个实施例中,提出了一种计算机可读存储介质,存储有计算机程序,所述计算机程序被处理器执行时,使得所述处理器执行以下步骤:
获取待分类图像;将所述待分类图像作为输入特征图,使用预先训练好的图像分类模型得到所述待分类图像的分类类别,所述图像分类模型包括卷积层,所述卷积层对应一个动态激活函数,所述卷积层用于对所述输入特征图进行卷积处理得到中间特征图,所述动态激活函数包括动态参数,所述动态参数是根据所述中间特征图生成的,所述动态激活函数用于对所述中间特征图进行非线性映射得到输出特征图。
在一个实施例中,所述动态激活函数是由N个激活函数和N个激活函数权重因子组成,每个所述激活函数对应一个所述激活函数权重因子,所述激活函数 权重因子为所述动态激活函数的动态参数。
在一个实施例中,所述动态参数的生成包括:对所述中间特征图进行自适应池化操作以得到第一一维向量;通过全连接层对所述第一一维向量的长度进行转换以得到第二一维向量;对所述第二一维向量进行归一化处理以得到动态激活函数的激活函数权重因子。
在一个实施例中,所述输入特征图包括C个通道,每个所述通道对应一个通道输入特征图,所述卷积层用于对每个所述通道输入特征图进行卷积处理得到每个通道对应的通道中间特征图;所述动态激活函数包括C×N个动态通道激活函数,每个所述通道对应N个动态通道激活函数,每个所述动态通道激活函数对应一个动态通道激活函数权重因子,每个所述动态通道激活函数权重因子是根据所述通道中间特征图生成的,所述动态通道激活函数用于对相应的通道中间特征图进行非线性映射得到输出通道特征图。
在一个实施例中,所述动态通道激活函数权重因子的生成包括:对所述通道中间特征图进行自适应池化操作以得到长度为1的第三一维向量;通过全连接层对所述第三维向量的长度进行转换以得到长度为N的第四一维向量;对所述第四一维向量进行归一化处理以得到N个所述动态通道激活函数的动态通道激活函数权重因子。
在一个实施例中,所述卷积层为多个,所述将所述待分类图像作为输入特征图,使用预先训练好的图像分类模型得到所述待分类图像的分类类别包括:将所述待分类图像作为第一输入特征图,输入至预先训练好的图像分类模型的首层卷积层以得到第一中间特征图;根据所述第一中间特征图确定第一动态激活函数的第一激活函数权重因子;使用所述第一动态激活函数对所述第一中间特征图进行非线性映射得到第一输出特征图;将所述第一输出特征图输入至第二层卷积层以得到第二中间特征图;根据所述第二中间特征图确定第二动态激活函数的第二激活函数权重因子;使用所述第二动态激活函数对所述第二中间特征图进行非线性映射得到第二输出特征图,直至得到尾层卷积层的最终输出特征图;根据所述最终输出特征图确定所述待分类图像的分类类别。
在一个实施例中,所述图像分类模型为MobileNet-V3模型,所述动态激活 函数包括ReLU6激活函数和HardSwish激活函数。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一非易失性计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。

Claims (20)

  1. 一种图像分类方法,其特征在于,所述方法包括:
    获取待分类图像;
    将所述待分类图像作为输入特征图,使用预先训练好的图像分类模型得到所述待分类图像的分类类别,所述图像分类模型包括卷积层,所述卷积层对应一个动态激活函数,所述卷积层用于对所述输入特征图进行卷积处理得到中间特征图,所述动态激活函数包括动态参数,所述动态参数是根据所述中间特征图生成的,所述动态激活函数用于对所述中间特征图进行非线性映射得到输出特征图。
  2. 根据权利要求1所述的方法,其特征在于,所述动态激活函数是由N个激活函数和N个激活函数权重因子组成,每个所述激活函数对应一个所述激活函数权重因子,所述激活函数权重因子为所述动态激活函数的动态参数。
  3. 根据权利要求2所述的方法,其特征在于,所述动态参数的生成包括:
    对所述中间特征图进行自适应池化操作以得到第一一维向量;
    通过全连接层对所述第一一维向量的长度进行转换以得到第二一维向量;
    对所述第二一维向量进行归一化处理以得到动态激活函数的激活函数权重因子。
  4. 根据权利要求2所述的方法,其特征在于,所述输入特征图包括C个通道,每个所述通道对应一个通道输入特征图,所述卷积层用于对每个所述通道输入特征图进行卷积处理得到每个通道对应的通道中间特征图;所述动态激活函数包括C×N个动态通道激活函数,每个所述通道对应N个动态通道激活函数,每个所述动态通道激活函数对应一个动态通道激活函数权重因子,每个所述动态通道激活函数权重因子是根据所述通道中间特征图生成的,所述动态通道激活函数用于对相应的通道中间特征图进行非线性映射得到输出通道特征图。
  5. 根据权利要求4所述的方法,其特征在于,所述动态通道激活函数权重因子的生成包括:
    对所述通道中间特征图进行自适应池化操作以得到长度为1的第三一维向量;
    通过全连接层对所述第三维向量的长度进行转换以得到长度为N的第四一 维向量;
    对所述第四一维向量进行归一化处理以得到N个所述动态通道激活函数的动态通道激活函数权重因子。
  6. 根据权利要求2所述的方法,其特征在于,所述卷积层为多个,所述将所述待分类图像作为输入特征图,使用预先训练好的图像分类模型得到所述待分类图像的分类类别包括:
    将所述待分类图像作为第一输入特征图,输入至预先训练好的图像分类模型的首层卷积层以得到第一中间特征图;
    根据所述第一中间特征图确定第一动态激活函数的第一激活函数权重因子;
    使用所述第一动态激活函数对所述第一中间特征图进行非线性映射得到第一输出特征图;
    将所述第一输出特征图输入至第二层卷积层以得到第二中间特征图;
    根据所述第二中间特征图确定第二动态激活函数的第二激活函数权重因子;
    使用所述第二动态激活函数对所述第二中间特征图进行非线性映射得到第二输出特征图,直至得到尾层卷积层的最终输出特征图;
    根据所述最终输出特征图确定所述待分类图像的分类类别。
  7. 一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述计算机程序被所述处理器执行时,使得所述处理器执行以下步骤:
    获取待分类图像;
    将所述待分类图像作为输入特征图,使用预先训练好的图像分类模型得到所述待分类图像的分类类别,所述图像分类模型包括卷积层,所述卷积层对应一个动态激活函数,所述卷积层用于对所述输入特征图进行卷积处理得到中间特征图,所述动态激活函数包括动态参数,所述动态参数是根据所述中间特征图生成的,所述动态激活函数用于对所述中间特征图进行非线性映射得到输出特征图。
  8. 根据权利要求7所述的设备,其特征在于,所述动态激活函数是由N个激活函数和N个激活函数权重因子组成,每个所述激活函数对应一个所述激活函数权重因子,所述激活函数权重因子为所述动态激活函数的动态参数。
  9. 根据权利要求8所述的设备,其特征在于,所述动态参数的生成包括:
    对所述中间特征图进行自适应池化操作以得到第一一维向量;
    通过全连接层对所述第一一维向量的长度进行转换以得到第二一维向量;
    对所述第二一维向量进行归一化处理以得到动态激活函数的激活函数权重因子。
  10. 根据权利要求8所述的设备,其特征在于,所述输入特征图包括C个通道,每个所述通道对应一个通道输入特征图,所述卷积层用于对每个所述通道输入特征图进行卷积处理得到每个通道对应的通道中间特征图;所述动态激活函数包括C×N个动态通道激活函数,每个所述通道对应N个动态通道激活函数,每个所述动态通道激活函数对应一个动态通道激活函数权重因子,每个所述动态通道激活函数权重因子是根据所述通道中间特征图生成的,所述动态通道激活函数用于对相应的通道中间特征图进行非线性映射得到输出通道特征图。
  11. 根据权利要求10所述的设备,其特征在于,所述动态通道激活函数权重因子的生成包括:
    对所述通道中间特征图进行自适应池化操作以得到长度为1的第三一维向量;
    通过全连接层对所述第三维向量的长度进行转换以得到长度为N的第四一维向量;
    对所述第四一维向量进行归一化处理以得到N个所述动态通道激活函数的动态通道激活函数权重因子。
  12. 根据权利要求8所述的设备,其特征在于,所述卷积层为多个,所述将所述待分类图像作为输入特征图,使用预先训练好的图像分类模型得到所述待分类图像的分类类别包括:
    将所述待分类图像作为第一输入特征图,输入至预先训练好的图像分类模型的首层卷积层以得到第一中间特征图;
    根据所述第一中间特征图确定第一动态激活函数的第一激活函数权重因子;
    使用所述第一动态激活函数对所述第一中间特征图进行非线性映射得到第一输出特征图;
    将所述第一输出特征图输入至第二层卷积层以得到第二中间特征图;
    根据所述第二中间特征图确定第二动态激活函数的第二激活函数权重因子;
    使用所述第二动态激活函数对所述第二中间特征图进行非线性映射得到第二输出特征图,直至得到尾层卷积层的最终输出特征图;
    根据所述最终输出特征图确定所述待分类图像的分类类别。
  13. 根据权利要求7所述的设备,其特征在于,所述图像分类模型为MobileNet-V3模型,所述动态激活函数包括ReLU6激活函数和HardSwish激活函数。
  14. 一种计算机可读存储介质,存储有计算机程序,所述计算机程序被处理器执行时,使得所述处理器执行以下步骤:
    获取待分类图像;
    将所述待分类图像作为输入特征图,使用预先训练好的图像分类模型得到所述待分类图像的分类类别,所述图像分类模型包括卷积层,所述卷积层对应一个动态激活函数,所述卷积层用于对所述输入特征图进行卷积处理得到中间特征图,所述动态激活函数包括动态参数,所述动态参数是根据所述中间特征图生成的,所述动态激活函数用于对所述中间特征图进行非线性映射得到输出特征图。
  15. 根据权利要求14所述的存储介质,其特征在于,所述动态激活函数是由N个激活函数和N个激活函数权重因子组成,每个所述激活函数对应一个所述激活函数权重因子,所述激活函数权重因子为所述动态激活函数的动态参数。
  16. 根据权利要求15所述的存储介质,其特征在于,所述动态参数的生成包括:
    对所述中间特征图进行自适应池化操作以得到第一一维向量;
    通过全连接层对所述第一一维向量的长度进行转换以得到第二一维向量;
    对所述第二一维向量进行归一化处理以得到动态激活函数的激活函数权重因子。
  17. 根据权利要求15所述的存储介质,其特征在于,所述输入特征图包括C个通道,每个所述通道对应一个通道输入特征图,所述卷积层用于对每个所述通道输入特征图进行卷积处理得到每个通道对应的通道中间特征图;所述动态激活函数包括C×N个动态通道激活函数,每个所述通道对应N个动态通道激活函数,每个所述动态通道激活函数对应一个动态通道激活函数权重因子,每个所述动态 通道激活函数权重因子是根据所述通道中间特征图生成的,所述动态通道激活函数用于对相应的通道中间特征图进行非线性映射得到输出通道特征图。
  18. 根据权利要求17所述的存储介质,其特征在于,所述动态通道激活函数权重因子的生成包括:
    对所述通道中间特征图进行自适应池化操作以得到长度为1的第三一维向量;
    通过全连接层对所述第三维向量的长度进行转换以得到长度为N的第四一维向量;
    对所述第四一维向量进行归一化处理以得到N个所述动态通道激活函数的动态通道激活函数权重因子。
  19. 根据权利要求15所述的存储介质,其特征在于,所述卷积层为多个,所述将所述待分类图像作为输入特征图,使用预先训练好的图像分类模型得到所述待分类图像的分类类别包括:
    将所述待分类图像作为第一输入特征图,输入至预先训练好的图像分类模型的首层卷积层以得到第一中间特征图;
    根据所述第一中间特征图确定第一动态激活函数的第一激活函数权重因子;
    使用所述第一动态激活函数对所述第一中间特征图进行非线性映射得到第一输出特征图;
    将所述第一输出特征图输入至第二层卷积层以得到第二中间特征图;
    根据所述第二中间特征图确定第二动态激活函数的第二激活函数权重因子;
    使用所述第二动态激活函数对所述第二中间特征图进行非线性映射得到第二输出特征图,直至得到尾层卷积层的最终输出特征图;
    根据所述最终输出特征图确定所述待分类图像的分类类别。
  20. 根据权利要求14所述的存储介质,其特征在于,所述图像分类模型为MobileNet-V3模型,所述动态激活函数包括ReLU6激活函数和HardSwish激活函数。
PCT/CN2020/141643 2020-12-30 2020-12-30 一种图像分类方法、计算机设备和存储介质 WO2022141258A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/141643 WO2022141258A1 (zh) 2020-12-30 2020-12-30 一种图像分类方法、计算机设备和存储介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/141643 WO2022141258A1 (zh) 2020-12-30 2020-12-30 一种图像分类方法、计算机设备和存储介质

Publications (1)

Publication Number Publication Date
WO2022141258A1 true WO2022141258A1 (zh) 2022-07-07

Family

ID=82259988

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/141643 WO2022141258A1 (zh) 2020-12-30 2020-12-30 一种图像分类方法、计算机设备和存储介质

Country Status (1)

Country Link
WO (1) WO2022141258A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107341518A (zh) * 2017-07-07 2017-11-10 东华理工大学 一种基于卷积神经网络的图像分类方法
CN108805188A (zh) * 2018-05-29 2018-11-13 徐州工程学院 一种基于特征重标定生成对抗网络的图像分类方法
US20190034557A1 (en) * 2017-07-27 2019-01-31 Robert Bosch Gmbh Visual analytics system for convolutional neural network based classifiers
CN110263868A (zh) * 2019-06-24 2019-09-20 北京航空航天大学 基于SuperPoint特征的图像分类网络
CN110287836A (zh) * 2019-06-14 2019-09-27 北京迈格威科技有限公司 图像分类方法、装置、计算机设备和存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107341518A (zh) * 2017-07-07 2017-11-10 东华理工大学 一种基于卷积神经网络的图像分类方法
US20190034557A1 (en) * 2017-07-27 2019-01-31 Robert Bosch Gmbh Visual analytics system for convolutional neural network based classifiers
CN108805188A (zh) * 2018-05-29 2018-11-13 徐州工程学院 一种基于特征重标定生成对抗网络的图像分类方法
CN110287836A (zh) * 2019-06-14 2019-09-27 北京迈格威科技有限公司 图像分类方法、装置、计算机设备和存储介质
CN110263868A (zh) * 2019-06-24 2019-09-20 北京航空航天大学 基于SuperPoint特征的图像分类网络

Similar Documents

Publication Publication Date Title
WO2021114625A1 (zh) 用于多任务场景的网络结构构建方法和装置
US20200073968A1 (en) Sketch-based image retrieval techniques using generative domain migration hashing
WO2021184902A1 (zh) 图像分类方法、装置、及其训练方法、装置、设备、介质
JP7250126B2 (ja) 自動エンコーダを用いる人工画像生成のためのコンピュータアーキテクチャ
EP4163831A1 (en) Neural network distillation method and device
US20210215818A1 (en) Generative adversarial network-based target identification
CN113593611B (zh) 语音分类网络训练方法、装置、计算设备及存储介质
WO2020211611A1 (zh) 用于语言处理的循环神经网络中隐状态的生成方法和装置
CN110781686B (zh) 一种语句相似度计算方法、装置及计算机设备
CN113435594B (zh) 安防检测模型训练方法、装置、设备及存储介质
US20200134429A1 (en) Computer architecture for multiplier-less machine learning
Zhang et al. Learning from few samples with memory network
JP7214863B2 (ja) 人工画像生成用コンピュータアーキテクチャ
WO2020177378A1 (zh) 文本信息的特征提取方法、装置、计算机设备及存储介质
CN111680132B (zh) 一种用于互联网文本信息的噪声过滤和自动分类方法
CN112668656B (zh) 一种图像分类方法、装置、计算机设备和存储介质
WO2022141258A1 (zh) 一种图像分类方法、计算机设备和存储介质
WO2023231887A1 (zh) 基于张量的持续学习方法和装置
Furusho et al. Roles of pre-training in deep neural networks from information theoretical perspective
CN114638823B (zh) 基于注意力机制序列模型的全切片图像分类方法及装置
CN113378866B (zh) 图像分类方法、系统、存储介质及电子设备
CN113610709B (zh) 模型量化方法、装置、电子设备和计算机可读存储介质
DE102020123155A1 (de) Quantisierungsverfahren eines künstlichen neuronalen Netzwerks und Operationsverfahren unter Verwendung eines künstlichen neuronalen Netzwerks
CN110457700B (zh) 短文本描述方法和装置
Konstantinidis et al. Kernel learning with tensor networks

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20967598

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20967598

Country of ref document: EP

Kind code of ref document: A1