Method, device and electronic system for data processing using convolutional neural network
By using multiple parallel convolution kernels and maximum value discriminators of different sizes in the convolutional neural network, the problem of memory access overhead caused by channel segmentation is solved, and the running speed of the network and the optimization of the output results are improved.
Patent Information
- Application Number
- CN202010465619.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-05-27
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2040-05-27
AI Technical Summary
In the feature extraction process of the convolutional neural network, the memory access overhead caused by channel segmentation is relatively large, which reduces the running speed of the network.
Use multiple parallel target convolution kernels, each convolution kernel has a different size, and determine the optimal result of the convolution result through a maximum value discriminator (such as a maximum value or minimum value discriminator), avoiding the channel path division method The selection of convolution kernel improves the running speed of the network.
It effectively avoids memory access overhead, improves the running speed of the convolutional neural network, and outputs optimal results.
Smart Images

Figure CN111797971B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a method, device and electronic system for data processing using a convolutional neural network. Background Art
[0002] Convolutional neural networks are widely used in detection and recognition processing calculations because of their good representation learning capabilities and the ability to perform translation-invariant classification of input information according to their hierarchical structure.
[0003] Among them, the convolution kernel in the convolutional neural network is the key part for feature extraction of input information. Therefore, the setting of the convolution kernel size is crucial to feature extraction. In practical applications, the channel is often divided into multiple paths, and each path uses a convolution kernel of a different size to achieve feature extraction. However, this way of dividing the channel causes additional memory access overhead, thereby reducing the network's operating speed. Summary of the invention
[0004] In view of this, an object of the present invention is to provide a method, device and electronic system for data processing using a convolutional neural network to alleviate the above-mentioned technical problems.
[0005] In a first aspect, an embodiment of the present invention provides a method for data processing using a convolutional neural network, wherein at least one target convolution layer of the convolutional neural network includes at least one structural unit, the structural unit includes multiple parallel target convolution kernels, the multiple target convolution kernels are all connected to an extreme value discriminator, and the sizes of the multiple target convolution kernels are different from each other; the above method includes: obtaining collected data of the target object; inputting the collected data into a pre-trained convolutional neural network for processing; when the multiple target convolution kernels of the structural unit all receive input data, the multiple target convolution kernels perform convolution calculations with the input data respectively, and the convolution results obtained by each convolution of the multiple target convolution kernels are output to the extreme value discriminator, and the extreme value discriminator determines the maximum value in the convolution results corresponding to the multiple target convolution kernels as the convolution optimization result of this convolution calculation; based on the convolution optimization result corresponding to the input data determined by the extreme value discriminator, subsequent processing is continued until the output result of the convolutional neural network is obtained.
[0006] In combination with the first aspect, the embodiment of the present invention provides a first possible implementation manner of the first aspect, wherein the extreme value discriminator is a maximum value discriminator or a minimum value discriminator.
[0007] In combination with the first aspect, an embodiment of the present invention provides a second possible implementation of the first aspect, wherein the structural unit includes a first convolution kernel respectively connected to the input ends of multiple target convolution kernels and a second convolution kernel connected to the output end of the extreme value discriminator; wherein the first convolution kernel and the second convolution kernel are both 1×1 convolution kernels.
[0008] In combination with the first aspect, an embodiment of the present invention provides a third possible implementation of the first aspect, wherein the multiple target convolution kernels are respectively a 1×1 convolution kernel, a 3×3 convolution kernel, and a 5×5 convolution kernel.
[0009] In combination with the first aspect, an embodiment of the present invention provides a fourth possible implementation of the first aspect, wherein the multiple target convolution kernels are respectively a 1×1 depth-separable convolution kernel, a 3×3 depth-separable convolution kernel, and a 5×5 depth-separable convolution kernel.
[0010] In combination with the first aspect, an embodiment of the present invention provides a fifth possible implementation of the first aspect, wherein the convolutional neural network includes an input layer, a first convolutional layer, a maximum pooling layer, a second convolutional layer, a third convolutional layer, a fourth convolutional layer, a fifth convolutional layer, a global pooling layer and an FC layer connected in sequence; wherein the second convolutional layer, the third convolutional layer and the fourth convolutional layer are target convolutional layers.
[0011] In combination with the fifth possible implementation of the first aspect, an embodiment of the present invention provides a sixth possible implementation of the first aspect, wherein the second convolutional layer includes four structural units connected in sequence, the third convolutional layer includes eight structural units connected in sequence, and the fourth convolutional layer includes four structural units connected in sequence.
[0012] In combination with the sixth possible implementation of the first aspect, an embodiment of the present invention provides a seventh possible implementation of the first aspect, wherein the convolution step length of multiple target convolution kernels in the first structural unit of the structural units of the second convolution layer, the third convolution layer, and the fourth convolution layer is 2, and the convolution step length of multiple target convolution kernels in the remaining structural units is 1.
[0013] In a second aspect, an embodiment of the present invention further provides a device for data processing using a convolutional neural network, wherein at least one target convolution layer of the convolutional neural network includes at least one structural unit, the structural unit includes multiple parallel target convolution kernels, the multiple target convolution kernels are all connected to an extreme value discriminator, and the sizes of the multiple target convolution kernels are different from each other; the device includes: an acquisition module, used to acquire collected data of the target object; an input module, used to input the collected data into a pre-trained convolutional neural network for processing; a determination module, used to, when the multiple target convolution kernels of the structural unit all receive the input data, the multiple target convolution kernels respectively perform convolution calculations with the input data, and output the convolution results obtained by each convolution of the multiple target convolution kernels to the extreme value discriminator, and the extreme value discriminator determines the maximum value in the convolution results corresponding to the multiple target convolution kernels as the convolution preferred result of this convolution calculation; an output module, used to continue subsequent processing based on the convolution preferred result corresponding to the input data determined by the extreme value discriminator until the output result of the convolutional neural network is obtained.
[0014] In a third aspect, an embodiment of the present invention further provides an electronic system, wherein the electronic system comprises: an image acquisition device, a processing device and a storage device; the image acquisition device is used to obtain the acquisition data of the target object; a computer program is stored on the storage device, and the computer program executes the above-mentioned method of applying convolutional neural network for data processing when the processed device is running.
[0015] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, wherein the computer program executes the steps of the above-mentioned method of applying a convolutional neural network to process data when the computer program is executed by a processing device.
[0016] The embodiments of the present invention bring the following beneficial effects:
[0017] The present invention provides a method, device and electronic system for data processing using a convolutional neural network. After acquiring the collected data of the target object, the collected data can be input into a pre-trained convolutional neural network for processing; when multiple target convolution kernels of a structural unit receive input data, the multiple target convolution kernels perform convolution calculations with the input data respectively, and the convolution results obtained by each convolution of the multiple target convolution kernels are output to an extreme value discriminator, and the extreme value discriminator determines the maximum value in the convolution results corresponding to the multiple target convolution kernels as the convolution optimization result of this convolution calculation; based on the convolution optimization result corresponding to the input data determined by the extreme value discriminator, subsequent processing is continued until the output result of the convolutional neural network is obtained. This data processing method can use multiple parallel and different target convolution kernels to perform convolution operations on the input data, and determine the convolution optimization result from the multiple convolution results based on the extreme value discriminator, so that the convolutional neural network outputs the optimal result. The above-mentioned convolutional neural network does not need to select different convolution kernels by dividing the channel path, which effectively avoids the memory access overhead, and uses the extreme value discriminator to efficiently fuse the convolution kernels, thereby improving the operation speed of the network.
[0018] Other features and advantages of the present disclosure will be set forth in the following description, or some features and advantages may be inferred or unambiguously determined from the description, or may be learned by implementing the above-mentioned technology of the present disclosure.
[0019] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0021] Figure 1 A flowchart of a method for data processing using a convolutional neural network provided by an embodiment of the present invention;
[0022] Figure 2 A schematic diagram of a structure unit provided by an embodiment of the present invention;
[0023] Figure 3 A schematic diagram of the structure of a convolutional neural network provided by an embodiment of the present invention;
[0024] Figure 4A schematic diagram of the structure of a device for data processing using a convolutional neural network provided by an embodiment of the present invention;
[0025] Figure 5 A schematic diagram of the structure of an electronic system provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0027] In actual use, in order to enable the convolutional neural network to fully extract features of the input information, the channel is usually divided into multiple paths to use convolution kernels of different sizes for convolution operations, and nonlinear methods such as sigmoid, softmax, tanh, etc. are used to fuse multiple convolution kernels. However, channel segmentation increases the memory access overhead, and the above-mentioned convolution kernel fusion process includes exponential operations and has low fusion efficiency, which reduces the running speed of the convolutional neural network. In order to effectively alleviate the above problems, the embodiments of the present invention provide a method, device and electronic system for data processing using a convolutional neural network, which can effectively improve the running speed of the convolutional neural network, which is described below through embodiments.
[0028] This embodiment provides a method for data processing using a convolutional neural network, wherein at least one target convolution layer of the convolutional neural network includes at least one structural unit, the structural unit includes multiple parallel target convolution kernels, the multiple target convolution kernels are all connected to an extreme value discriminator, and the sizes of the multiple target convolution kernels are different from each other.
[0029] The above-mentioned multiple parallel target convolution kernels of different sizes can perform convolution operations on the received input data at the same time, and input the obtained multiple convolution results into the extreme value discriminator. The extreme value discriminator can be a maximum value discriminator or a minimum value discriminator according to actual needs, which is not limited here.
[0030] Specifically, the process of applying the above convolutional neural network to data processing can be seen in Figure 1 A flow chart of a method for processing data using a convolutional neural network is shown, the method specifically comprising the following steps:
[0031] Step S102, acquiring the collected data of the target object;
[0032] The above-mentioned collected data is image data of the target object obtained by photographing with a camera, wherein the target object is an object to be identified or detected, and may be one of the following objects: a human body, a human body part, a vehicle or a license plate, but is not limited to the above-mentioned objects.
[0033] Step S104, inputting the collected data into a pre-trained convolutional neural network for processing;
[0034] The above-mentioned pre-trained convolutional neural network is often used to detect or identify the target object. Usually, the image attributes such as brightness and contrast have a great influence on the image. The same object has very different brightness and contrast. However, in many image recognition and detection problems, these factors should not affect the final recognition and detection results. By preprocessing the image, the convolutional neural network can be prevented from being affected by irrelevant factors as much as possible. Therefore, in this embodiment, the above-mentioned collected data can be preprocessed before being input into the convolutional neural network for convolution processing to improve the accuracy of convolutional neural network recognition and detection.
[0035] Step S106, when the multiple target convolution kernels of the structural unit all receive the input data, the multiple target convolution kernels respectively perform convolution calculations with the input data, and the convolution results obtained by each convolution of the multiple target convolution kernels are output to the extreme value discriminator, and the extreme value discriminator determines the extreme value in the convolution results corresponding to the multiple target convolution kernels as the convolution optimal result of this convolution calculation;
[0036] In specific use, the sizes of convolution result matrices obtained by performing convolution operations on the input data by the above-mentioned multiple target convolution kernels need to be consistent in order to use the maximum value discriminator to determine the maximum value of the convolution result. However, since the sizes of the above-mentioned multiple target convolution kernels are different, convolution result matrices of different sizes will be obtained when performing convolution operations on the input data. For example, the above-mentioned multiple target convolution kernels are 1×1 convolution kernel, 3×3 convolution kernel and 5×5 convolution kernel, respectively, and the convolution step sizes corresponding to the multiple target convolution kernels are all 1, and the convolution result matrices obtained by performing convolution operations on 8×8 input data without padding (expansion) are 8×8, 6×6 and 4×4 respectively. In order to make the above-mentioned convolution result matrices the same, before using the above-mentioned multiple parallel target convolution kernels to perform convolution operations, it is necessary to set corresponding padding (expansion) for different target convolution kernels.
[0037] Among them, the value of padding is determined by the k×k convolution kernel. Usually, padding=k / 2, k is an integer. Therefore, for the 1×1 target convolution kernel, padding is set to 0, for the 3×3 target convolution kernel, padding is set to 1, and for the 5×5 target convolution kernel, padding is set to 2. We will not go into details here.
[0038] After the convolution results obtained by each convolution of the above three target convolution kernels are output to the extreme value discriminator, the extreme value discriminator performs the extreme value judgment. When the extreme value discriminator is the maximum value discriminator, when the convolution results of the above three target convolution kernels input to the extreme value discriminator are 0, -1 and 1 respectively, the maximum value discriminator determines 1 as the preferred convolution result of this convolution calculation; when the extreme value discriminator is the minimum value discriminator, the minimum value discriminator determines -1 as the preferred convolution result of this convolution calculation. In this embodiment, the number of target convolution kernels is not limited, and the convolution operation in the embodiment of the present invention is similar to the existing convolution operation, which will not be described in detail here.
[0039] Step S108, continuing subsequent processing based on the convolution optimization result corresponding to the input data determined by the extreme value discriminator until the output result of the convolutional neural network is obtained.
[0040] If the next convolution layer is also the target convolution layer, the above process is also executed and will not be repeated here. If the next convolution layer is not the above target convolution layer, only the convolution operation is performed without performing the maximum value discrimination processing. The entire convolution neural network is used to process the collected data to realize the recognition or detection of the target object.
[0041] The present invention provides a method for data processing using a convolutional neural network. After acquiring the collected data of the target object, the collected data can be input into a pre-trained convolutional neural network for processing; when multiple target convolution kernels of a structural unit receive input data, the multiple target convolution kernels perform convolution calculations with the input data respectively, and the convolution results obtained by each convolution of the multiple target convolution kernels are output to an extreme value discriminator, and the extreme value discriminator determines the maximum value in the convolution results corresponding to the multiple target convolution kernels as the convolution optimization result of this convolution calculation; based on the convolution optimization result corresponding to the input data determined by the extreme value discriminator, subsequent processing is continued until the output result of the convolutional neural network is obtained. This data processing method can use multiple parallel and different target convolution kernels to perform convolution operations on the input data, and determine the convolution optimization result from the multiple convolution results based on the extreme value discriminator, so that the convolutional neural network outputs the optimal result. The above-mentioned convolutional neural network does not need to select different convolution kernels by dividing the channel path, which effectively avoids the memory access overhead, and uses the extreme value discriminator to efficiently fuse the convolution kernels, thereby improving the network operation speed.
[0042] The above-mentioned structural unit includes not only multiple target convolution kernels, but also a first convolution kernel connected to the input ends of the multiple target convolution kernels respectively and a second convolution kernel connected to the output end of the extreme value discriminator; wherein the first convolution kernel and the second convolution kernel are both 1×1 convolution kernels.
[0043] For ease of understanding, Figure 2 A schematic diagram of a structural unit is shown, such as Figure 2 As shown, the structural unit includes a 1×1 first convolution kernel CONV1, a 1×1 second convolution kernel CONV2 and a target convolution layer, wherein the target convolution layer includes three convolution kernels of different sizes and a maximum discriminator MAX connected to the three convolution kernels, and the three convolution kernels are respectively a 1×1 depth-separable convolution kernel DW1, a 3×3 depth-separable convolution kernel DW2 and a 5×5 depth-separable convolution kernel DW3; the input ends of the depth-separable convolution kernel DW1, the depth-separable convolution kernel DW2 and the depth-separable convolution kernel DW3 are all connected to the first convolution kernel CONV1 to receive input data, and the output end of the maximum discriminator MAX is connected to the second convolution kernel CONV2, and the convolution optimization result determined by the maximum discriminator is input into the second convolution kernel CONV2; in actual use, Figure 2 The type of the convolution kernel is not limited to the depthwise separable convolution kernel described above, and there is no limitation on the number of target convolution kernels included in the target convolution layer.
[0044] Taking the above structural units as basic units, a convolutional neural network shown in Table 1 is constructed, as shown in Table 1:
[0045] Table 1
[0046]
[0047] It can be seen from the convolutional neural network shown in Table 1 that the convolutional neural network includes an input layer Image, a first convolutional layer Conv1, a maximum pooling layer MaxPool, a second convolutional layer Stage2, a third convolutional layer Stage3, a fourth convolutional layer Stage4, a fifth convolutional layer Conv5, a global pooling layer GlobalPool and a FC (Fully Connected layer) layer connected in sequence; among which, the second convolutional layer, the third convolutional layer and the fourth convolutional layer are target convolutional layers.
[0048] As can be seen from Table 1, the collected data input to the input layer Image is 224×224, the first convolution layer Conv1 includes a 3×3 convolution kernel, and the convolution step length of the convolution kernel is 2; the maximum pooling layer MaxPool includes a 3×3 convolution kernel, and the convolution step length of the convolution kernel is 2; the second convolution layer Stage2 includes four structural units connected in sequence; the third convolution layer Stage3 includes eight structural units connected in sequence, and the fourth convolution layer Stage4 includes four structural units connected in sequence; the fifth convolution layer Conv5 includes a 1×1 convolution kernel, and the convolution step length of the convolution kernel is 1; the global pooling layer GlobalPool includes a 7×7 convolution kernel; the FC layer outputs the above data after the convolution operation and pooling operation of the convolutional neural network.
[0049] In order to vividly describe the convolutional neural network shown in Table 1, Figure 3 A schematic diagram of the structure of a convolutional neural network is shown in FIG. Figure 3 As shown, the second convolutional layer Stage2 includes four sequentially connected structural units, namely the first structural unit, the second structural unit, the third structural unit and the fourth structural unit; the third convolutional layer Stage3 includes eight sequentially connected structural units, namely the fifth structural unit, the sixth structural unit, the seventh structural unit, the eighth structural unit, the ninth structural unit, the tenth structural unit, the eleventh structural unit and the twelfth structural unit; the fourth convolutional layer Stage4 includes four sequentially connected structural units, namely the thirteenth structural unit, the fourteenth structural unit, the fifteenth structural unit and the sixteenth structural unit.
[0050] Moreover, it can be seen from Table 1 that the convolution step length of multiple target convolution kernels in the first structural unit of the structural units of the second convolution layer, the third convolution layer and the fourth convolution layer is 2, and the convolution step length of multiple target convolution kernels in the remaining structural units is 1. Therefore, the convolution step length of multiple target convolution kernels in the above-mentioned first structural unit, the fifth structural unit and the thirteenth structural unit is 2, and the convolution step length of the first convolution kernel and the second convolution kernel in the first structural unit, the fifth structural unit and the thirteenth structural unit are both 1, and the maximum value discriminator is selected as the extreme value discriminator in the above-mentioned structural units.
[0051] Further, if Figure 3 As shown, the output end of the maximum pooling layer MaxPool is connected to the first structure unit in the second convolutional layer Stage2, the fourth structure unit in the second convolutional layer Stage2 is connected to the fifth structure unit in the third convolutional layer Stage3, the twelfth structure unit in the third convolutional layer Stage3 is connected to the thirteenth structure unit in the fourth convolutional layer Stage4, and the sixteenth structure unit in the fourth convolutional layer Stage4 is connected to the fifth convolutional layer Conv5.
[0052] The specific process of using the above convolutional neural network to perform convolution and pooling operations on the collected data is as follows: since the convolution step size of the first convolutional layer Conv1 is 2, the matrix of the 224×224 collected data after the convolution operation of the first convolutional layer Conv1 is 112×112, and the data is input into the maximum pooling layer MaxPool. Since the step size of the maximum pooling layer MaxPool is also 2, the matrix of the data after pooling by the maximum pooling layer MaxPool is 56×56.
[0053] When the first structural unit in the second convolutional layer Stage2 receives the data pooled by the maximum pooling layer MaxPool, since the convolution step size of the first convolution kernel in the first structural unit is 1 and the convolution kernel is 1×1, the matrix of the data after the convolution operation of the first convolution kernel is still 56×56. When the three target convolution kernels in the first structural unit receive the 56×56 data input by the first convolution kernel, since the convolution step size of the three target convolution kernels is 2, and corresponding padding is set for the three target convolution kernels of different sizes, the matrix of the data after the convolution operation of the three target convolution kernels and the maximum value discriminator is 28×28. The 28×28 data is input to the second convolution kernel in the first structural unit for convolution operation. Since the convolution step size of the second convolution kernel is 1 and the convolution kernel is 1×1, the matrix of the data after the convolution operation of the second convolution kernel is still 28×28.
[0054] The convolution calculation process performed by the second structure unit, the third structure unit, and the fourth structure unit in the second convolution layer Stage2 is similar to the convolution calculation process of the first structure unit mentioned above, and will not be repeated here. However, since the step sizes of the first convolution kernel, multiple target convolution kernels, and the second convolution kernel in the second structure unit, the third structure unit, and the fourth structure unit are all 1, the matrix of the data after the convolution operation of the above 28×28 data by the second structure unit, the third structure unit, and the fourth structure unit is still 28×28.
[0055] When the 28×28 data after the second convolution layer Stage2 is input into the fifth structure unit of the third convolution layer Stage3 for convolution and maximum value selection operation, since the convolution step length of the three target convolution kernels in the fifth structure unit is 2, the matrix of the data after the fifth structure unit operation is 14×14; since the first convolution kernel, multiple target convolution kernels and second convolution kernels in the sixth structure unit, the seventh structure unit, the eighth structure unit, the ninth structure unit, the tenth structure unit, the eleventh structure unit and the twelfth structure unit in the third convolution layer have a step length of 1, the matrix of the data after the convolution operation of the above 14×14 data through the sixth structure unit to the twelfth structure unit is still 14×14; the convolution process of the fifth structure unit, the sixth structure unit, the seventh structure unit, the eighth structure unit, the ninth structure unit, the tenth structure unit, the eleventh structure unit and the twelfth structure unit is similar to the convolution calculation process of the first structure unit in the second convolution layer, and will not be repeated here.
[0056] When the 14×14 data after the third convolution layer Stage3 is input into the thirteenth structure unit of the fourth convolution layer Stage4 for convolution and maximum value selection operation, since the convolution step length of the three target convolution kernels in the thirteenth structure unit is 2, the matrix of the data after the operation by the thirteenth structure unit is 7×7; since the first convolution kernel, multiple target convolution kernels and second convolution kernels in the fourteenth structure unit, the fifteenth structure unit and the sixteenth structure unit in the fourth convolution layer have a step length of 1, the matrix of the data after the convolution operation of the above 7×7 data by the fourteenth structure unit, the fifteenth structure unit and the sixteenth structure unit is still 7×7; the convolution process of the thirteenth structure unit, the fourteenth structure unit, the fifteenth structure unit and the sixteenth structure unit is similar to the convolution calculation process of the first structure unit in the second convolution layer, and will not be repeated here.
[0057] The 7×7 data after the fourth convolutional layer operation is input into the fifth convolutional layer Conv5. Since the convolution step size of the convolution kernel of the fifth convolutional layer Conv5 is 1 and the convolution kernel is 1×1, the matrix of the data after the convolution operation of the fifth convolutional layer Conv5 is still 7×7. The data is input into the global pooling layer GlobalPool. Since the step size of the global pooling layer GlobalPool is 1 and the convolution kernel is 7×7, the matrix of the data after pooling by the global pooling layer GlobalPool is 1×1. Finally, the one-dimensional data is input into the FC layer for subsequent operations.
[0058] In actual use, the convolution layer with a fixed convolution kernel size in any existing neural network structure can be replaced with the above-mentioned convolution layer having multiple target convolution kernels and an extreme value discriminator connected to the multiple target convolution kernels according to user needs. Therefore, the network structure of the above-mentioned convolutional neural network is only an example, and all convolutional neural networks with the above-mentioned target convolution layer are within the scope of the present invention. Therefore, the calculation process of other convolutional neural networks containing target convolution layers is the same as above and will not be repeated here.
[0059] Compared with conventional neural networks, the convolutional neural network with a target convolutional layer in the present invention includes convolution kernels of multiple different sizes, and each pixel is selected independently, while the conventional neural network is divided according to channels, and the divided channel paths correspond to convolution kernels of fixed sizes. In addition, the selection of different convolution kernels of the convolutional neural network with a target convolutional layer uses a nonlinear maximum value discriminator instead of linear add and concat, which has the advantage of increasing the expression ability of the neural network.
[0060] Corresponding to the above method embodiment, an embodiment of the present invention provides a device for data processing using a convolutional neural network, wherein at least one target convolution layer of the convolutional neural network includes at least one structural unit, the structural unit includes multiple parallel target convolution kernels, the multiple target convolution kernels are all connected to the extreme value discriminator, and the sizes of the multiple target convolution kernels are different from each other; Figure 4 A schematic diagram of the structure of a device for data processing using a convolutional neural network is shown. Figure 4 As shown, the device comprises:
[0061] An acquisition module 402 is used to acquire the collected data of the target object;
[0062] An input module 404 is used to input the collected data into a pre-trained convolutional neural network for processing;
[0063] A determination module 406 is used for, when the multiple target convolution kernels of the structural unit all receive the input data, the multiple target convolution kernels respectively perform convolution calculations with the input data, and output the convolution results obtained by each convolution of the multiple target convolution kernels to the maximum value discriminator, and the maximum value discriminator determines the maximum value in the convolution results corresponding to the multiple target convolution kernels as the convolution optimization result of this convolution calculation;
[0064] The output module 408 is used to continue subsequent processing based on the convolution optimization result corresponding to the input data determined by the extreme value discriminator until the output result of the convolution neural network is obtained.
[0065] The present invention provides a device for data processing using a convolutional neural network. After acquiring the collected data of the target object, the collected data can be input into a pre-trained convolutional neural network for processing. When multiple target convolution kernels of a structural unit receive input data, the multiple target convolution kernels perform convolution calculations with the input data respectively. The convolution results obtained by each convolution of the multiple target convolution kernels are output to an extreme value discriminator, and the extreme value discriminator determines the maximum value in the convolution results corresponding to the multiple target convolution kernels as the convolution optimization result of this convolution calculation. The subsequent processing is continued based on the convolution optimization result corresponding to the input data determined by the extreme value discriminator until the output result of the convolutional neural network is obtained. This data processing method can use multiple parallel and different target convolution kernels to perform convolution operations on the input data, and determine the convolution optimization result from the multiple convolution results based on the extreme value discriminator, so that the convolutional neural network outputs the optimal result. The above-mentioned convolutional neural network does not need to select different convolution kernels by dividing the channel path, which effectively avoids the memory access overhead, and uses the extreme value discriminator to efficiently fuse the convolution kernels, thereby improving the operation speed of the network.
[0066] Furthermore, the above-mentioned extreme value discriminator is a maximum value discriminator or a minimum value discriminator.
[0067] Furthermore, the above-mentioned structural unit includes a first convolution kernel connected to the input ends of multiple target convolution kernels respectively and a second convolution kernel connected to the output end of the extreme value discriminator; wherein, the first convolution kernel and the second convolution kernel are both 1×1 convolution kernels.
[0068] Furthermore, the multiple target convolution kernels are 1×1 convolution kernel, 3×3 convolution kernel and 5×5 convolution kernel.
[0069] Furthermore, the multiple target convolution kernels are respectively a 1×1 depthwise separable convolution kernel, a 3×3 depthwise separable convolution kernel, and a 5×5 depthwise separable convolution kernel.
[0070] Furthermore, the above-mentioned convolutional neural network includes an input layer, a first convolutional layer, a maximum pooling layer, a second convolutional layer, a third convolutional layer, a fourth convolutional layer, a fifth convolutional layer, a global pooling layer and an FC layer connected in sequence; wherein the second convolutional layer, the third convolutional layer and the fourth convolutional layer are target convolutional layers.
[0071] Furthermore, the second convolutional layer includes four structural units connected in sequence, the third convolutional layer includes eight structural units connected in sequence, and the fourth convolutional layer includes four structural units connected in sequence.
[0072] Furthermore, the convolution step length of the multiple target convolution kernels in the first structural unit in the structural units of the second convolution layer, the third convolution layer, and the fourth convolution layer is 2, and the convolution step length of the multiple target convolution kernels in the remaining structural units is 1.
[0073] The device for applying convolutional neural networks to perform data processing provided in the embodiment of the present invention has the same implementation principle and technical effects as those of the aforementioned method embodiment. For the sake of brief description, for parts not mentioned in the embodiment of the device for applying convolutional neural networks to perform data processing, reference may be made to the corresponding contents in the aforementioned method embodiment.
[0074] The embodiment of the present invention further provides an electronic system, referring to Figure 5 The electronic system 500 is a schematic diagram of the structure of the electronic system 500. The electronic system can be used to implement the method and device for data processing using a convolutional neural network according to an embodiment of the present invention.
[0075] like Figure 5 The electronic system 500 includes one or more processing devices 502, one or more storage devices 504, an input device 506, an output device 508, and one or more image acquisition devices 510. These components are interconnected via a bus system 512 and / or other forms of connection mechanisms (not shown). It should be noted that Figure 5 The components and structure of the electronic system 500 shown are merely exemplary and not limiting. The electronic system may also have other components and structures as required.
[0076] The processing device 502 can be a server, an intelligent terminal, or a device including a central processing unit (CPU) or other forms of processing units with data processing capabilities and / or instruction execution capabilities. It can process data of other components in the electronic system 500 and can also control other components in the electronic system 500 to perform data processing functions.
[0077] The storage device 504 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on a computer-readable storage medium, and the processing device 502 may run the program instructions to implement the client functions and / or other desired functions in the embodiments of the present invention (implemented by the processing device) described below. Various applications and various data, such as various data used and / or generated by the application, may also be stored in the computer-readable storage medium.
[0078] The input device 506 may be a device used by a user to input instructions, and may include one or more of a keyboard, a mouse, a microphone, a touch screen, and the like.
[0079] The output device 508 may output various information (eg, images or sounds) to the outside (eg, a user), and may include one or more of a display, a speaker, and the like.
[0080] The image acquisition device 510 can acquire image data of the target object and store the acquired image data in the storage device 504 for use by other components.
[0081] Exemplarily, the various devices in the method, device, and electronic system for implementing the data processing using a convolutional neural network according to an embodiment of the present invention may be integrated or dispersed, such as integrating the processing device 502, the storage device 504, the input device 506, and the output device 508 into one, and setting the image acquisition device 510 at a specified position where an image can be acquired. When the various devices in the above electronic system are integrated, the electronic system can be implemented as an intelligent terminal such as a camera, a smart phone, a tablet computer, a computer, a vehicle-mounted terminal, etc.
[0082] An embodiment of the present invention further provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the above-mentioned method of applying a convolutional neural network to perform data processing. The specific implementation can be found in the method embodiment, which will not be repeated here.
[0083] The computer program product of the method, device and electronic system for applying convolutional neural network for data processing provided in the embodiments of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the method in the previous method embodiment. The specific implementation can be found in the method embodiment, which will not be repeated here.
[0084] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the electronic system and / or device described above can refer to the corresponding process in the aforementioned method embodiment and will not be repeated here.
[0085] In addition, in the description of the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0086] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0087] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A method for data processing using a convolutional neural network, characterized in that: At least one target convolution layer of the convolutional neural network includes at least one structural unit, the structural unit includes a plurality of parallel target convolution kernels, the plurality of target convolution kernels are all connected to the extreme value discriminator, and the sizes of the plurality of target convolution kernels are different from each other; the method includes: Acquire collected data of the target object; wherein the collected data is data collected by an image acquisition device; Inputting the collected data into the pre-trained convolutional neural network for processing; When the multiple target convolution kernels of the structural unit all receive input data, the multiple target convolution kernels respectively perform convolution calculations with the input data, and the convolution results obtained by each convolution of the multiple target convolution kernels are output to the extreme value discriminator, and the extreme value discriminator determines the extreme value in the convolution results corresponding to the multiple target convolution kernels as the convolution preferred result of this convolution calculation; wherein, the convolution result matrices obtained by the multiple target convolution kernels performing convolution operations on the input data have the same size, and before the multiple target convolution kernels perform convolution operations, corresponding expansion amounts are set for different target convolution kernels, and for a k×k convolution kernel, the expansion amount=k / 2 and rounds down to an integer; Continue to perform subsequent processing based on the convolution optimization result corresponding to the input data determined by the extreme value discriminator until the output result of the convolutional neural network is obtained.
2. The method according to claim 1, characterized in that The extreme value discriminator is a maximum value discriminator or a minimum value discriminator.
3. The method according to claim 1, characterized in that The structural unit includes a first convolution kernel connected to the input ends of the plurality of target convolution kernels respectively and a second convolution kernel connected to the output end of the maximum value discriminator; wherein the first convolution kernel and the second convolution kernel are both 1×1 convolution kernels.
4. The method according to claim 1, characterized in that: The multiple target convolution kernels are respectively a 1×1 convolution kernel, a 3×3 convolution kernel and a 5×5 convolution kernel.
5. The method according to claim 1, characterized in that The multiple target convolution kernels are respectively a 1×1 depth-separable convolution kernel, a 3×3 depth-separable convolution kernel, and a 5×5 depth-separable convolution kernel.
6. The method according to claim 1, characterized in that The convolutional neural network includes an input layer, a first convolutional layer, a maximum pooling layer, a second convolutional layer, a third convolutional layer, a fourth convolutional layer, a fifth convolutional layer, a global pooling layer and an FC layer connected in sequence; Among them, the second convolution layer, the third convolution layer and the fourth convolution layer are the target convolution layers.
7. The method according to claim 6, characterized in that The second convolution layer includes four of the structural units connected in sequence, the third convolution layer includes eight of the structural units connected in sequence, and the fourth convolution layer includes four of the structural units connected in sequence.
8. The method according to claim 7, characterized in that The convolution step length of the multiple target convolution kernels in the first structural unit of the structural units of the second convolution layer, the third convolution layer and the fourth convolution layer is 2, and the convolution step length of the multiple target convolution kernels in the remaining structural units is 1.
9. A device for data processing using a convolutional neural network, characterized in that: At least one target convolution layer of the convolutional neural network includes at least one structural unit, the structural unit includes a plurality of parallel target convolution kernels, the plurality of target convolution kernels are all connected to the extreme value discriminator, and the sizes of the plurality of target convolution kernels are different from each other; the device includes: An acquisition module, used to acquire acquisition data of a target object; wherein the acquisition data is data acquired by an image acquisition device; An input module, used to input the collected data into the pre-trained convolutional neural network for processing; A determination module, used for when multiple target convolution kernels of the structural unit all receive input data, the multiple target convolution kernels respectively perform convolution calculations with the input data, and the convolution results obtained by each convolution of the multiple target convolution kernels are output to the extreme value discriminator, and the extreme value discriminator determines the extreme value in the convolution results corresponding to the multiple target convolution kernels as the convolution preferred result of this convolution calculation; wherein, the convolution result matrices obtained by the multiple target convolution kernels performing convolution operations on the input data have the same size, and before the multiple target convolution kernels perform convolution operations, corresponding expansion amounts are set for different target convolution kernels, and for a k×k convolution kernel, the expansion amount=k / 2 and rounds down to an integer; An output module is used to continue subsequent processing based on the convolution optimization result corresponding to the input data determined by the extreme value discriminator until the output result of the convolutional neural network is obtained.
10. An electronic system, characterized in that: The electronic system includes: an image acquisition device, a processing device and a storage device; The image acquisition device is used to acquire acquisition data of the target object; The storage device stores a computer program, which, when executed by the processing device, executes the method for data processing using a convolutional neural network as described in any one of claims 1 to 8.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processing device, the steps of the method for data processing using a convolutional neural network as described in any one of claims 1 to 8 are executed.
