Neural network processing apparatus, neural network processing method and neural network processing program

The neural network processing method expands the applicability of winograd conversion to CNNs by creating sub-input feature maps and reduced kernels, effectively reducing calculations and enhancing processing speed for diverse kernel sizes, including dilated convolution layers.

JP2024116876AActive Publication Date: 2024-08-28NIPPON TELEGRAPH & TELEPHONE CORP +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
JP2023022710
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2023-02-16
Publication Date
2024-08-28
Estimated Expiration
2043-02-16

AI Technical Summary

Technical Problem

Existing convolutional neural network (CNN) inference processing in hardware is limited by the need for extensive multiplier circuits due to conventional convolution operations, which occupy significant area and power, and winograd transformation is not versatile enough to handle various kernel sizes and special layers like dilated convolution layers effectively.

Method used

A neural network processing method that applies an expansion rate to two-dimensional convolution layers, creating sub-input feature maps and reduced kernels to perform winograd conversion processing, allowing for the synthesis of sub-convolution results to obtain a convolution result, thereby expanding the scope of application and reducing calculations.

Benefits of technology

This approach enables efficient winograd conversion for extended convolutional layers, reducing calculation amounts and improving processing speed across various kernel sizes, including dilated convolution layers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2024116876000001_ABST
    Figure 2024116876000001_ABST
Patent Text Reader

Abstract

To realize reduction of an operation amount while expanding an application range when winograd conversion processing is applied to a convolution neural network.SOLUTION: A neural network processing apparatus creates a plurality of sub input feature maps from an input feature map according to a value of an expansion rate for a two-dimensional convolution layer that is an expanded convolution layer in which an expansion rate is more than or equal to 2; creates a reduced kernel, in which a part being 0 is removed from an input kernel, according to the value of the expansion rate; performs winograd conversion processing for each of the plurality of sub input feature maps and the reduced kernel; obtains a plurality of sub convolution results corresponding respectively to the plurality of sub input feature maps; and synthesizes the plurality of sub convolution results to obtain a convolution result for the two-dimensional convolution layer.SELECTED DRAWING: Figure 2
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The disclosed technology relates to a neural network processing device, a neural network processing method, and a neural network processing program. [Background technology]

[0002] In a convolutional neural network (CNN), the network model is composed of multiple layers, and convolution processing is performed in the convolutional layer. In the convolution processing, as shown in Figure 10, the input feature map (also called input fmap) from the previous layer and the like, and the kernel, which is the weighting coefficient, are input. A bias value is added to the convolution calculation result obtained by performing a convolution calculation (product-sum calculation) on the input feature map and the input kernel, and activation function processing is performed. This results in an output feature map.

[0003] When CNN inference processing is implemented using dedicated hardware such as LSI (Large Scale Integration) or FPGA (Field Programmable Gate Array), convolution calculations account for the majority of the calculation volume in the inference processing. Since convolution calculations are repeated multiplication and addition operations, the calculation circuit is composed of multipliers and adders. In particular, since the required circuit area of ​​a multiplier is larger than that of an adder, the multipliers in the convolution calculation section account for the majority of the calculation units in the CNN inference hardware. For this reason, the multipliers in the convolution calculation affect the area or power of the hardware, and whether the multipliers can be effectively utilized affects the throughput (inference processing performance) per area or power.

[0004] Winograd transformation is known as a method for reducing the number of multiplications in a convolution operation (see, for example, Non-Patent Document 1). As shown in FIG. 11, the winograd transformation performs a matrix transformation on each of the input feature map and the input kernel in advance, multiplies the transformed input feature map and the transformed input kernel by the Hadamard product, and then performs a post-transformation matrix transformation. This makes it possible to obtain results similar to those of a convolution operation. At that time, the number of multiplications required for the Hadamard product is less than the number of multiplications required for the original convolution operation, so that the overall amount of calculation can be reduced. In the case of inference hardware, fewer multiplication circuits need to be implemented, improving the throughput per circuit area or power.

[0005] The transformation formula of the winograd transformation shown in Fig. 11 is expressed by the following formula (1), where I is the input feature map, I' is the transformed input feature map, K is the input kernel, K' is the transformed input kernel, O' is the Hadamard product result, O is the convolution result, A, B, and C are transformation matrices, and T is the transposed matrix.

[0006] JPEG2024116876000002.jpg11107(1)

[0007] For example, FIG. 12 shows a case where the size of the input feature map is 4×4, the size of the input kernel is 3×3, and the size of the convolution result is 2×2.

[0008] In the case of the size configuration shown in FIG. 12, the transformation matrices A, B, and C used in the winograd transformation are determined as shown in the following formula (2).

[0009] JPEG2024116876000003.jpg21127(2)

[0010] The size of the transformed input feature map is 4 × 4, and the size of the transformed input kernel is 3 × 3. These Hadamard products require 16 multiplications. The transformation matrix A after the Hadamard product multiplication turns the 4 × 4 Hadamard product result O' into a 2 × 2 convolution result O.

[0011] A normal convolution operation requires (3×3)×(2×2)=36 multiplications, whereas using the winograd transform requires only 16 multiplications, a 4 / 9 multiplication rate. Similarly, for a 5×5 input kernel, if the size of the convolution result is 2×2, the number of multiplications required is 9 / 25. [Prior art documents] [Non-patent literature]

[0012] [Non-Patent Document 1] “Fast Algorithms for Convolutional Neural Networks”, Andrew Lavin, Scott Gray. Summary of the Invention [Problem to be solved by the invention]

[0013] On the other hand, the transformation matrices A, B, and C differ for each kernel size. When implementing CNN inference processing in hardware, it is not realistic to prepare transformation matrices A, B, and C for every kernel size, and it is also not realistic to implement a winograd transformation circuit that can perform matrix processing using every transformation matrix A, B, and C.

[0014] For this reason, a winograd conversion circuit is often prepared for a specific kernel size (e.g., 3 × 3), and the processing speed is improved using the winograd conversion circuit for 3 × 3 kernel sizes, and the processing speed is not improved for other sizes by using normal convolution processing without using the winograd conversion circuit. In this case, the range in which the winograd conversion circuit can be used is limited, resulting in poor versatility.

[0015] Furthermore, it is difficult to apply the winograd transform outside of normal convolutional layers, and even if it is applied, it may not be effective enough.

[0016] Recent CNN inference models often include a special convolution layer called a dilated convolution layer. The dilated convolution layer activates only discrete positions within the kernel. The interval between discrete positions is called the dilation rate (dr), and in the case of a 3x3 kernel, dilation rates (dr) = 1, 2, and 4 are as shown in Figure 13. A dilation rate (dr) = 1 is the same as a normal convolution.

[0017] The dilated convolutional layer allows convolution from a wide range of input feature maps without changing the number of multiplication and accumulation of convolution operations. For example, an input kernel of size 3×3 with dilation rate 2 is equivalent to a 5×5 input kernel with 16 out of 25 points being 0, but the number of operations is the same as a 3×3 normal convolution, which is 9 / 25 times that of 5×5.

[0018] However, the winograd transform cannot handle discrete kernels, so it can only be handled by filling the non-discrete invalid kernels with 0 and treating them as normal convolutional layers. For example, a 3×3 kernel with a dilation rate of 2 can only be handled by the winograd transform by treating it as a 5×5 kernel.

[0019] By treating it as a 5x5 kernel and performing winograd transformation, the number of multiplications can be reduced compared to a normal 5x5 convolutional layer, but because a normal 5x5 convolutional layer has a larger number of multiplications than a normal 3x3 convolutional layer, the reduction in the number of multiplications is lost when combined. In other words, even if the number of multiplications in winograd transformation is reduced to 9 / 25, it becomes 25 / 9 when treated as 5x5, which is effectively 1x.

[0020] As described above, the scope of applicability of the winograd conversion circuit is limited. Furthermore, in special convolution layers such as dilated convolution layers, the effect of reducing the number of multiplications is lost, and the winograd conversion circuit does not sufficiently increase the processing speed.

[0021] The disclosed technology has been made in consideration of the above-mentioned points, and aims to provide a neural network processing device, a neural network processing method, and a neural network processing program that can reduce the amount of calculations while expanding the scope of application when applying Winograd transformation processing to a convolutional neural network. [Means for solving the problem]

[0022] A neural network processing device according to one embodiment of the present disclosure includes: a sub-input feature map creation unit that creates a plurality of sub-input feature maps from an input feature map in accordance with a value of an expansion rate specified in a winograd transformation process of a convolutional neural network, for a two-dimensional convolution layer that is an expanded convolution layer having an expansion rate of 2 or more; a reduced kernel creation unit that creates a reduced kernel by removing a portion of an input kernel that is equal to 0 in accordance with the value of the expansion rate; a winograd transformation processing unit that performs a winograd transformation process on each of the plurality of sub-input feature maps and the reduced kernel to obtain a plurality of sub-convolution results corresponding to each of the plurality of sub-input feature maps; and a sub-convolution result synthesis unit that combines the plurality of sub-convolution results to obtain a convolution result for the two-dimensional convolution layer.

[0023] A neural network processing method according to one embodiment of the present disclosure includes the steps of: for a two-dimensional convolutional layer that is an expanded convolutional layer having an expansion ratio specified in a winograd transformation process of a convolutional neural network that is equal to or greater than 2, creating a plurality of sub-input feature maps from an input feature map in accordance with a value of the expansion ratio; creating a reduced kernel by removing a portion of an input kernel that is equal to 0 in accordance with the value of the expansion ratio; performing a winograd transformation process on each of the plurality of sub-input feature maps and the reduced kernel; obtaining a plurality of sub-convolution results corresponding to each of the plurality of sub-input feature maps; and combining the plurality of sub-convolution results to obtain a convolution result for the two-dimensional convolutional layer.

[0024] A neural network processing program according to one embodiment of the present disclosure causes a computer to execute the following processes for a two-dimensional convolutional layer, which is an expanded convolutional layer having an expansion ratio of 2 or more specified in a winograd transformation process of a convolutional neural network: creating a plurality of sub-input feature maps from an input feature map in accordance with a value of the expansion ratio; creating a reduced kernel by removing a portion of an input kernel that is equal to 0 in accordance with the value of the expansion ratio; performing a winograd transformation process on each of the plurality of sub-input feature maps and the reduced kernel; obtaining a plurality of sub-convolution results corresponding to each of the plurality of sub-input feature maps; and combining the plurality of sub-convolution results to obtain a convolution result for the two-dimensional convolutional layer. Effect of the Invention

[0025] According to the disclosed technology, when the winograd transform process is applied to a convolutional neural network, it is possible to reduce the amount of calculation while expanding the scope of application. [Brief description of the drawings]

[0026] [Figure 1] FIG. 2 is a block diagram showing an example of a hardware configuration of a neural network processing device according to the embodiment. [Diagram 2] FIG. 1 is a block diagram showing an example of a configuration of a neural network processing device according to an embodiment. [Diagram 3] 1A to 1C are diagrams illustrating a convolution process according to an embodiment; [Figure 4] 13 is a diagram illustrating a process of creating a sub-input feature map from an input feature map. FIG. [Diagram 5] FIG. 13 is a diagram illustrating a process of obtaining a sub-convolution result from a sub-input feature map and a reduction kernel. [Figure 6] 11A to 11C are diagrams illustrating a winograd conversion process according to an embodiment. [Figure 7] FIG. 13 is a diagram illustrating a process of obtaining a convolution result for a two-dimensional convolution layer from a sub-convolution result. [Figure 8] 5 is a flowchart showing an example of a processing flow by the neural network processing device according to the embodiment. [Figure 9] FIG. 13 is a block diagram showing an example of the configuration of another neural network processing device according to the embodiment. [Figure 10] FIG. 1 illustrates the prior art. [Figure 11] FIG. 1 illustrates the prior art. [Figure 12] FIG. 1 illustrates the prior art. [Figure 13] FIG. 1 illustrates the prior art. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0027] Hereinafter, an example of an embodiment of the disclosed technology will be described with reference to the drawings. In each drawing, the same or equivalent components and parts are given the same reference numerals. In addition, the dimensional ratios of the drawings are exaggerated for the convenience of explanation and may differ from the actual ratios.

[0028] The neural network processing device according to this embodiment enables the Winograd transform even for dilated convolutional layers of the same kernel size, thereby realizing a reduction in the amount of calculations while expanding the scope of application of the Winograd transform.

[0029] FIG. 1 is a block diagram showing an example of a hardware configuration of a neural network processing device 10 according to the present embodiment.

[0030] As shown in FIG. 1, the neural network processing device 10 includes a CNN arithmetic circuit 100 and a memory 200. The memory 200 stores kernels and the like. The CNN arithmetic circuit 100 performs CNN processing such as convolution processing and activation function processing using the kernels and the like transferred from the memory 200. The CNN arithmetic circuit 100 according to the present embodiment is configured as hardware designed exclusively for CNN. The CNN arithmetic circuit 100 is configured as a dedicated electric circuit that is a processor having a circuit configuration designed exclusively for executing specific processing, such as a PLD (Programmable Logic Device) whose circuit configuration can be changed after manufacture, such as an FPGA (Field-Programmable Gate Array), or an ASIC (Application Specific Integrated Circuit).

[0031] Next, a specific configuration of the neural network processing device 10 will be described with reference to FIG.

[0032] FIG. 2 is a block diagram showing an example of the configuration of the neural network processing device 10 according to the present embodiment.

[0033] As shown in FIG. 2, the neural network processing device 10 includes a CNN arithmetic circuit 100. The CNN arithmetic circuit 100 includes a circuit for performing convolution calculation for winograd transformation. Specifically, the CNN arithmetic circuit 100 includes a reduced kernel creation unit 101A, a sub-input feature map creation unit 101B, a winograd transformation processing unit 102, and a sub-convolution result synthesis unit 106. The winograd transformation processing unit 102 includes a first matrix transformation unit 103A, a second matrix transformation unit 103B, a multiplication processing unit 104, and a third matrix transformation unit 105. Each of these components is realized by, for example, an FPGA or ASIC designed specifically for CNN.

[0034] The reduced kernel creation unit 101A creates a reduced kernel by removing a portion of the input kernel that is 0 according to the value of the dilation rate. Specifically, the reduced kernel creation unit 101A creates a reduced kernel of a size smaller than the input kernel, for example, by removing 0 inserted at a position according to the value of the dilation rate. As an example, when the dilation rate is 2, the size of the input kernel is reduced from 5×5 to 3×3. Here, the dilation rate is a value specified in the winograd conversion process of the convolutional neural network, and as described above, it represents the intervals between the input kernels, that is, the intervals between the effective kernels in the input kernel. As an example, as shown in the above-mentioned FIG. 13, when the dilation rate is 2, the effective kernels are arranged every other one vertically and horizontally, and when the dilation rate is 4, the effective kernels are arranged every two vertically and horizontally. The dilation rate is a value specified in advance for the current layer, and is obtained, for example, from the memory 200. Also, the input kernel represents a kernel that is a weight coefficient obtained from the previous layer, and is obtained, for example, from the memory 200.

[0035] The sub-input feature map creation unit 101B creates multiple sub-input feature maps from the input feature map according to the value of the expansion rate for a two-dimensional convolution layer that is an expansion convolution layer with an expansion rate of 2 or more. Specifically, the sub-input feature map creation unit 101B determines multiple separation units that are units for separating each pixel of the input feature map according to the value of the expansion rate, selects pixels at the same position for each of the multiple separation units, and creates a sub-input feature map by combining the selected pixels. For example, when the expansion rate value is 2, one pixel is enabled for every two pixels vertically and horizontally in the input kernel, but in the case of the input feature map, it is separated into units of four pixels in total, two pixels vertically and horizontally, and pixels at the same position among the four pixels are combined to create a sub-input feature map. Since the number of sub-input feature maps created is equal to the square of the value of the expansion rate, four are created here.

[0036] The winograd transformation processing unit 102 performs winograd transformation processing on each of the multiple sub-input feature maps and the reduced kernel, and obtains multiple sub-convolution results corresponding to each of the multiple sub-input feature maps. In addition, the winograd transformation processing unit 102 performs winograd transformation processing on a two-dimensional convolution layer other than an expanded convolution layer with an expansion rate of 1, and obtains a convolution result corresponding to the input feature map. In other words, when the expansion rate is 1, the input feature map is not separated into multiple sub-input feature maps, and normal convolution processing is performed.

[0037] Specifically, the winograd transformation processing unit 102 includes a first matrix transformation unit 103A, a second matrix transformation unit 103B, a multiplication processing unit 104, and a third matrix transformation unit 105.

[0038] The first matrix transformation unit 103A performs matrix transformation on the reduced kernel using, for example, the transformation matrix B shown in the above formula (2). The second matrix transformation unit 103B performs matrix transformation on each of the multiple sub-input feature maps using, for example, the transformation matrix C shown in the above formula (2). The multiplication processing unit 104 derives a Hadamard product between the reduced kernel matrix-transformed by the first matrix transformation unit 103A and each of the multiple sub-input feature maps matrix-transformed by the second matrix transformation unit 103B. The third matrix transformation unit 105 performs matrix transformation on the Hadamard product using, for example, the transformation matrix A shown in the above formula (2) to obtain multiple sub-convolution results. Note that the transformation matrices A, B, and C may be the same matrix even if the expansion ratio is different, as long as the kernel size is constant.

[0039] The sub-convolution result synthesis unit 106 synthesizes a plurality of sub-convolution results obtained by the winograd transformation processing unit 102 performing the winograd transformation processing, and obtains a convolution result for the two-dimensional convolution layer.

[0040] Below, a specific explanation will be given by taking as an example a case where the size of the input feature map is 8×8, the expansion rate is 2, the size of the input kernel is 5×5 (the size of the reduction kernel is 3×3), and the convolution result is 4×4.

[0041] FIG. 3 is a diagram illustrating the convolution process according to the present embodiment.

[0042] As shown in Fig. 3, the convolution result C1 is obtained by dilation convolution of the input feature map M1 and the input kernel K1. The pixels 1 to 16 of the input feature map M1 required to obtain each pixel A to D of the convolution result C1 are as follows. Pixel A requires pixels 1, 2, 3, 5, 6, 7, 9, 10, and 11, pixel B requires pixels 2, 3, 4, 6, 7, 8, 10, 11, and 12, pixel C requires pixels 5, 6, 7, 9, 10, 11, 13, 14, and 15, and pixel D requires pixels 6, 7, 8, 10, 11, 12, 14, 15, and 16.

[0043] 4 is a diagram illustrating the process of creating sub-input feature maps SM1 to SM4 from the input feature map M1. This process is executed by the sub-input feature map creation unit 101B.

[0044] As shown in FIG. 4, 2×2 pixels of the input feature map M1 are set as one separation unit. Each pixel of the input feature map M1 is separated into a plurality of separation units (16 in this case), and a number (1 to 16 in this case) is assigned to each pixel of the plurality of separation units. Then, pixels at the same position are selected for each of the plurality of separation units, and the selected pixels are combined to create the sub-input feature maps SM1 to SM4. Each of the sub-input feature maps SM1 to SM4 has a size of 4×4. In other words, among the separation units (2×2 pixels) of the input feature map M1, pixels at the same position are selected for each of the upper left, upper right, lower left, and lower right positions, and the selected pixels are combined to create the sub-input feature maps SM1 to SM4.

[0045] When the sub-input feature maps SM1 to SM4 are created in this way, the sub-input feature maps SM1 to SM4 and the input kernel K1 are similarly positioned at discrete intervals, so the convolution operation of each of the sub-input feature maps SM1 to SM4 and the input kernel K1 is essentially the same as a normal convolution process without dilation. This normal convolution process makes it possible to obtain a sub-convolution result.

[0046] 5 is a diagram illustrating a process for obtaining sub-convolution results SC1 to SC4 from the sub-input feature maps SM1 to SM4 and the reduced kernel SK1. This process is executed by the winograd conversion processing unit 102.

[0047] As described above, when 9 points are valid kernels and 16 points are invalid kernels (=0) for each kernel of the 5×5 input kernel K1, as shown in FIG. 5, the invalid kernels are skipped and only the 9 valid kernels are collected to form a 3×3 normal kernel (=reduced kernel SK1). In other words, if the 3×3 normal reduced kernel SK1 is applied to each of the 4×4 sub-input feature maps SM1 to SM4 and normal convolution processing is performed, the same results as the original dilated convolution processing can be obtained. The pixels 1 to 16 of the input feature map M1 required to obtain each pixel A to D of the sub-convolution results SC1 to SC4 are as follows. Pixel A requires pixels 1, 2, 3, 5, 6, 7, 9, 10, and 11, and pixel B requires pixels 2, 3, 4, 6, 7, 8, 10, 11, and 12. Pixel C requires pixels 5, 6, 7, 9, 10, 11, 13, 14, and 15, and pixel D requires pixels 6, 7, 8, 10, 11, 12, 14, 15, and 16.

[0048] FIG. 6 is a diagram illustrating the winograd conversion process according to this embodiment.

[0049] As shown in FIG. 6, the reduced kernel SK1 to be convolved with the sub-input feature maps SM1 to SM4 is not a 5×5 kernel but a 3×3 normal kernel, so that the winograd conversion process can be applied as is. That is, as described above, by performing a 3×3 winograd conversion process instead of a 5×5 winograd conversion process, the amount of calculation can be reduced. The winograd conversion process according to this embodiment has the same procedure as the 3×3 normal convolution process. The winograd conversion process shown in FIG. 6 is executed using the above-mentioned formulas (1) and (2), and sub-convolution results SC1 to SC4 are obtained from the sub-input feature maps SM1 to SM4 and the reduced kernel SK1.

[0050] 7 is a diagram illustrating a process of obtaining a convolution result C1 for a two-dimensional convolution layer from the sub-convolution results SC1 to SC4. This process is executed by the sub-convolution result synthesis unit .

[0051] As shown in Fig. 7, the convolution result C1 is obtained by performing the reverse process to that used to create the sub-input feature maps SM1-SM4 on the multiple sub-convolution results SC1-SC4 that have finally been created. Each pixel of the sub-convolution results SC1-SC4 is alternately nested according to the value of the dilation rate to create one convolution result C1 from the multiple sub-convolution results SC1-SC4. The convolution result C1 obtained from these processes is the same as the convolution result created by processing as the original dilated convolution layer without separation.

[0052] Next, the operation of the neural network processing device 10 according to this embodiment will be described with reference to FIG.

[0053] 8 is a flowchart showing an example of the flow of processing by the neural network processing device 10 according to this embodiment. The processing by the neural network processing device 10 is realized by the CNN arithmetic circuit 100 of the neural network processing device 10.

[0054] In step S101 of FIG. 8, the CNN arithmetic circuit 100 acquires, as an example, the input feature map M1 and the input kernel K1 shown in FIG. 3 described above.

[0055] In step S102, the CNN arithmetic circuit 100 judges whether the expansion rate value specified for the current layer is equal to or greater than 2. If it is judged that the expansion rate value is equal to or greater than 2 (if the judgment is positive), the process proceeds to step S103, and if it is judged that the expansion rate value is less than 2, that is, equal to 1 (if the judgment is negative), the process proceeds to step S107.

[0056] In step S103, the CNN arithmetic circuit 100 creates a plurality of sub-input feature maps SM1 to SM4 from the input feature map M1, as shown in the above-mentioned Fig. 4, for example. Specifically, a plurality of separation units that are units for separating each pixel of the input feature map M1 are determined according to the value of the expansion rate, pixels at the same position are selected for each of the plurality of separation units, and the selected pixels are grouped together to create the sub-input feature maps SM1 to SM4.

[0057] In step S104, the CNN arithmetic circuit 100 creates a reduced kernel SK1 from the input kernel K1 according to the value of the expansion ratio, as shown in, for example, the above-mentioned Fig. 5. Note that the order of the processes in steps S103 and S104 may be interchanged.

[0058] In step S105, the CNN arithmetic circuit 100 performs a winograd transformation process on each of the sub-input feature maps SM1 to SM4 created in step S103 and the reduced kernel SK1 created in step S104, as shown in FIG. 6 above, to obtain a plurality of sub-convolution results SC1 to SC4.

[0059] In step S106, the CNN arithmetic circuit 100 synthesizes the sub-convolution results SC1 to SC4 obtained in step S105 to obtain one convolution result C1, as shown in Fig. 7 above, for example. This completes the series of processes by the neural network processing device 10.

[0060] On the other hand, in step S107, the CNN arithmetic circuit 100 performs winograd conversion processing on the input feature map M1 and the input kernel K1 to obtain one convolution result. In other words, when the expansion rate is 1, the input kernel K1 becomes a normal 3×3 kernel, so that normal convolution processing is performed without separating the input feature map M1 into multiple sub-input feature maps. This completes the series of processes by the neural network processing device 10.

[0061] Even if the expansion rate is other than 2, i.e., 3 or more, if sub-input feature maps are created by selecting pixels of the input feature map at intervals according to the value of the expansion rate, the winograd transform process can be used for each sub-input feature map. Also, if a winograd transform circuit for a 3×3 normal convolution layer is prepared in the device, the winograd transform process can be used by the above method for 3×3 kernels with any expansion rate, and the application range of the winograd transform can be expanded while reducing the amount of calculations by applying the winograd transform.

[0062] FIG. 9 is a block diagram showing an example of the configuration of another neural network processing device 10A according to this embodiment.

[0063] The neural network processing device 10A shown in FIG. 9 is a circuit that supports winograd conversion processing for multiple types of kernel sizes. In this case, the sub-input feature map creation unit 101B separates the input feature map into multiple sub-input feature maps according to the value of the expansion rate regardless of the kernel size. The sub-convolution result synthesis unit 106 synthesizes multiple sub-convolution results obtained from the multiple sub-input feature maps and the reduced kernel to obtain one convolution result. A plurality of sets of transformation matrices A, B, and C are prepared according to the kernel size, and a transformation matrix corresponding to the kernel size of the current layer to be input is selected and provided to each of the first matrix conversion unit 103A, the second matrix conversion unit 103B, and the third matrix conversion unit 105.

[0064] In this way, according to the present embodiment, the portion where the apparent kernel size becomes large due to the dilated convolutional layer can be treated as the actual kernel size by creating a sub-input feature map. Therefore, the effect of reducing the amount of computation by the winograd transform can be obtained in the same way as in a normal convolutional layer that is not a dilated convolutional layer.

[0065] For example, even if the image is 3×3 and the expansion rate is 2, it is possible to perform the winograd transformation as 3×3 instead of as 5×5, which reduces the amount of calculation by 4 / 9.

[0066] Furthermore, the original Winograd conversion circuit can only be used for normal convolution processing with a fixed kernel size. For example, if a 3×3 Winograd conversion circuit is prepared in the AI ​​inference hardware, the circuit can only be used for a normal 3×3 convolution layer, and the speedup by Winograd conversion is not performed for other layers.

[0067] In contrast, according to the present embodiment, as long as the kernel sizes are consistent, it is possible to increase the speed by using a winograd conversion circuit regardless of the value of the dilation rate of the dilation convolution layer, thereby improving versatility.

[0068] As described above, by using the winograd transform circuit for normal convolutional layers to enable the winograd transform even for dilated convolutional layers with the same kernel size, it is possible to expand the range of application of the winograd transform while reducing the amount of computation required for applying the winograd transform.

[0069] The neural network processing executed by the CNN arithmetic circuit 100 in the above embodiment may be realized by a processor such as a CPU (Central Processing Unit) executing a neural network processing program. For example, the neural network processing program may be stored (also called "installed") in advance in a ROM (Read Only Memory) or storage. The neural network processing program may be provided in a form stored in a non-transitory storage medium such as a CD-ROM (Compact Disk Read Only Memory), a DVD-ROM (Digital Versatile Disk Read Only Memory), or a USB (Universal Serial Bus) memory. The neural network processing program may also be downloaded from an external device via a network.

[0070] Furthermore, the neural network processing may be executed by one of these various processors, or may be executed by a combination of two or more processors of the same or different types (e.g., a plurality of FPGAs, a combination of a CPU and an FPGA, etc.) Furthermore, the hardware structure of these various processors is, more specifically, an electric circuit that combines circuit elements such as semiconductor elements.

[0071] All publications, patent applications, and standards mentioned in this specification are herein incorporated by reference to the same extent as if each individual publication, patent application, or standard was specifically and individually indicated to be incorporated by reference.

[0072] The following supplementary notes are further disclosed regarding the above embodiment.

[0073] (Additional note 1) Memory, at least one processor coupled to the memory; Including, The processor, For a two-dimensional convolutional layer that is an expanded convolutional layer having an expansion ratio of 2 or more specified in a winograd transformation process of the convolutional neural network, a plurality of sub-input feature maps are created from the input feature map according to the value of the expansion ratio; A reduced kernel is created by removing a portion of the input kernel that is equal to 0 according to the value of the expansion rate. performing a winograd transformation process on each of the plurality of sub-input feature maps and the reduction kernel to obtain a plurality of sub-convolution results corresponding to each of the plurality of sub-input feature maps; and a neural network processing device configured to combine the sub-convolution results to obtain a convolution result for the two-dimensional convolution layer.

[0074] (Additional note 2) A non-transitory storage medium storing a program executable by a computer to execute neural network processing, The neural network processing includes: For a two-dimensional convolutional layer that is an expanded convolutional layer having an expansion ratio of 2 or more specified in a winograd transformation process of the convolutional neural network, a plurality of sub-input feature maps are created from the input feature map according to the value of the expansion ratio; A reduced kernel is created by removing a portion of the input kernel that is equal to 0 according to the value of the expansion rate. performing a winograd transformation process on each of the plurality of sub-input feature maps and the reduction kernel to obtain a plurality of sub-convolution results corresponding to each of the plurality of sub-input feature maps; Combining the sub-convolution results to obtain a convolution result for the two-dimensional convolution layer. Non-transitory storage medium. [Explanation of symbols]

[0075] 10, 10A Neural network processing unit 100 CNN arithmetic circuit 101A Reduced kernel creation section 101B Sub-input feature map creation unit 102 winograd conversion processing section 103A First matrix transformation unit 103B Second matrix transformation unit 104 Multiplication processing unit 105 3rd matrix transformation unit 106 Sub-convolution result synthesis unit 200 Memory

Claims

1. a sub-input feature map creation unit that creates a plurality of sub-input feature maps from an input feature map according to a value of an expansion rate for a two-dimensional convolution layer that is an expansion convolution layer having an expansion rate of 2 or more specified in a winograd transformation process of the convolutional neural network; a reduced kernel generation unit that generates a reduced kernel by removing a portion that becomes 0 from an input kernel in accordance with the value of the expansion ratio; a winograd transform processing unit that performs a winograd transform process on each of the plurality of sub-input feature maps and the reduced kernel to obtain a plurality of sub-convolution results corresponding to each of the plurality of sub-input feature maps; a sub-convolution result synthesis unit that synthesizes the plurality of sub-convolution results to obtain a convolution result for the two-dimensional convolution layer; A neural network processing device comprising:

2. The Winograd transformation processing unit performs a Winograd transformation process on a two-dimensional convolution layer other than the dilation convolution layer in which the dilation rate is 1, and obtains a convolution result corresponding to the input feature map.

2. The neural network processing device according to claim 1.

3. the sub-input feature map creation unit determines a plurality of separation units that are units for separating each pixel of the input feature map in accordance with the value of the expansion rate, selects pixels at the same position for each of the plurality of separation units, and creates the sub-input feature map by grouping the selected pixels; the reduced kernel creation unit creates the reduced kernel having a size smaller than that of the input kernel, excluding 0s inserted at positions corresponding to the value of the expansion ratio.

2. The neural network processing device according to claim 1.

4. The Winograd transformation processing unit includes: a first matrix transformation unit that performs a matrix transformation on the reduced kernel; a second matrix transformation unit that performs a matrix transformation on each of the plurality of sub-input feature maps; a multiplication unit that derives a Hadamard product of the reduced kernel that has been matrix-transformed by the first matrix transformation unit and each of the plurality of sub-input feature maps that have been matrix-transformed by the second matrix transformation unit; a third matrix transformation unit that performs a matrix transformation on the Hadamard product to obtain the plurality of sub-convolution results; Including, 4. The neural network processing device according to claim 3.

5. A neural network processing device, For a two-dimensional convolution layer that is an expanded convolution layer having an expansion ratio of 2 or more specified in a winograd transformation process of the convolutional neural network, a plurality of sub-input feature maps are created from the input feature map according to the value of the expansion ratio; A reduced kernel is created by removing a portion of the input kernel that is equal to 0 according to the value of the expansion ratio; performing a Winograd transformation process on each of the plurality of sub-input feature maps and the reduction kernel to obtain a plurality of sub-convolution results corresponding to each of the plurality of sub-input feature maps; combining the sub-convolution results to obtain a convolution result for the two-dimensional convolution layer; Neural network processing method.

6. For a two-dimensional convolution layer that is an expanded convolution layer having an expansion ratio of 2 or more specified in a winograd transformation process of the convolutional neural network, a plurality of sub-input feature maps are created from the input feature map according to the value of the expansion ratio; A reduced kernel is created by removing a portion of the input kernel that is equal to 0 according to the value of the expansion ratio; performing a Winograd transformation process on each of the plurality of sub-input feature maps and the reduction kernel to obtain a plurality of sub-convolution results corresponding to each of the plurality of sub-input feature maps; A process of combining the plurality of sub-convolution results to obtain a convolution result for the two-dimensional convolution layer, A neural network processing program to be executed by a computer.

Citation Information

Patent Citations

  • Information processing device, information processing program, and information processing method

    JP2021005242A

  • High-speed computation of convolutional neural networks

    JP2021501377A

  • Method and apparatus with dilated convolution

    US20200175313A1