CN109034249B - Convolution optimization method and device based on decomposed radial symmetric convolution kernel, terminal equipment and computer readable storage medium - Google Patents

Convolution optimization method and device based on decomposed radial symmetric convolution kernel, terminal equipment and computer readable storage medium Download PDF

Info

Publication number
CN109034249B
CN109034249B CN201810852407.5A CN201810852407A CN109034249B CN 109034249 B CN109034249 B CN 109034249B CN 201810852407 A CN201810852407 A CN 201810852407A CN 109034249 B CN109034249 B CN 109034249B
Authority
CN
China
Prior art keywords
convolution
feature map
image
decomposed
convolution kernel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810852407.5A
Other languages
Chinese (zh)
Other versions
CN109034249A (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.)
Guangzhou University
Original Assignee
Guangzhou University
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 Guangzhou University filed Critical Guangzhou University
Priority to CN201810852407.5A priority Critical patent/CN109034249B/en
Publication of CN109034249A publication Critical patent/CN109034249A/en
Application granted granted Critical
Publication of CN109034249B publication Critical patent/CN109034249B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • General Engineering & Computer Science (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Multimedia (AREA)
  • Image Analysis (AREA)

Abstract

The invention discloses a convolution optimization method, a device, terminal equipment and a computer readable storage medium based on a decomposed radial symmetric convolution kernel, wherein the method comprises the following steps: inputting an image to be recognized, and preprocessing the image to be recognized; respectively convolving the preprocessed image to be recognized by using 1 convolution kernel of 1 × 1 and (m-1)/2 convolution kernels of 1 × m (m is 2k +3, k belongs to N) obtained by decomposing m × m radial symmetric convolution kernels in advance to obtain 1 first feature map of 1 × 1 and (m-1)/2 second feature maps of 1 m (m is 2k +3, k belongs to N); further performing convolution on the second feature map to obtain a third feature map; the method comprises the steps of obtaining a first characteristic diagram and a second characteristic diagram (a third characteristic diagram) from a first image, obtaining a target characteristic diagram, and outputting the target characteristic diagram.

Description

Convolution optimization method and device based on decomposed radial symmetric convolution kernel, terminal equipment and computer readable storage medium
Technical Field
The invention relates to the technical field of neural networks, in particular to a convolution optimization method and device based on a decomposed radial symmetric convolution kernel, terminal equipment and a computer readable storage medium.
Background
The Convolutional Neural Network (CNN) is a neural network which is most commonly used in the field of image processing and recognition in recent years, and has the advantages of good feature classification effect and easiness in high-dimensional data processing, but the convolutional neural network is easy to generate an overfitting phenomenon, and the robustness of the convolutional neural network is low, so that in the traditional convolutional neural network construction, an original training set picture is often subjected to mirroring and large-angle rotation processing to increase the robustness of the convolutional neural network, and the convolutional neural network can recognize pictures at any angle; however, this conventional method has a problem that the amount of data increases, and the training time increases.
In the prior art, in response to the problems of the conventional method, a convolution kernel with radial symmetry property is generally adopted, which can provide good robustness in the use of a convolutional neural network and can reduce the possibility of occurrence of an overfitting phenomenon. However, the calculation amount of the radial symmetric convolution kernel is too large in operation, and the conventional technical scheme for solving the problem of the too large calculation amount mainly adopts a convolution kernel clipping method and a multi-channel convolution optimization algorithm in a convolution neural network. However, when implementing the prior art solutions, the inventors have found that these optimization algorithms suffer from an excessive number of parameters in use.
Disclosure of Invention
The technical problem to be solved by the present invention is to provide a convolution optimization method, apparatus, terminal device and computer readable storage medium based on decomposed radial symmetric convolution kernel, so as to achieve the purpose of optimizing convolution by reducing parameters on the basis of reducing the calculation amount of radial symmetric convolution kernel.
In order to solve the above technical problem, an embodiment of the present invention provides a convolution optimization method based on a decomposed radially symmetric convolution kernel, which is suitable for being executed in a computing device, and includes the following steps:
inputting an image to be recognized, and preprocessing the image to be recognized;
respectively convolving the preprocessed image to be recognized by using 1 convolution kernel of 1 × 1 and (m-1)/2 convolution kernels of 1 × m (m is 2k +3, k belongs to N) obtained by decomposing m × m radial symmetric convolution kernels in advance to obtain 1 first feature map of 1 × 1 and (m-1)/2 second feature maps of 1 m (m is 2k +3, k belongs to N); then, convolving (m-1)/2 second feature maps of 1 m (m is 2k +3, k is N) by using convolution kernels of (m-1)/2 m (m is 2k +3, k is N) which are obtained by decomposing m radial symmetric convolution kernels in advance and correspond to the convolution kernels of (m-1)/2 m (m is 2k +3, k is N) one by one to obtain a third feature map of (m-1)/2 m 1(m is 2k +3, k is N);
and summing the 1 first feature map of 1 × 1 and the third feature map of (m-1)/2 m × 1(m is 2k +3, k is equal to N) to obtain a target feature map, and outputting the target feature map.
Further, the preprocessing the image to be recognized specifically includes:
according to preset parameters, randomly stretching and shading the image to be identified, and adding specific Gaussian noise;
and further, according to the requirement of convolution processing, rotating and cutting the image to be identified by an angle of 0-pi/2.
Further, the convolution kernel matrix a of each convolution kernel satisfies the following formula:
Figure BDA0001746392170000021
wherein,
Figure BDA0001746392170000022
further, each convolution kernel of m × 1(m ═ 2k +3, k ∈ N) and a corresponding convolution kernel of m × 1(m ═ 2k +3, k ∈ N) form an equal ratio symmetric vector group, i.e. ISV, specifically:
let anIs a parameter value, a1Constantly equal to 1, the length of the ISV is m (m ═ 2k +3, k ∈ N),
ISV=(ISV_1,ISV_2);
wherein, ISV _1 is a vector of 1 × m, and ISV _2 is a vector of m × 1;
Figure BDA0001746392170000023
Figure BDA0001746392170000024
further, after the summing the 1 first feature map of 1 × 1 and the third feature map of (m-1)/2 m × 1(m ═ 2k +3, k ∈ N) to obtain the target feature map, and outputting the target feature map, the method further includes:
judging whether the direction of the image has influence on the recognition result;
if so, 1 first feature map of 1 × 1 and (m-1)/2 third feature maps of m × 1(m is 2k +3, k ∈ N) are subjected to global average pooling, and output 1+ (m-1)/2 values are subjected to softmax processing, so that the probability of the target feature map is obtained.
Further, the convolution optimization method based on the decomposed radial symmetric convolution kernel further includes:
and if not, performing spatial pyramid pooling and full-connection layer processing on 1 first feature map of 1 × 1 and (m-1)/2 third feature maps of m × 1(m is 2k +3, and k belongs to N), and performing softmax processing on the output 1+ (m-1)/2 values to obtain a judgment result of the target feature map.
An embodiment of the present invention further provides a convolution optimization apparatus based on decomposed radially symmetric convolution kernels, including:
the input module is used for inputting an image to be recognized and preprocessing the image to be recognized;
a convolution optimization module, configured to convolve the preprocessed image to be recognized by using 1 convolution kernel of 1 × 1 and (m-1)/2 convolution kernels of 1 × m (m ═ 2k +3, k ∈ N), which are obtained by decomposing m × m radial symmetric convolution kernels in advance, to obtain 1 first feature map of 1 × 1 and (m-1)/2 second feature maps of 1 m (m ═ 2k +3, k ∈ N); then, convolving (m-1)/2 second feature maps of 1 m (m is 2k +3, k is N) by using convolution kernels of (m-1)/2 m (m is 2k +3, k is N) which are obtained by decomposing m radial symmetric convolution kernels in advance and correspond to the convolution kernels of (m-1)/2 m (m is 2k +3, k is N) one by one to obtain a third feature map of (m-1)/2 m 1(m is 2k +3, k is N);
and the output module is used for summing the 1 first feature map with 1 x 1 and the third feature map with (m-1)/2 m x 1(m is 2k +3, k belongs to N) to obtain a target feature map and outputting the target feature map.
Further, each convolution kernel of m × 1(m ═ 2k +3, k ∈ N) and a corresponding convolution kernel of m × 1(m ═ 2k +3, k ∈ N) form an equal ratio symmetric vector group, i.e. ISV, specifically:
let anIs a parameter value, a1Constantly equal to 1, the length of the ISV is m (m ═ 2k +3, k ∈ N),
ISV=(ISV_1,ISV_2);
wherein, ISV _1 is a vector of 1 × m, and ISV _2 is a vector of m × 1;
Figure BDA0001746392170000031
Figure BDA0001746392170000032
an embodiment of the present invention further provides a convolution optimization terminal device based on a decomposed radial symmetric convolution kernel, including: a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, the processor implementing a method of convolution optimization based on a decomposed radially symmetric convolution kernel as described above when executing the computer program.
An embodiment of the present invention further provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program runs, the apparatus on which the computer-readable storage medium is located is controlled to execute the above-mentioned convolution optimization method based on decomposed radial symmetric convolution kernel.
Compared with the prior art, the embodiment of the invention has the beneficial effects that:
the invention provides a convolution optimization method, a convolution optimization device, terminal equipment and a computer readable storage medium based on a decomposed radial symmetric convolution kernel, wherein the method comprises the following steps: inputting an image to be recognized, and preprocessing the image to be recognized; respectively convolving the preprocessed image to be recognized by using 1 convolution kernel of 1 × 1 and (m-1)/2 convolution kernels of 1 × m (m is 2k +3, k belongs to N) obtained by decomposing m × m radial symmetric convolution kernels in advance to obtain 1 first feature map of 1 × 1 and (m-1)/2 second feature maps of 1 m (m is 2k +3, k belongs to N); performing convolution on the (m-1)/2 second feature maps of 1 × m (m ═ 2k +3, k ∈ N) by using convolution kernels of (m-1)/2 m × 1(m ═ 2k +3, k ∈ N) which are in one-to-one correspondence with the convolution kernels of (m-1)/2 m (m ═ 2k +3, k ∈ N), so as to obtain a third feature map of (m-1)/2 m × 1(m ═ 2k +3, k ∈ N); and summing the 1 first feature map of 1 × 1 and the third feature map of (m-1)/2 m × 1(m is 2k +3, k is equal to N) to obtain a target feature map, and outputting the target feature map. The invention achieves the aim of optimizing the convolution by reducing the parameter quantity on the basis of reducing the calculation quantity of the radial symmetric convolution kernel.
Drawings
FIG. 1 is a flowchart illustrating a convolution optimization method based on decomposed radially symmetric convolution kernels according to a first embodiment of the present invention;
FIG. 2 is a schematic flow chart of the process of the decomposed 3 x 3 radially symmetric convolution kernel to check an image according to the first embodiment of the present invention;
FIG. 3 is a schematic flow chart of a process for processing a decomposed 5 x 5 radially symmetric convolution kernel on an image according to a first embodiment of the present invention;
FIG. 4 is a schematic flow chart of a process for processing a decomposed m x m radially symmetric convolution kernel on an image according to a first embodiment of the present invention;
FIG. 5 is a flowchart illustrating a procedure of classifying images of cats and dogs by a neural network including a decomposed symmetric convolution kernel according to a first embodiment of the present invention;
FIG. 6 is a flow chart illustrating the process of a neural network with decomposed symmetric convolution kernels to classify MNIST images according to a first embodiment of the present invention;
fig. 7 is a schematic structural diagram of a convolution optimization apparatus based on a decomposed radially symmetric convolution kernel according to a second embodiment of the present invention.
Detailed Description
In the following, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention so that the advantages and features of the present invention can be more easily understood by those skilled in the art, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments. 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 of the present invention:
please refer to fig. 1-5.
As shown in fig. 1, the present embodiment provides a convolution optimization method based on a decomposed radial symmetric convolution kernel, where the convolution optimization method based on a decomposed radial symmetric convolution kernel is suitable for being executed in a computing device, and includes the following steps:
s101, inputting an image to be identified, and preprocessing the image to be identified;
s102, respectively utilizing 1 convolution kernel of 1 × 1 and (m-1)/2 convolution kernels of 1 × m (m ═ 2k +3, k ∈ N) obtained by decomposing m × m radial symmetric convolution kernels in advance to convolve the preprocessed image to be recognized, and obtaining 1 first feature map of 1 × 1 and (m-1)/2 second feature maps of 1 m (m ═ 2k +3, k ∈ N); then, convolving (m-1)/2 second feature maps of 1 m (m is 2k +3, k is N) by using convolution kernels of (m-1)/2 m (m is 2k +3, k is N) which are obtained by decomposing m radial symmetric convolution kernels in advance and correspond to the convolution kernels of (m-1)/2 m (m is 2k +3, k is N) one by one to obtain a third feature map of (m-1)/2 m 1(m is 2k +3, k is N);
and S103, summing the 1 first feature map of 1 x 1 and the third feature map of (m-1)/2 m x 1(m is 2k +3, k is equal to N) to obtain a target feature map, and outputting the target feature map.
The convolution optimization method based on the decomposed radial symmetric convolution kernel enhances robustness, reduces the number of parameters, accelerates the fitting speed of the neural network and prevents overfitting.
For step S101, the preprocessing the image to be recognized specifically includes:
according to preset parameters, randomly stretching and shading the image to be identified, and adding specific Gaussian noise;
and further, according to the requirement of convolution processing, rotating and cutting the image to be identified by an angle of 0-pi/2.
In the present embodiment, it can be understood that, in order to increase robustness, a slight gaussian noise is added to the image to be recognized to be input, and random stretching and shading change with small amplitude are performed. Due to the inherent advantages of the radial symmetric convolution kernel, the picture to be recognized does not need mirror image transformation, and meanwhile, the rotation step in the preprocessing only needs to rotate by an angle of 0-pi/2. Because the network only applies the convolutional neural network, the network has no full connection layer, and has no requirement on the size, and no processing is needed to be carried out on the picture size except for carrying out necessary cutting on the rotated picture.
For step S102, the convolution kernel matrix a of each convolution kernel satisfies the following formula:
Figure BDA0001746392170000051
wherein,
Figure BDA0001746392170000052
in this embodiment, two matrices are as follows:
Figure BDA0001746392170000053
Figure BDA0001746392170000061
taking into account that pictures are rotated
Figure BDA0001746392170000062
The pixel values change at multiple angles, only the angle of rotation being taken into account
Figure BDA0001746392170000063
The result of the convolution processing of the picture rotated by the angle theta is equal to the result obtained by directly processing the original picture, namely, the processed mirror image picture also generates the same result as the original picture.
It can be inferred that this is achieved by setting the convolution kernel to a matrix satisfying a when it is initialized.
In this embodiment, the convolution kernel, in addition to having good robustness, also reduces the large number of parameters that the conventional convolution kernel has
Figure BDA0001746392170000064
The number of times of the total number of the parts,
Figure BDA0001746392170000065
i.e. the method can reduce the maximum
Figure BDA0001746392170000066
The amount of the above-mentioned components. The convergence rate of the model is effectively accelerated, and overfitting is prevented.
The method has more obvious effect in a high-dimensional convolution network, and the kernel can be reduced at most in an x-dimensional convolution neural network
Figure BDA0001746392170000067
The optimization effect is very obvious.
In this embodiment, each convolution kernel of m × 1(m ═ 2k +3, k ∈ N) and a corresponding convolution kernel of m × 1(m ═ 2k +3, k ∈ N) form an equal ratio symmetric vector group, that is, ISV, specifically:
let anIs a parameter value, a1Constantly equal to 1, the length of the ISV is m (m ═ 2k +3, k ∈ N),
ISV=(ISV_1,ISV_2);
wherein, ISV _1 is a vector of 1 × m, and ISV _2 is a vector of m × 1;
Figure BDA0001746392170000068
Figure BDA0001746392170000069
in the present embodiment, since a large number of repeated operations are involved in the conventional convolution operation, which consumes much unnecessary operation time, the present embodiment decomposes the length-width-3 radially symmetric convolution kernel into a pair of length-3 ISV vectors and 1 × 1 convolution kernel combinations, and the specific variables of the convolution kernels are defined as follows:
ISV _1 convolution kernel:
Figure BDA00017463921700000610
ISV _2 convolution kernel:
Figure BDA00017463921700000611
1 x 1 convolution kernel:
Figure BDA00017463921700000612
a in the above convolution kernelnAnd b are parameter values.
As shown in fig. 2, the specific convolution process is as follows:
assuming that the original is P, firstly, an ISV _1 convolution kernel and a 1H 1 convolution kernel are respectively convolved on P to obtain feature maps P1 and P2, then, an ISV _2 convolution kernel is used for convolving P1 to obtain a feature map P3, and then, P2 and P3 are added to obtain an output feature map P _ output.
Through mathematical operation, the convolution process in the convolution process is equivalent to using convolution kernel shape
Figure BDA0001746392170000071
The radially symmetrical convolution kernel is used for convolution, in addition, only 7 times of multiplication operation and 5 times of addition operation are used for the same pixel point in the convolution process, 9 times of multiplication and 8 times of addition operation are required in the traditional convolution operation, and a lot of operation time is reduced.
In this embodiment, as shown in fig. 3, it is preferable that, if 5 × 5 radially symmetric convolution kernels are to be applied, they can be decomposed into two pairs of ISV vectors with lengths of 5, 3 and 1 × 1 convolution kernel combinations (a of each ISV pair)nAll different).
Further, as shown in fig. 4, to generalize, if a radially symmetric convolution kernel of m × m (m × 2k +3, k ∈ N) is to be applied, it can be decomposed into (m-1)/2 pairs of ISV vectors with lengths of 3,5,7, …, m and convolution kernel combinations of 1 ∈ 1, respectively.
In this embodiment, according to the above description, this operation method can greatly reduce the operation amount when the convolution kernel size is large, and when the convolution kernel size is m × m, the operation amount of multiplication is the original one
Figure BDA0001746392170000073
The operation amount of addition is the original one
Figure BDA0001746392170000072
And (4) doubling.
For step S103, further, after the summing the 1 first feature map of 1 × 1 and the (m-1)/2 third feature maps of m × 1(m ═ 2k +3, k ∈ N) to obtain a target feature map, and outputting the target feature map, the method further includes:
judging whether the direction of the image has influence on the recognition result;
if so, 1 first feature map of 1 × 1 and (m-1)/2 third feature maps of m × 1(m is 2k +3, k ∈ N) are subjected to global average pooling, and output 1+ (m-1)/2 values are subjected to softmax processing, so that the probability of the target feature map is obtained.
In the embodiment, the convolution kernel splitting algorithm can obviously reduce the operation amount in the high-dimensional convolution kernel. As shown in fig. 5, cat and dog are classified and identified by using decomposed radial symmetric convolutional network.
In the construction of the neural network, 8 layers of 3-by-3 decomposed radial symmetric convolution network are used at the front end of the network, and residual layers are connected in the network, so that the gradient is prevented from disappearing.
Because the direction of the image has no influence on the recognition result, the last two feature maps are averaged and pooled by adopting a global average pooling method at the tail end of the neural network, and the probability of being a cat or a dog is obtained by performing softmax processing on the two output values
Further, the convolution optimization method based on the decomposed radial symmetric convolution kernel further includes:
and if not, performing spatial pyramid pooling and full-connection layer processing on 1 first feature map of 1 × 1 and (m-1)/2 third feature maps of m × 1(m is 2k +3, and k belongs to N), and performing softmax processing on the output 1+ (m-1)/2 values to obtain a judgment result of the target feature map.
In this embodiment, as shown in fig. 6, the MNIST dataset is identified using a decomposed radially symmetric convolutional network:
in the image processing stage, the preprocessing method described above is still used, except that no rotation is involved in the preprocessing. The main body of the neural network also adopts a radial symmetric convolution network of 3 x 3 decomposition using 8 layers at the front end of the network, and connects residual layers therein to prevent gradient disappearance. But the number of layers of the neural network is correspondingly reduced due to the reduction of data.
Since the direction of the image has an influence on the recognition result, if the recognition 6 and 9 are wrong due to uncertain direction, the spatial pyramid pooling and the full connection layer collocation softmax are adopted at the end of the neural network to output the result judged as each number.
It should be noted that these are just two simple examples in this embodiment, and the network can be used in a larger and more complex recognition system and achieve good results.
The convolution optimization method based on the decomposed radial symmetric convolution kernel provided by the embodiment comprises the following steps: inputting an image to be recognized, and preprocessing the image to be recognized; respectively convolving the preprocessed image to be recognized by using 1 convolution kernel of 1 × 1 and (m-1)/2 convolution kernels of 1 × m (m is 2k +3, k belongs to N) obtained by decomposing m × m radial symmetric convolution kernels in advance to obtain 1 first feature map of 1 × 1 and (m-1)/2 second feature maps of 1 m (m is 2k +3, k belongs to N); performing convolution on the (m-1)/2 second feature maps of 1 × m (m ═ 2k +3, k ∈ N) by using convolution kernels of (m-1)/2 m × 1(m ═ 2k +3, k ∈ N) which are in one-to-one correspondence with the convolution kernels of (m-1)/2 m (m ═ 2k +3, k ∈ N), so as to obtain a third feature map of (m-1)/2 m × 1(m ═ 2k +3, k ∈ N); and summing the 1 first feature map of 1 × 1 and the third feature map of (m-1)/2 m × 1(m is 2k +3, k is equal to N) to obtain a target feature map, and outputting the target feature map. The embodiment reduces the parameter quantity on the basis of reducing the calculation quantity of the radial symmetric convolution kernel, thereby achieving the purpose of optimizing the convolution.
Second embodiment of the invention:
please refer to fig. 7.
As shown in fig. 7, this embodiment further provides a convolution optimization apparatus based on decomposed radially symmetric convolution kernels, including:
the input module 201 is configured to input an image to be recognized and perform preprocessing on the image to be recognized.
The preprocessing is performed on the image to be identified, and specifically comprises the following steps:
according to preset parameters, randomly stretching and shading the image to be identified, and adding specific Gaussian noise;
and further, according to the requirement of convolution processing, rotating and cutting the image to be identified by an angle of 0-pi/2.
In the present embodiment, it can be understood that, in order to increase robustness, a slight gaussian noise is added to the image to be recognized to be input, and random stretching and shading change with small amplitude are performed. Due to the inherent advantages of the radial symmetric convolution kernel, the picture to be recognized does not need mirror image transformation, and meanwhile, the rotation step in the preprocessing only needs to rotate by an angle of 0-pi/2. Because the network only applies the convolutional neural network, the network has no full connection layer, and has no requirement on the size, and no processing is needed to be carried out on the picture size except for carrying out necessary cutting on the rotated picture.
A convolution optimization module 202, configured to convolve the preprocessed image to be recognized by using 1 convolution kernel of 1 × 1 and (m-1)/2 convolution kernels of 1 × m (m ═ 2k +3, k ∈ N) obtained by decomposing m × m radial symmetric convolution kernels in advance, respectively, to obtain 1 first feature map of 1 × 1 and (m-1)/2 second feature maps of 1 m (m ═ 2k +3, k ∈ N); and then (m-1)/2 convolution kernels of m-1 (m-2 k +3, k epsilon N) which are obtained by decomposing m-m radial symmetric convolution kernels in advance and correspond to the convolution kernels of (m-1)/2 m-1 (m-2 k +3, k epsilon N) in a one-to-one mode are utilized to perform convolution on the second feature map of (m-1)/2 m (m-2 k +3, k epsilon N) so as to obtain a third feature map of (m-1)/2 m-1 (m-2 k +3, k epsilon N).
Wherein, the convolution kernel matrix A of each convolution kernel satisfies the following formula:
Figure BDA0001746392170000091
wherein,
Figure BDA0001746392170000092
in this embodiment, two matrices are as follows:
Figure BDA0001746392170000093
Figure BDA0001746392170000094
taking into account that pictures are rotated
Figure BDA0001746392170000095
The pixel values change at multiple angles, only the angle of rotation being taken into account
Figure BDA0001746392170000096
The result of the picture rotated by the angle theta in the convolution processing A is equal to the result obtained by directly processing the original picture,i.e. processing the mirror image picture will produce the same result as the original picture.
It can be inferred that this is achieved by setting the convolution kernel to a matrix satisfying a when it is initialized.
In this embodiment, the convolution kernel, in addition to having good robustness, also reduces the large number of parameters that the conventional convolution kernel has
Figure BDA0001746392170000097
The number of times of the total number of the parts,
Figure BDA0001746392170000098
i.e. the method can reduce the maximum
Figure BDA0001746392170000099
The amount of the above-mentioned components. The convergence rate of the model is effectively accelerated, and overfitting is prevented.
The method has more obvious effect in a high-dimensional convolution network, and the kernel can be reduced at most in an x-dimensional convolution neural network
Figure BDA0001746392170000101
The optimization effect is very obvious.
In this embodiment, each convolution kernel of m × 1(m ═ 2k +3, k ∈ N) and a corresponding convolution kernel of m × 1(m ═ 2k +3, k ∈ N) form an equal ratio symmetric vector group, that is, ISV, specifically:
let anIs a parameter value, a1Constantly equal to 1, the length of the ISV is m (m ═ 2k +3, k ∈ N),
ISV=(ISV_1,ISV_2);
wherein, ISV _1 is a vector of 1 × m, and ISV _2 is a vector of m × 1;
Figure BDA0001746392170000102
Figure BDA0001746392170000103
in the present embodiment, since a large number of repeated operations are involved in the conventional convolution operation, which consumes much unnecessary operation time, the present embodiment decomposes the length-width-3 radially symmetric convolution kernel into a pair of length-3 ISV vectors and 1 × 1 convolution kernel combinations, and the specific variables of the convolution kernels are defined as follows:
ISV _1 convolution kernel:
Figure BDA0001746392170000104
ISV _2 convolution kernel:
Figure BDA0001746392170000105
1 x 1 convolution kernel:
Figure BDA0001746392170000106
a in the above convolution kernelnAnd b are parameter values.
As shown in fig. 2, the specific convolution process is as follows:
assuming that the original is P, firstly, an ISV _1 convolution kernel and a 1H 1 convolution kernel are respectively convolved on P to obtain feature maps P1 and P2, then, an ISV _2 convolution kernel is used for convolving P1 to obtain a feature map P3, and then, P2 and P3 are added to obtain an output feature map P _ output.
Through mathematical operation, the convolution process in the convolution process is equivalent to using convolution kernel shape
Figure BDA0001746392170000107
The radially symmetrical convolution kernel is used for convolution, in addition, only 7 times of multiplication operation and 5 times of addition operation are used for the same pixel point in the convolution process, 9 times of multiplication and 8 times of addition operation are required in the traditional convolution operation, and a lot of operation time is reduced.
In this embodiment, as shown in FIG. 3, it is preferable if application is to be made5 x 5 radially symmetric convolution kernels, which can be decomposed into two pairs of ISV vectors of length 5, 3 and 1 x 1 convolution kernel combinations (a for each ISV pairnAll different).
Further, as shown in fig. 4, to generalize, if a radially symmetric convolution kernel of m × m (m × 2k +3, k ∈ N) is to be applied, it can be decomposed into (m-1)/2 pairs of ISV vectors with lengths of 3,5,7, …, m and convolution kernel combinations of 1 ∈ 1, respectively.
In this embodiment, according to the above description, this operation method can greatly reduce the operation amount when the convolution kernel size is large, and when the convolution kernel size is m × m, the operation amount of multiplication is the original one
Figure BDA0001746392170000111
The operation amount of addition is the original one
Figure BDA0001746392170000112
And (4) doubling.
And the output module 203 is configured to sum up 1 first feature map of 1 × 1 and (m-1)/2 third feature maps of m × 1(m is 2k +3, and k ∈ N) to obtain a target feature map, and output the target feature map.
Further, after the summing the 1 first feature map of 1 × 1 and the third feature map of (m-1)/2 m × 1(m ═ 2k +3, k ∈ N) to obtain the target feature map, and outputting the target feature map, the method further includes:
judging whether the direction of the image has influence on the recognition result;
if so, 1 first feature map of 1 × 1 and (m-1)/2 third feature maps of m × 1(m is 2k +3, k ∈ N) are subjected to global average pooling, and output 1+ (m-1)/2 values are subjected to softmax processing, so that the probability of the target feature map is obtained.
In the embodiment, the convolution kernel splitting algorithm can obviously reduce the operation amount in the high-dimensional convolution kernel. As shown in fig. 5, cat and dog are classified and identified by using decomposed radial symmetric convolutional network.
In the construction of the neural network, 8 layers of 3-by-3 decomposed radial symmetric convolution network are used at the front end of the network, and residual layers are connected in the network, so that the gradient is prevented from disappearing.
Because the direction of the image has no influence on the recognition result, the last two feature maps are averaged and pooled by adopting a global average pooling method at the tail end of the neural network, and the probability of being a cat or a dog is obtained by performing softmax processing on the two output values
Further, the convolution optimization method based on the decomposed radial symmetric convolution kernel further includes:
and if not, performing spatial pyramid pooling and full-connection layer processing on 1 first feature map of 1 × 1 and (m-1)/2 third feature maps of m × 1(m is 2k +3, and k belongs to N), and performing softmax processing on the output 1+ (m-1)/2 values to obtain a judgment result of the target feature map.
In this embodiment, as shown in fig. 6, the MNIST dataset is identified using a decomposed radially symmetric convolutional network:
in the image processing stage, the preprocessing method described above is still used, except that no rotation is involved in the preprocessing. The main body of the neural network also adopts a radial symmetric convolution network of 3 x 3 decomposition using 8 layers at the front end of the network, and connects residual layers therein to prevent gradient disappearance. But the number of layers of the neural network is correspondingly reduced due to the reduction of data.
Since the direction of the image has an influence on the recognition result, if the recognition 6 and 9 are wrong due to uncertain direction, the spatial pyramid pooling and the full connection layer collocation softmax are adopted at the end of the neural network to output the result judged as each number.
It should be noted that these are just two simple examples in this embodiment, and the network can be used in a larger and more complex recognition system and achieve good results.
According to the convolution optimization device based on the decomposed radial symmetric convolution kernel, an image to be recognized is input, and the image to be recognized is preprocessed; respectively convolving the preprocessed image to be recognized by using 1 convolution kernel of 1 × 1 and (m-1)/2 convolution kernels of 1 × m (m is 2k +3, k belongs to N) obtained by decomposing m × m radial symmetric convolution kernels in advance to obtain 1 first feature map of 1 × 1 and (m-1)/2 second feature maps of 1 m (m is 2k +3, k belongs to N); performing convolution on the (m-1)/2 second feature maps of 1 × m (m ═ 2k +3, k ∈ N) by using convolution kernels of (m-1)/2 m × 1(m ═ 2k +3, k ∈ N) which are in one-to-one correspondence with the convolution kernels of (m-1)/2 m (m ═ 2k +3, k ∈ N), so as to obtain a third feature map of (m-1)/2 m × 1(m ═ 2k +3, k ∈ N); and summing the 1 first feature map of 1 × 1 and the third feature map of (m-1)/2 m × 1(m is 2k +3, k is equal to N) to obtain a target feature map, and outputting the target feature map. The embodiment reduces the parameter quantity on the basis of reducing the calculation quantity of the radial symmetric convolution kernel, thereby achieving the purpose of optimizing the convolution.
An embodiment of the present invention further provides a convolution optimization terminal device based on a decomposed radial symmetric convolution kernel, including: a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, the processor implementing a method of convolution optimization based on a decomposed radially symmetric convolution kernel as described above when executing the computer program.
An embodiment of the present invention further provides a computer-readable storage medium, which includes a stored computer program, wherein when the computer program runs, the apparatus on which the computer-readable storage medium is located is controlled to execute the above-mentioned convolution optimization method based on decomposed radial symmetric convolution kernel.
Compared with the prior art, the embodiment of the invention has the beneficial effects that:
the invention provides a convolution optimization method, a convolution optimization device, terminal equipment and a computer readable storage medium based on a decomposed radial symmetric convolution kernel, wherein the method comprises the following steps: inputting an image to be recognized, and preprocessing the image to be recognized; respectively convolving the preprocessed image to be recognized by using 1 convolution kernel of 1 × 1 and (m-1)/2 convolution kernels of 1 × m (m is 2k +3, k belongs to N) obtained by decomposing m × m radial symmetric convolution kernels in advance to obtain 1 first feature map of 1 × 1 and (m-1)/2 second feature maps of 1 m (m is 2k +3, k belongs to N); performing convolution on the (m-1)/2 second feature maps of 1 × m (m ═ 2k +3, k ∈ N) by using convolution kernels of (m-1)/2 m × 1(m ═ 2k +3, k ∈ N) which are in one-to-one correspondence with the convolution kernels of (m-1)/2 m (m ═ 2k +3, k ∈ N), so as to obtain a third feature map of (m-1)/2 m × 1(m ═ 2k +3, k ∈ N); and summing the 1 first feature map of 1 × 1 and the third feature map of (m-1)/2 m × 1(m is 2k +3, k is equal to N) to obtain a target feature map, and outputting the target feature map. The invention reduces the parameter quantity on the basis of reducing the calculation quantity of the radial symmetric convolution kernel, thereby achieving the aim of optimizing the convolution
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.

Claims (7)

1. A convolution optimization method based on decomposed radially symmetric convolution kernels, adapted to be executed in a computing device, comprising the steps of:
inputting an image to be recognized, and preprocessing the image to be recognized, wherein the preprocessing comprises the following steps: according to preset parameters, randomly stretching and shading the image to be identified, and adding specific Gaussian noise; according to the requirement of convolution processing, rotating and cutting the image to be identified by an angle of 0-pi/2;
respectively utilizing 1 convolution kernel of 1 × 1 and (m-1)/2 convolution kernels of 1 × m obtained by pre-decomposing m × m radial symmetric convolution kernels to convolute the preprocessed image to be identified so as to obtain 1 first feature map of 1 × 1 and (m-1)/2 second feature maps of 1 × m; convolving (m-1)/2 second feature maps of 1 × m by using convolution kernels of (m-1)/2 m × 1, which are obtained by decomposing m × m radial symmetric convolution kernels in advance and correspond to (m-1)/2 convolution kernels of 1 × m in a one-to-one manner, so as to obtain third feature maps of (m-1)/2 m × 1;
summing 1 first feature map of 1 x 1 and (m-1)/2 third feature maps of m x 1 to obtain a target feature map, and outputting the target feature map; wherein m is 2k +3, and k is N.
2. A method of convolution optimization based on decomposed radially symmetric convolution kernels according to claim 1, characterized in that the convolution kernel matrix of each convolution kernel satisfies the following formula:
Figure FDA0003118710850000011
wherein,
Figure FDA0003118710850000012
3. the method of claim 1, wherein after summing the 1 first signature of 1 x 1 and the third signature of (m-1)/2 m x 1 to obtain the target signature, and outputting the target signature, the method further comprises:
judging whether the direction of the image has influence on the recognition result;
if yes, performing global average pooling on 1 first feature map with 1 × 1 and (m-1)/2 third feature maps with m × 1, and performing softmax processing on the output 1+ (m-1)/2 values to obtain the probability of the target feature map.
4. A method of convolution optimization based on decomposed radially symmetric convolution kernels according to claim 3, further comprising:
and if not, performing spatial pyramid pooling and full-connection layer processing on 1 first feature map of 1 × 1 and (m-1)/2 third feature maps of m × 1, and performing softmax processing on output 1+ (m-1)/2 values to obtain a judgment result of the target feature map.
5. A convolution optimization apparatus based on decomposed radially symmetric convolution kernels, comprising:
the input module is used for inputting an image to be recognized and preprocessing the image to be recognized, and comprises: according to preset parameters, randomly stretching and shading the image to be identified, and adding specific Gaussian noise; according to the requirement of convolution processing, rotating and cutting the image to be identified by an angle of 0-pi/2;
the convolution optimization module is used for performing convolution on the preprocessed image to be recognized by respectively utilizing 1 convolution kernel of 1 × 1 and (m-1)/2 convolution kernels of 1 × m obtained by pre-decomposing m × m radial symmetric convolution kernels to obtain 1 first feature map of 1 × 1 and (m-1)/2 second feature maps of 1 × m; convolving (m-1)/2 second feature maps of 1 × m by using convolution kernels of (m-1)/2 m × 1, which are obtained by decomposing m × m radial symmetric convolution kernels in advance and correspond to (m-1)/2 convolution kernels of 1 × m in a one-to-one manner, so as to obtain third feature maps of (m-1)/2 m × 1;
the output module is used for summing 1 first feature map of 1 x 1 and (m-1)/2 third feature maps of m x 1 to obtain a target feature map and outputting the target feature map; wherein m is 2k +3, and k is N.
6. A convolution optimization terminal device based on decomposed radial symmetric convolution kernels is characterized by comprising: a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, the computer program when executed by the processor implementing the method of convolution optimization based on decomposed radially symmetric convolution kernels of any of claims 1 to 4.
7. A computer-readable storage medium, comprising a stored computer program, wherein the computer program, when executed, controls an apparatus in which the computer-readable storage medium is located to perform a method of convolution optimization based on a decomposed radially symmetric convolution kernel according to any one of claims 1 to 4.
CN201810852407.5A 2018-07-27 2018-07-27 Convolution optimization method and device based on decomposed radial symmetric convolution kernel, terminal equipment and computer readable storage medium Active CN109034249B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810852407.5A CN109034249B (en) 2018-07-27 2018-07-27 Convolution optimization method and device based on decomposed radial symmetric convolution kernel, terminal equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810852407.5A CN109034249B (en) 2018-07-27 2018-07-27 Convolution optimization method and device based on decomposed radial symmetric convolution kernel, terminal equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN109034249A CN109034249A (en) 2018-12-18
CN109034249B true CN109034249B (en) 2021-08-06

Family

ID=64646640

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810852407.5A Active CN109034249B (en) 2018-07-27 2018-07-27 Convolution optimization method and device based on decomposed radial symmetric convolution kernel, terminal equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN109034249B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109886273B (en) * 2019-02-26 2022-12-16 四川大学华西医院 CMR image segmentation and classification system
CN109656623B (en) * 2019-03-13 2019-06-14 北京地平线机器人技术研发有限公司 It executes the method and device of convolution algorithm operation, generate the method and device of instruction
CN109978137B (en) * 2019-03-20 2021-03-16 厦门美图之家科技有限公司 Processing method of convolutional neural network
CN112712461B (en) * 2019-10-24 2024-04-19 Tcl科技集团股份有限公司 Image deconvolution processing method and device and terminal equipment
CN111680678B (en) * 2020-05-25 2022-09-16 腾讯科技(深圳)有限公司 Target area identification method, device, equipment and readable storage medium
CN113591025B (en) * 2021-08-03 2024-06-14 深圳思谋信息科技有限公司 Feature map processing method and device, convolutional neural network accelerator and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104346621A (en) * 2013-07-30 2015-02-11 展讯通信(天津)有限公司 Method and device for creating eye template as well as method and device for detecting eye state
CN105139017A (en) * 2015-08-27 2015-12-09 重庆理工大学 License plate positioning algorithm fusing affine invariant corner feature and visual color feature
CN106557743A (en) * 2016-10-26 2017-04-05 桂林电子科技大学 A kind of face characteristic extraction system and method based on FECNN
US9953236B1 (en) * 2017-03-10 2018-04-24 TuSimple System and method for semantic segmentation using dense upsampling convolution (DUC)
CN107967459A (en) * 2017-12-07 2018-04-27 北京小米移动软件有限公司 convolution processing method, device and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104346621A (en) * 2013-07-30 2015-02-11 展讯通信(天津)有限公司 Method and device for creating eye template as well as method and device for detecting eye state
CN105139017A (en) * 2015-08-27 2015-12-09 重庆理工大学 License plate positioning algorithm fusing affine invariant corner feature and visual color feature
CN106557743A (en) * 2016-10-26 2017-04-05 桂林电子科技大学 A kind of face characteristic extraction system and method based on FECNN
US9953236B1 (en) * 2017-03-10 2018-04-24 TuSimple System and method for semantic segmentation using dense upsampling convolution (DUC)
CN107967459A (en) * 2017-12-07 2018-04-27 北京小米移动软件有限公司 convolution processing method, device and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于数字图像检测和虚拟现实的桥梁施工控制技术研究;胡帮义;<<中国优秀硕士学位论文全文数据库 工程科技II辑>>;20170315(第3期);正文第20-60页 *

Also Published As

Publication number Publication date
CN109034249A (en) 2018-12-18

Similar Documents

Publication Publication Date Title
CN109034249B (en) Convolution optimization method and device based on decomposed radial symmetric convolution kernel, terminal equipment and computer readable storage medium
Zhang et al. Learning deep CNN denoiser prior for image restoration
Liu et al. Deep proximal unrolling: Algorithmic framework, convergence analysis and applications
US11636670B2 (en) Method for recognizing object in image
CN107529650B (en) Closed loop detection method and device and computer equipment
WO2023040462A1 (en) Image dehazing method, apparatus and device
CN107292458B (en) Prediction method and prediction device applied to neural network chip
CN110059733A (en) The optimization and fast target detection method, device of convolutional neural networks
TW202008310A (en) Method, device and apparatus for binocular image depth estimation, program and storage medium thereof
JP2008542911A (en) Image comparison by metric embedding
CN116051683B (en) Remote sensing image generation method, storage medium and device based on style self-organization
CN116452810A (en) Multi-level semantic segmentation method and device, electronic equipment and storage medium
CN113743426A (en) Training method, device, equipment and computer readable storage medium
CN110148136A (en) Insulator image segmentation method and device and computer readable storage medium
CN114626042A (en) Face verification attack method and device
CN110880018B (en) Convolutional neural network target classification method
CN116109509A (en) Real-time low-illumination image enhancement method and system based on pixel-by-pixel gamma correction
Jung et al. Extension of convolutional neural network with general image processing kernels
CN111079930A (en) Method and device for determining quality parameters of data set and electronic equipment
Yifei et al. Flower image classification based on improved convolutional neural network
US20240070816A1 (en) Diffusion model image generation
CN116071625B (en) Training method of deep learning model, target detection method and device
CN116342504A (en) Image processing method and device, electronic equipment and readable storage medium
CN110807752A (en) Image attention mechanism processing method based on convolutional neural network
CN113344935B (en) Image segmentation method and system based on multi-scale difficulty perception

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