CN109344921A - A kind of image-recognizing method based on deep neural network model, device and equipment - Google Patents

A kind of image-recognizing method based on deep neural network model, device and equipment Download PDF

Info

Publication number
CN109344921A
CN109344921A CN201910004752.8A CN201910004752A CN109344921A CN 109344921 A CN109344921 A CN 109344921A CN 201910004752 A CN201910004752 A CN 201910004752A CN 109344921 A CN109344921 A CN 109344921A
Authority
CN
China
Prior art keywords
neural network
deep neural
network model
target
channel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910004752.8A
Other languages
Chinese (zh)
Other versions
CN109344921B (en
Inventor
谭明奎
吴希贤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hunan Pole Intelligent Technology Co Ltd
Original Assignee
Hunan Pole Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hunan Pole Intelligent Technology Co Ltd filed Critical Hunan Pole Intelligent Technology Co Ltd
Priority to CN201910004752.8A priority Critical patent/CN109344921B/en
Publication of CN109344921A publication Critical patent/CN109344921A/en
Application granted granted Critical
Publication of CN109344921B publication Critical patent/CN109344921B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • 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

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 invention discloses a kind of image-recognizing methods based on deep neural network model, this method comprises: obtaining target image to be identified;Target image is input to, deep neural network model is carried out in the object module obtained after the beta pruning of channel using the characterization ability in channel;Classification processing is carried out to target image using the subsidiary classification device in object module, obtains recognition result.Since the object module of recognition target image is the model after the characterization ability based on channel carries out beta pruning, thus, calculation amount when identifying to target image can be greatly lowered.The invention also discloses a kind of pattern recognition device based on deep neural network model, equipment and readable storage medium storing program for executing, have corresponding technical effect.

Description

Image identification method, device and equipment based on deep neural network model
Technical Field
The invention relates to the technical field of intelligent recognition, in particular to an image recognition method, device and equipment based on a deep neural network model and a readable storage medium.
Background
At present, in image classification and recognition such as image classification and face recognition, a deep neural network model is of great importance. However, the deep neural network has the characteristics of a large number of parameters and a large calculation amount, which causes a large amount of memory requirements and calculation burden, so that the deep neural network model is difficult to be applied to hardware devices such as mobile phones and the like with limited storage and calculation resources.
In summary, how to effectively solve the problems of reducing the calculation amount of image recognition and the like is a technical problem which needs to be solved urgently by those skilled in the art at present.
Disclosure of Invention
The invention aims to provide an image recognition method, an image recognition device, image recognition equipment and a readable storage medium based on a deep neural network model, so as to reduce the calculated amount during image recognition based on the deep neural network model.
In order to solve the technical problems, the invention provides the following technical scheme:
an image identification method based on a deep neural network model comprises the following steps:
acquiring a target image to be identified;
inputting the target image into a target model obtained by channel pruning on a deep neural network model by utilizing the characterization capability of a channel;
classifying the target image by using an auxiliary classifier in the target model to obtain an identification result;
wherein the process of obtaining the target model comprises:
inserting a batch normalization layer, a linear rectification layer and an average pooling layer into the deep neural network model to construct an auxiliary classifier;
inserting an auxiliary loss function into the deep neural network model, and forming a target loss function with a reconstruction loss function of the deep neural network model;
and training the auxiliary classifier by using the target loss function and combining the characterization capability of the channel to obtain a target model.
Preferably, inserting a secondary loss function in the deep neural network model comprises:
inserting a cross entropy loss function in the deep neural network model.
Preferably, the training the auxiliary classifier by using the target loss function in combination with the characterization capability of the channel to obtain the target model includes:
selecting a redundant channel to be pruned in the deep neural network model by utilizing the target loss function and combining the characterization capability of the channel;
and in the deep neural network model, cutting the redundant channel to obtain a target model.
Preferably, the selecting, in the deep neural network model, a redundant channel to be pruned by using the objective loss function in combination with a characterization capability of the channel includes:
obtaining channel selection vectors representing the importance of each channel in the deep neural network model;
optimizing the channel selection vector and model parameters by using the target loss function;
and determining the channel with the vector element of 0 of the optimized channel selection vector as a redundant channel.
Preferably, the optimizing the channel selection vector and the model parameter of the important channel by using the objective loss function includes:
randomly selecting training samples, and enabling an object loss function to be achieved by using a random gradient descent algorithm and a greedy algorithmConverging; wherein,in order to reconstruct the loss function,in order to specify the auxiliary penalty function,for the model parameters β are the channel selection vectors and λ is the weight of the assigned auxiliary loss function.
An image recognition apparatus based on a deep neural network model, comprising: a target image acquisition module, a target image input module, a classification identification module and a target model acquisition module,
the target image acquisition module is used for acquiring a target image to be identified;
the target image input module is used for inputting the target image into a target model obtained by performing channel pruning on the deep neural network model by utilizing the characterization capability of a channel;
the classification identification module is used for classifying the target image by using an auxiliary classifier in the target model to obtain an identification result;
the target model obtaining module comprises:
the auxiliary classifier building unit is used for inserting a batch normalization layer, a linear rectification layer and an average pooling layer into the deep neural network model to build an auxiliary classifier;
the auxiliary loss function inserting unit is used for inserting an auxiliary loss function into the deep neural network model and forming a target loss function with a reconstruction loss function of the deep neural network model;
and the training unit is used for training the auxiliary classifier by utilizing the target loss function and combining the characterization capability of the channel to obtain a target model.
An image recognition apparatus based on a deep neural network model, comprising:
a memory for storing a computer program;
and the processor is used for realizing the steps of the image identification method based on the deep neural network model when executing the computer program.
A readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the above-mentioned deep neural network model-based image recognition method.
By applying the method provided by the embodiment of the invention, the target image to be identified is obtained; inputting the target image into a target model obtained by channel pruning on the deep neural network model by utilizing the representation capability of the channel; and classifying the target image by using an auxiliary classifier in the target model to obtain an identification result.
And acquiring a target image to be identified, and inputting the target image into a target model obtained after channel pruning is carried out on the deep neural network model by utilizing the characterization capability of the channel. Namely, the target model is obtained after pruning the deep neural network model by utilizing the characterization capability of the channel. That is, the target model has culled channels with poor characterization capabilities. Then, the target image is classified by using an auxiliary classifier in the target model, so that the recognition result of the target image can be obtained. Because the target model is obtained by pruning the deep neural network model based on the characterization capability of the channel, the calculation amount when the target image is identified can be greatly reduced. Meanwhile, the channels removed by pruning are channels with poor representation capability, so that the accuracy of the final identification result cannot be reduced by adopting the deep neural network model after pruning to classify and identify the target image. Furthermore, due to the fact that channel pruning is carried out on the target model, the calculation amount can be greatly reduced, and therefore the image recognition method based on the deep neural network model provided by the embodiment of the invention can be applied to hardware equipment with effective computing resources, such as a smart phone.
Accordingly, embodiments of the present invention further provide an image recognition apparatus, a device, and a readable storage medium based on a deep neural network model corresponding to the image recognition method based on a deep neural network model, which have the above technical effects and are not described herein again.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flowchart illustrating an implementation of an image recognition method based on a deep neural network model according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a network structure of a deep neural network model with an auxiliary classifier and an auxiliary loss function inserted therein according to an embodiment of the present invention;
FIG. 3 is a schematic illustration of channel pruning in an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of an image recognition apparatus based on a deep neural network model according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of an image recognition apparatus based on a deep neural network model according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an image recognition device based on a deep neural network model according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the disclosure, the invention will be described in further detail with reference to the accompanying drawings and specific embodiments. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The first embodiment is as follows:
referring to fig. 1, fig. 1 is a flowchart of an image recognition method based on a deep neural network model according to an embodiment of the present invention, where the method includes the following steps:
and S101, acquiring a target image to be identified.
The target image to be recognized is collected in real time by using the target image collecting device, and the target image to be recognized can also be read in a preset storage device. The target image can be an image to be recognized acquired in real time by utilizing image acquisition equipment such as a camera.
S102, inputting the target image into a target model obtained by channel pruning of the deep neural network model by utilizing the characterization capability of the channel.
The deep neural network model can be pruned in advance based on the characterization capability of the channel, and then the target model is obtained. Then, after the target image is obtained, the target image may be input into the target model. Because the target model is based on the characterization capability of the channel and performs channel pruning, compared with the common neural network model, the target model can be operated on hardware equipment with relatively less computing resources, such as a smart phone, a tablet computer and the like.
Preferably, in order to improve the accuracy of the recognition result, the target image may be preprocessed by reducing dimensions, denoising, and the like before being input into the preset deep neural network model. For example, if the target image to be recognized is a color image and a defective color image to be recognized is obtained after step S101 is executed, the defective color image may be repaired by using a common image modification technique, and the binarized image may be input into the preset deep neural network model after the repaired image is binarized.
The target model may be obtained by performing the following steps:
inserting a batch normalization layer, a linear rectification layer and an average pooling layer into a deep neural network model to construct an auxiliary classifier;
inserting an auxiliary loss function into the deep neural network model, and forming a target loss function together with a reconstruction loss function of the deep neural network model;
and step three, training the auxiliary classifier by using the target loss function in combination with the characterization capability of the channel to obtain a target model.
For convenience of description, the above three steps will be described in combination.
Referring to fig. 2, fig. 2 is a schematic diagram of a network structure of a deep neural network model with an auxiliary classifier and an auxiliary loss function inserted therein according to an embodiment of the present invention, in which Conv is a convolutional layer, BatchNorm is a batch normalization layer, ReLU is a linear rectifying layer, AvgPooling is an average pooling layer, and Softmax is a Softmax loss classification function (i.e., the auxiliary loss function described below). When the target model is obtained, a batch normalization layer, a linear rectification layer and an average pooling layer can be inserted into the deep neural network model to construct an auxiliary classifier, and an auxiliary loss function is inserted. The auxiliary loss function inserted in each layer in the deep neural network model must be the same function.
The inserted auxiliary loss function may together with the reconstruction loss function constitute the target loss function. Then, the auxiliary classifier is trained by using the target loss function and the characterization capability of the channel, namely, the channel is pruned to prune the model. Specifically, the loss functions for training the auxiliary classifier include the auxiliary loss functions and the original loss functions in the deep neural network.
S103, classifying the target image by using an auxiliary classifier in the target model to obtain a recognition result.
And classifying the target image by using the auxiliary classification in the preset target model, and finally obtaining the identification result of the target image. Specifically, the identification result may be an identification classification of the object in the image, such as a dangerous goods classification.
By applying the method provided by the embodiment of the invention, the target image to be identified is obtained; inputting the target image into a target model obtained by channel pruning on the deep neural network model by utilizing the representation capability of the channel; and classifying the target image by using an auxiliary classifier in the target model to obtain an identification result.
And acquiring a target image to be recognized, and inputting the target image into a target model obtained after channel pruning is carried out on the deep neural network model by utilizing the characterization capability of the channel. Namely, the target model is obtained after pruning the deep neural network model by utilizing the characterization capability of the channel. That is, the target model has culled channels with poor characterization capabilities. Then, the target image is classified by using an auxiliary classifier in the target model, so that the recognition result of the target image can be obtained. Because the target model is obtained by pruning the deep neural network model based on the characterization capability of the channel, the calculation amount when the target image is identified can be greatly reduced. Meanwhile, the channels removed by pruning are channels with poor representation capability, so that the accuracy of the final identification result cannot be reduced by adopting the deep neural network model after pruning to classify and identify the target image. Furthermore, due to the fact that channel pruning is carried out on the target model, the calculation amount can be greatly reduced, and therefore the image recognition method based on the deep neural network model provided by the embodiment of the invention can be applied to hardware equipment with effective computing resources, such as a smart phone.
It should be noted that the deep neural network model described above can be a VGG model and a ResNet model. After pruning is carried out on VGG and ResNet models, tests are carried out on classical large-scale data sets such as CIFAR10 and ILSVRC-12, and performance comparison is carried out by calculating top-1 error and top-5error, so that the recognition result obtained by the image recognition method based on the deep neural network model provided by the embodiment of the invention can still keep or even exceed the performance of a reference model (namely, an uncut neural network model).
Example two:
in order to facilitate those skilled in the art to understand the technical solutions provided by the embodiments of the present invention, taking an example that an auxiliary loss function inserted in a deep neural network model is specifically a cross entropy loss function, the insertion of the auxiliary loss function in the deep neural network model is described in detail below.
Insertion in deep neural network modelsA secondary loss functionGreat start, orderDenotes an insertion position, whereinRepresenting the last layer. Using the firstA loss functionTo the firstThe layers are subject to channel selection.
Order toIndicates to correspond toAn input feature map of the input sample corresponding toThe definition of each cross entropy loss function is as follows:whereinthe function of the index is expressed in terms of,the weight value of the full connection layer is represented,the number of the categories is indicated and,the number of input channels that are fully connected layers.
It is noted that when inserting the loss function, it is possible to insert the loss function only after a part of the layers, since inserting too many auxiliary loss functions would bring a huge computational cost. That is to say thatThe larger the value of (a) is not, the better,the value of (2) can be adjusted according to the depth of the network, for example, when the depth is large, a larger value can be taken. Corresponding to the general deep network model, the method,can be taken from the value of [2,5 ]]And, as for VGG and ResNet18,the value may take 2 and may be set to 3 for ResNet 50.
In this way, the insertion of the auxiliary loss function in the deep neural network model can be accomplished.
The method includes the steps that an auxiliary classifier is trained by utilizing a target loss function in combination with the characterization capability of a channel, and a target model is obtained, and specifically includes the following steps:
selecting a redundant channel to be pruned in a deep neural network model by utilizing a target loss function and combining the characterization capability of the channel;
and step two, cutting off redundant channels in the deep neural network model to obtain a target model.
For the convenience of the model, the above two steps will be described in combination.
When the auxiliary classifier is successfully carried out, namely the deep neural network model is pruned, the target loss function can be utilized and the representation capability of the channel is combined to select the channel in the deep neural network model, so that the redundant channel to be pruned can be determined. And after the redundant channel is determined, the redundant channel is cut off, so that the target model with a more compact structure can be obtained.
Preferably, for ease of computation, the channel selection vectors may be used to represent the characterization capabilities of individual channels in the deep neural network model. Namely, selecting a redundant channel to be pruned in the deep neural network model by utilizing an objective loss function and combining the characterization capability of the channel, and executing the following steps:
acquiring a channel selection vector representing the importance of each channel in a deep neural network model;
optimizing the channel selection vector and the model parameter by using a target loss function;
and step three, determining the channel with the vector element of 0 of the optimized channel selection vector as a redundant channel.
For convenience of description, the above three steps will be described in combination.
First, a channel selection vector characterizing the importance of each channel in the deep neural network model may be obtained. Specifically, the importance of the channel is judged by the gradient of the channel selection vector at zero, and the greater the gradient, the greater the importance. Thus, the problem of channel selection can be converted into a channel withA constrained optimization problem; the L0 constraint refers to the number of non-0 elements in the vector, so that the parameters can be sparse and the calculation is easy. Then, optimizing the channel selection vector and the model parameter by using the target loss function; and after the optimization is finished, determining the channel with the vector element of 0 of the optimized channel selection vector as a redundant channel. Wherein, the vector element refers to the element in the vector, such as the vector [1,0]The first element is 1 and the second element is 0.
Note that the channel selection is performed by using the objective loss functionWhen the vector and the model parameters are optimized, in each step, all auxiliary loss functions are not used at the same time, but only two loss functions, namely the auxiliary loss function and the original loss function in the current step, are considered, namely, when the pruning optimization is carried out on the deep convolutional neural network, the hierarchical optimization is carried out by taking the layer in the deep neural network model as a unit. Optimizing channel selection vectors and model parameters of important channels by using a target loss function, specifically randomly selecting training samples, and enabling the target loss function to be a target loss function by using a random gradient descent algorithm and a greedy algorithmConverging; wherein,in order to reconstruct the loss function,in order to specify the auxiliary penalty function,the method comprises the steps of selecting each channel selection vector by a greedy algorithm to obtain an important target channel in an input characteristic diagram, pruning in a deep neural network model in a mode of only reserving the target channel to obtain a pruning model, wherein a loop iteration termination condition can be final loss function convergence, specifically, the number of repeated loop iterations reaches a preset value, the iteration number can be determined according to actual precision requirements, namely, when the precision requirements are high, multiple loop iterations can be performed, and when the precision requirements are low, the iteration loop number can be correspondingly low.
The method comprises the steps of utilizing a training sample to perform convergence calculation on a target loss function, namely a process of performing fine adjustment on a model by using an auxiliary loss function and an original loss function, wherein all parameters of the model are updated in the fine adjustment process.
In the stage of selecting channels, a channel selection vector β is introduced to measure the importance of each channel, a greedy algorithm is used to select the channels, namely the importance of the channels is judged by the gradient of β at zero, the greater the gradient is, the greater the importance is, the important channels in the input characteristic diagram are finally obtained.
In the optimization stage of the channel selection vector β and the model parameters, the method specifically comprises the steps of randomly selecting batch training samples, optimizing the channel selection vector β and the model parameters W through a Stochastic Gradient Descent algorithm (SGD), optimizing the selection vector and the model parameters of the channel through a Mini-batch Gradient Descent algorithm (MBGD), and optimizing the selection vector and the model parameters of the channel through a Mini-batch Gradient Descent algorithm (MBGD)The reconstruction error of the model before and after the minimal pruning can be calculated. Wherein,is as followsAn input sample andcharacteristic diagram of each channel, and represents a Fishbenius norm (Frobeni norm)us Norm) thus, the final loss function is defined as:
where λ represents the weight of the corresponding loss function.
Please refer to fig. 3, fig. 3 is a schematic diagram of channel pruning in an embodiment of the present invention, in which a in fig. 3 is an original input feature diagram corresponding to the deep neural network model (i.e., the reference model) shown in fig. 2, B and C are feature diagrams obtained after channel pruning, C and n both indicate the number of channels, w is a weight, K is a weight, and n is a number of channelsh、KwRespectively, the height and width of the convolution kernel.
And by utilizing the channel representation capability in the model, the redundant channels in the network layer are directly removed by utilizing channel pruning, so that the width of the network is reduced, and the pruning of the network model is realized. Compared with a low-rank approximation and sparse connection method, the channel pruning directly changes the width of the network and can be directly applied to a deep learning framework. Compared with the existing channel pruning algorithm, the same pruning rate is set for all network layers, and the redundancy condition of each network layer and whether the reserved channel is really contributing to the final classification capability of the model are not considered. The channel pruning described in the embodiment of the invention is based on the characterization capability of the channel to prune, so that redundant channels which are useless for the final classification result can be truly removed.
The image recognition method based on the deep neural network model is applied to a classic face recognition data set LFW, and the Spherenet is subjected to model pruning by using the channel pruning method provided by the embodiment. The recognition results were as follows:
table 1 shows a comparison on CIFAR-10 (where "-" indicates that the results are not published). The DCP and the DCP-Adapt are Channel pruning algorithms provided by the embodiment of the present invention, and ThiNet (a filter level pruning algorithm for deep neural network compression), Channel pruning (an algorithm for Channel pruning for a pre-trained model), clipping (model pruning), WM +, Random pruning (machine learning algorithm) are common other Channel pruning algorithms, and are not described in detail herein.
VGGNet, ResNet-56, is the deep neural network model mentioned above; # Param ↓: reduced parameter amount, # FLOP ↓: a reduced number of floating points; gap (%): with respect to the error of the reference model, a positive number indicates an increase in the error, and a negative number indicates a decrease in the error.
TABLE 1
Table 2 shows a comparison on ILSVRC-12. The pre-trained models were 23.99 and 7.07 for top-1 and top-5error (%) (where "-" indicates that the results are not published).
TABLE 2
Table 3 shows the accuracy of the prediction results, the number of parameters, the comparison of the floating-point number operand on the LFW, and the cross validation accuracy of the ten-fold of different models. FaceNet, DeepFace, VGG, SphereNet-4 are common depth model algorithms. LFW acc. (%) represents the accuracy on the LFW data set.
TABLE 3
By combining the above table 1, table 2 and table 3, it can be seen that the accuracy of the result obtained by calculation proves that the technical scheme provided by the embodiment of the present invention has practicability (feasibility).
Example three:
corresponding to the above method embodiments, the embodiments of the present invention further provide an image recognition apparatus based on a deep neural network model, and the image recognition apparatus based on the deep neural network model described below and the image recognition method based on the deep neural network model described above may be referred to correspondingly.
Referring to fig. 4, the apparatus includes the following modules: a target image acquisition module 101, a target image input module 102, a classification recognition module 103 and a target model acquisition module 104;
the target image acquiring module 101 is configured to acquire a target image to be identified;
the target image input module 102 is configured to input a target image into a target model obtained by performing channel pruning on the deep neural network model by using the characterization capability of the channel;
the classification recognition module 103 is configured to perform classification processing on the target image by using an auxiliary classifier in the target model to obtain a recognition result;
an object model acquisition module 104, comprising:
the auxiliary classifier building unit is used for inserting a batch normalization layer, a linear rectification layer and an average pooling layer into the deep neural network model to build an auxiliary classifier;
the auxiliary loss function inserting unit is used for inserting an auxiliary loss function into the deep neural network model and forming a target loss function together with a reconstruction loss function of the deep neural network model;
and the training unit is used for training the auxiliary classifier by utilizing the target loss function and combining the characterization capability of the channel to obtain a target model.
By applying the device provided by the embodiment of the invention, the target image to be identified is obtained; inputting the target image into a target model obtained by channel pruning on the deep neural network model by utilizing the representation capability of the channel; and classifying the target image by using an auxiliary classifier in the target model to obtain an identification result.
And acquiring a target image to be identified, and inputting the target image into a target model obtained after channel pruning is carried out on the deep neural network model by utilizing the characterization capability of the channel. Namely, the target model is obtained after pruning the deep neural network model by utilizing the characterization capability of the channel. That is, the target model has culled channels with poor characterization capabilities. Then, the target image is classified by using an auxiliary classifier in the target model, so that the recognition result of the target image can be obtained. Because the target model is obtained by pruning the deep neural network model based on the characterization capability of the channel, the calculation amount when the target image is identified can be greatly reduced. Meanwhile, the channels removed by pruning are channels with poor representation capability, so that the accuracy of the final identification result cannot be reduced by adopting the deep neural network model after pruning to classify and identify the target image. Furthermore, because the target model is subjected to channel pruning, the calculation amount can be greatly reduced, and therefore the image recognition device based on the deep neural network model provided by the embodiment of the invention can be applied to hardware equipment with effective computing resources, such as a smart phone.
In an embodiment of the invention, the auxiliary loss function insertion unit is specifically configured to insert a cross-entropy loss function in the deep neural network model.
In one embodiment of the invention, a training unit comprises:
the redundant channel selection subunit is used for selecting a redundant channel to be pruned in the deep neural network model by utilizing the target loss function and combining the characterization capability of the channel;
and the pruning subunit is used for pruning redundant channels in the deep neural network model to obtain the target model.
In a specific embodiment of the present invention, the redundant channel selection subunit is specifically configured to obtain a channel selection vector representing the importance of each channel in the deep neural network model; optimizing the channel selection vector and the model parameters by using a target loss function; and determining the channel with the vector element of 0 of the optimized channel selection vector as a redundant channel.
In a specific embodiment of the present invention, the redundant channel selection subunit is specifically configured to randomly select a training sample, and make the objective loss function by using a random gradient descent algorithm and a greedy algorithmConverging; wherein,in order to reconstruct the loss function,in order to specify the auxiliary penalty function,for the model parameters β are the channel selection vectors and λ is the weight of the assigned auxiliary loss function.
Example four:
corresponding to the above method embodiment, an embodiment of the present invention further provides an image recognition device based on a deep neural network model, and an image recognition device based on a deep neural network model described below and an image recognition method based on a deep neural network model described above may be referred to each other correspondingly.
Referring to fig. 5, the deep neural network model-based image recognition apparatus includes:
a memory D1 for storing computer programs;
a processor D2 for implementing the steps of the image recognition method based on the deep neural network model of the above method embodiments when executing the computer program.
Specifically, referring to fig. 6, a specific structural diagram of the image recognition device based on the deep neural network model provided in this embodiment is shown, where the image recognition device based on the deep neural network model may generate relatively large differences due to different configurations or performances, and may include one or more processors (CPUs) 322 (e.g., one or more processors) and a memory 332, and one or more storage media 330 (e.g., one or more mass storage devices) storing an application 342 or data 344. Memory 332 and storage media 330 may be, among other things, transient storage or persistent storage. The program stored on the storage medium 330 may include one or more modules (not shown), each of which may include a series of instructions operating on a data processing device. Still further, the central processor 322 may be configured to communicate with the storage medium 330, and execute a series of instruction operations in the storage medium 330 on the deep neural network model-based image recognition device 301.
The deep neural network model-based image recognition apparatus 301 may also include one or more power sources 326, one or more wired or wireless network interfaces 350, one or more input-output interfaces 358, and/or one or more operating systems 341. Such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
The steps in the above-described deep neural network model-based image recognition method may be implemented by the structure of a deep neural network model-based image recognition apparatus.
Example five:
corresponding to the above method embodiment, the embodiment of the present invention further provides a readable storage medium, and a readable storage medium described below and an image recognition method based on the deep neural network model described above may be referred to correspondingly.
A readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the steps of the deep neural network model-based image recognition method of the above-mentioned method embodiment.
The readable storage medium may be a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and various other readable storage media capable of storing program codes.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.

Claims (8)

1. An image recognition method based on a deep neural network model is characterized by comprising the following steps:
acquiring a target image to be identified;
inputting the target image into a target model obtained by channel pruning on a deep neural network model by utilizing the characterization capability of a channel;
classifying the target image by using an auxiliary classifier in the target model to obtain an identification result;
wherein the process of obtaining the target model comprises:
inserting a batch normalization layer, a linear rectification layer and an average pooling layer into the deep neural network model to construct an auxiliary classifier;
inserting an auxiliary loss function into the deep neural network model, and forming a target loss function with a reconstruction loss function of the deep neural network model;
and training the auxiliary classifier by using the target loss function and combining the characterization capability of the channel to obtain a target model.
2. The deep neural network model-based image recognition method of claim 1, wherein inserting an auxiliary loss function in the deep neural network model comprises:
inserting a cross entropy loss function in the deep neural network model.
3. The deep neural network model-based image recognition method of claim 2, wherein the training the auxiliary classifier by using the target loss function in combination with the characterization capability of the channel to obtain the target model comprises:
selecting a redundant channel to be pruned in the deep neural network model by utilizing the target loss function and combining the characterization capability of the channel;
and in the deep neural network model, cutting the redundant channel to obtain a target model.
4. The image recognition method based on the deep neural network model as claimed in claim 3, wherein the selecting the redundant channel to be pruned in the deep neural network model by using the objective loss function and combining the characterization capability of the channel comprises:
obtaining channel selection vectors representing the importance of each channel in the deep neural network model;
optimizing the channel selection vector and model parameters by using the target loss function;
and determining the channel with the vector element of 0 of the optimized channel selection vector as a redundant channel.
5. The deep neural network model-based image recognition method of claim 4, wherein the optimizing the channel selection vector and the model parameters of the significant channel by using the objective loss function comprises:
randomly selecting training samples, and enabling an object loss function to be achieved by using a random gradient descent algorithm and a greedy algorithmConverging; wherein,in order to reconstruct the loss function,in order to specify the auxiliary penalty function,for the model parameters β are the channel selection vectors and λ is the weight of the assigned auxiliary loss function.
6. An image recognition apparatus based on a deep neural network model, comprising: the system comprises a target image acquisition module, a target image input module, a classification recognition module and a target model acquisition module;
the target image acquisition module is used for acquiring a target image to be identified;
the target image input module is used for inputting the target image into a target model obtained by performing channel pruning on the deep neural network model by utilizing the characterization capability of a channel;
the classification identification module is used for classifying the target image by using an auxiliary classifier in the target model to obtain an identification result;
the target model obtaining module comprises:
the auxiliary classifier building unit is used for inserting a batch normalization layer, a linear rectification layer and an average pooling layer into the deep neural network model to build an auxiliary classifier;
the auxiliary loss function inserting unit is used for inserting an auxiliary loss function into the deep neural network model and forming a target loss function with a reconstruction loss function of the deep neural network model;
and the training unit is used for training the auxiliary classifier by utilizing the target loss function and combining the characterization capability of the channel to obtain a target model.
7. An image recognition device based on a deep neural network model, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the method for image recognition based on a deep neural network model according to any one of claims 1 to 5 when executing the computer program.
8. A readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method for image recognition based on a deep neural network model according to any one of claims 1 to 5.
CN201910004752.8A 2019-01-03 2019-01-03 A kind of image-recognizing method based on deep neural network model, device and equipment Active CN109344921B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910004752.8A CN109344921B (en) 2019-01-03 2019-01-03 A kind of image-recognizing method based on deep neural network model, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910004752.8A CN109344921B (en) 2019-01-03 2019-01-03 A kind of image-recognizing method based on deep neural network model, device and equipment

Publications (2)

Publication Number Publication Date
CN109344921A true CN109344921A (en) 2019-02-15
CN109344921B CN109344921B (en) 2019-04-23

Family

ID=65297348

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910004752.8A Active CN109344921B (en) 2019-01-03 2019-01-03 A kind of image-recognizing method based on deep neural network model, device and equipment

Country Status (1)

Country Link
CN (1) CN109344921B (en)

Cited By (23)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109977845A (en) * 2019-03-21 2019-07-05 百度在线网络技术(北京)有限公司 A kind of drivable region detection method and car-mounted terminal
CN110006650A (en) * 2019-03-18 2019-07-12 华中科技大学 A kind of method for diagnosing faults based on the sparse denoising autocoder of stack beta pruning
CN110084281A (en) * 2019-03-31 2019-08-02 华为技术有限公司 Image generating method, the compression method of neural network and relevant apparatus, equipment
CN110276450A (en) * 2019-06-25 2019-09-24 交叉信息核心技术研究院(西安)有限公司 Deep neural network structural sparse system and method based on more granularities
CN110472664A (en) * 2019-07-17 2019-11-19 杭州有盾网络科技有限公司 A kind of certificate image identification method, device and equipment based on deep learning
CN110543900A (en) * 2019-08-21 2019-12-06 北京市商汤科技开发有限公司 Image processing method and device, electronic equipment and storage medium
CN110598848A (en) * 2019-08-16 2019-12-20 中国科学院计算技术研究所 Migration learning acceleration method based on channel pruning
CN110619391A (en) * 2019-09-19 2019-12-27 华南理工大学 Detection model compression method and device and computer readable storage medium
CN110710759A (en) * 2019-09-09 2020-01-21 丁金波 Sole spouts gluey system based on 3D scanning and vision are rectified
CN111008640A (en) * 2019-10-17 2020-04-14 平安科技(深圳)有限公司 Image recognition model training and image recognition method, device, terminal and medium
CN111062477A (en) * 2019-12-17 2020-04-24 腾讯云计算(北京)有限责任公司 Data processing method, device and storage medium
CN111291817A (en) * 2020-02-17 2020-06-16 北京迈格威科技有限公司 Image recognition method and device, electronic equipment and computer readable medium
CN111598322A (en) * 2020-05-09 2020-08-28 东软医疗系统股份有限公司 Medical equipment fault prediction method, device, medium and electronic equipment
CN111695375A (en) * 2019-03-13 2020-09-22 上海云从企业发展有限公司 Face recognition model compression algorithm based on model distillation, medium and terminal
CN111898591A (en) * 2020-08-28 2020-11-06 电子科技大学 Modulation signal identification method based on pruning residual error network
CN111931914A (en) * 2020-08-10 2020-11-13 北京计算机技术及应用研究所 Convolutional neural network channel pruning method based on model fine tuning
CN112489769A (en) * 2019-08-22 2021-03-12 浙江远图互联科技股份有限公司 Intelligent traditional Chinese medicine diagnosis and medicine recommendation system for chronic diseases based on deep neural network
CN112633400A (en) * 2020-12-29 2021-04-09 山东省海洋生物研究院 Shellfish classification and identification method and device based on computer vision
CN112686145A (en) * 2020-12-29 2021-04-20 广东各有所爱信息科技有限公司 Facial skin type identification method and intelligent terminal thereof
CN112884142A (en) * 2019-11-29 2021-06-01 北京市商汤科技开发有限公司 Neural network training method, neural network training device, target detection method, target detection device, equipment and storage medium
CN113408561A (en) * 2020-03-17 2021-09-17 北京京东乾石科技有限公司 Model generation method, target detection method, device, equipment and storage medium
CN113505804A (en) * 2021-05-19 2021-10-15 山东师范大学 Image identification method and system based on compressed deep neural network
CN118365968A (en) * 2024-06-18 2024-07-19 中山市人民医院 Prostate cancer image recognition method and device

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107368885A (en) * 2017-07-13 2017-11-21 北京智芯原动科技有限公司 Network model compression method and device based on more granularity beta prunings
CN107516129A (en) * 2017-08-01 2017-12-26 北京大学 The depth Web compression method decomposed based on the adaptive Tucker of dimension
WO2018000309A1 (en) * 2016-06-30 2018-01-04 Intel Corporation Importance-aware model pruning and re-training for efficient convolutional neural networks
US20180096249A1 (en) * 2016-10-04 2018-04-05 Electronics And Telecommunications Research Institute Convolutional neural network system using adaptive pruning and weight sharing and operation method thereof
CN108288270A (en) * 2018-02-05 2018-07-17 南京邮电大学 A kind of object detection method based on channel trimming and full convolution deep learning
US20180204108A1 (en) * 2017-01-18 2018-07-19 Microsoft Technology Licensing, Llc Automated activity-time training
CN108806698A (en) * 2018-03-15 2018-11-13 中山大学 A kind of camouflage audio recognition method based on convolutional neural networks
CN108898168A (en) * 2018-06-19 2018-11-27 清华大学 The compression method and system of convolutional neural networks model for target detection

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018000309A1 (en) * 2016-06-30 2018-01-04 Intel Corporation Importance-aware model pruning and re-training for efficient convolutional neural networks
US20180096249A1 (en) * 2016-10-04 2018-04-05 Electronics And Telecommunications Research Institute Convolutional neural network system using adaptive pruning and weight sharing and operation method thereof
US20180204108A1 (en) * 2017-01-18 2018-07-19 Microsoft Technology Licensing, Llc Automated activity-time training
CN107368885A (en) * 2017-07-13 2017-11-21 北京智芯原动科技有限公司 Network model compression method and device based on more granularity beta prunings
CN107516129A (en) * 2017-08-01 2017-12-26 北京大学 The depth Web compression method decomposed based on the adaptive Tucker of dimension
CN108288270A (en) * 2018-02-05 2018-07-17 南京邮电大学 A kind of object detection method based on channel trimming and full convolution deep learning
CN108806698A (en) * 2018-03-15 2018-11-13 中山大学 A kind of camouflage audio recognition method based on convolutional neural networks
CN108898168A (en) * 2018-06-19 2018-11-27 清华大学 The compression method and system of convolutional neural networks model for target detection

Non-Patent Citations (6)

* Cited by examiner, † Cited by third party
Title
SETIONO R ETAL.: "Neural-network feature selector", 《IEEE TRANSACTIONS ON NEURAL NETWORKS》 *
YIHUI HE ETAL.: "Channel Pruning for Accelerating Very Deep Neural Networks", 《2017 IEEE INTERNATIONAL CONFERENCE ON COMPUTER VISION (ICCV)》 *
ZHUANG LIU ETAL.: "Learning Efficient Convolutional Networks through Network Slimming", 《2017 IEEE INTERNATIONAL CONFERENCE ON COMPUTER VISION (ICCV)》 *
孔英会 等: "复杂背景下基于MobileNets的花卉识别与模型剪枝", 《科学技术与工程》 *
纪荣嵘 等: "深度神经网络压缩与加速综述", 《计算机研究与发展》 *
靳丽蕾 等: "一种用于卷积神经网络压缩的混合剪枝方法", 《小型微型计算机系统》 *

Cited By (35)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111695375A (en) * 2019-03-13 2020-09-22 上海云从企业发展有限公司 Face recognition model compression algorithm based on model distillation, medium and terminal
CN110006650A (en) * 2019-03-18 2019-07-12 华中科技大学 A kind of method for diagnosing faults based on the sparse denoising autocoder of stack beta pruning
CN109977845A (en) * 2019-03-21 2019-07-05 百度在线网络技术(北京)有限公司 A kind of drivable region detection method and car-mounted terminal
CN110084281A (en) * 2019-03-31 2019-08-02 华为技术有限公司 Image generating method, the compression method of neural network and relevant apparatus, equipment
WO2020200213A1 (en) * 2019-03-31 2020-10-08 华为技术有限公司 Image generating method, neural network compression method, and related apparatus and device
CN110084281B (en) * 2019-03-31 2023-09-12 华为技术有限公司 Image generation method, neural network compression method, related device and equipment
CN110276450A (en) * 2019-06-25 2019-09-24 交叉信息核心技术研究院(西安)有限公司 Deep neural network structural sparse system and method based on more granularities
CN110276450B (en) * 2019-06-25 2021-07-06 交叉信息核心技术研究院(西安)有限公司 Deep neural network structured sparse system and method based on multiple granularities
CN110472664A (en) * 2019-07-17 2019-11-19 杭州有盾网络科技有限公司 A kind of certificate image identification method, device and equipment based on deep learning
CN110598848A (en) * 2019-08-16 2019-12-20 中国科学院计算技术研究所 Migration learning acceleration method based on channel pruning
CN110543900A (en) * 2019-08-21 2019-12-06 北京市商汤科技开发有限公司 Image processing method and device, electronic equipment and storage medium
CN112489769A (en) * 2019-08-22 2021-03-12 浙江远图互联科技股份有限公司 Intelligent traditional Chinese medicine diagnosis and medicine recommendation system for chronic diseases based on deep neural network
CN112489769B (en) * 2019-08-22 2024-05-17 浙江远图技术股份有限公司 Chronic disease intelligent Chinese medicine diagnosis and medicine recommendation system based on deep neural network
CN110710759A (en) * 2019-09-09 2020-01-21 丁金波 Sole spouts gluey system based on 3D scanning and vision are rectified
CN110619391B (en) * 2019-09-19 2023-04-18 华南理工大学 Detection model compression method and device and computer readable storage medium
CN110619391A (en) * 2019-09-19 2019-12-27 华南理工大学 Detection model compression method and device and computer readable storage medium
CN111008640B (en) * 2019-10-17 2024-03-19 平安科技(深圳)有限公司 Image recognition model training and image recognition method, device, terminal and medium
CN111008640A (en) * 2019-10-17 2020-04-14 平安科技(深圳)有限公司 Image recognition model training and image recognition method, device, terminal and medium
CN112884142A (en) * 2019-11-29 2021-06-01 北京市商汤科技开发有限公司 Neural network training method, neural network training device, target detection method, target detection device, equipment and storage medium
CN112884142B (en) * 2019-11-29 2022-11-22 北京市商汤科技开发有限公司 Neural network training method, target detection method, device, equipment and storage medium
CN111062477A (en) * 2019-12-17 2020-04-24 腾讯云计算(北京)有限责任公司 Data processing method, device and storage medium
CN111062477B (en) * 2019-12-17 2023-12-08 腾讯云计算(北京)有限责任公司 Data processing method, device and storage medium
CN111291817A (en) * 2020-02-17 2020-06-16 北京迈格威科技有限公司 Image recognition method and device, electronic equipment and computer readable medium
CN111291817B (en) * 2020-02-17 2024-01-23 北京迈格威科技有限公司 Image recognition method, image recognition device, electronic equipment and computer readable medium
CN113408561A (en) * 2020-03-17 2021-09-17 北京京东乾石科技有限公司 Model generation method, target detection method, device, equipment and storage medium
WO2021185121A1 (en) * 2020-03-17 2021-09-23 北京京东乾石科技有限公司 Model generation method and apparatus, object detection method and apparatus, device, and storage medium
CN111598322A (en) * 2020-05-09 2020-08-28 东软医疗系统股份有限公司 Medical equipment fault prediction method, device, medium and electronic equipment
CN111931914A (en) * 2020-08-10 2020-11-13 北京计算机技术及应用研究所 Convolutional neural network channel pruning method based on model fine tuning
CN111898591B (en) * 2020-08-28 2022-06-24 电子科技大学 Modulation signal identification method based on pruning residual error network
CN111898591A (en) * 2020-08-28 2020-11-06 电子科技大学 Modulation signal identification method based on pruning residual error network
CN112686145A (en) * 2020-12-29 2021-04-20 广东各有所爱信息科技有限公司 Facial skin type identification method and intelligent terminal thereof
CN112633400A (en) * 2020-12-29 2021-04-09 山东省海洋生物研究院 Shellfish classification and identification method and device based on computer vision
CN113505804A (en) * 2021-05-19 2021-10-15 山东师范大学 Image identification method and system based on compressed deep neural network
CN118365968A (en) * 2024-06-18 2024-07-19 中山市人民医院 Prostate cancer image recognition method and device
CN118365968B (en) * 2024-06-18 2024-09-06 中山市人民医院 Prostate cancer image recognition method and device

Also Published As

Publication number Publication date
CN109344921B (en) 2019-04-23

Similar Documents

Publication Publication Date Title
CN109344921B (en) A kind of image-recognizing method based on deep neural network model, device and equipment
CN109242033B (en) Wafer defect mode classification method and device, storage medium and electronic equipment
CN113420651B (en) Light weight method, system and target detection method for deep convolutional neural network
CN107679572B (en) Image distinguishing method, storage device and mobile terminal
CN112287986B (en) Image processing method, device, equipment and readable storage medium
CN110111334A (en) A kind of crack dividing method, device, electronic equipment and storage medium
CN110827297A (en) Insulator segmentation method for generating countermeasure network based on improved conditions
CN111723915A (en) Pruning method of deep convolutional neural network, computer equipment and application method
CN109284761B (en) Image feature extraction method, device and equipment and readable storage medium
US20210073633A1 (en) Neural network rank optimization device and optimization method
CN113657421A (en) Convolutional neural network compression method and device and image classification method and device
CN109800815B (en) Training method, wheat recognition method and training system based on random forest model
CN113257238B (en) Training method of pre-training model, coding feature acquisition method and related device
CN112132279A (en) Convolutional neural network model compression method, device, equipment and storage medium
CN114429208A (en) Model compression method, device, equipment and medium based on residual structure pruning
CN117217281B (en) Convolutional neural network lightweight pruning method and system based on multi-view features
CN114781779A (en) Unsupervised energy consumption abnormity detection method and device and storage medium
CN114494809A (en) Feature extraction model optimization method and device and electronic equipment
CN111414993B (en) Convolutional neural network clipping and convolutional calculation method and device
CN113839799A (en) Alarm association rule mining method and device
KR20210029595A (en) Keyword Spotting Apparatus, Method and Computer Readable Recording Medium Thereof
CN115565010A (en) Image processing method, device and equipment and readable storage medium
CN112200275B (en) Artificial neural network quantification method and device
CN115358473A (en) Power load prediction method and prediction system based on deep learning
CN114494782A (en) Image processing method, model training method, related device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant