WO2019184888A1 - Image processing method and apparatus based on convolutional neural network - Google Patents
Image processing method and apparatus based on convolutional neural network Download PDFInfo
- Publication number
- WO2019184888A1 WO2019184888A1 PCT/CN2019/079583 CN2019079583W WO2019184888A1 WO 2019184888 A1 WO2019184888 A1 WO 2019184888A1 CN 2019079583 W CN2019079583 W CN 2019079583W WO 2019184888 A1 WO2019184888 A1 WO 2019184888A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- feature map
- image feature
- pixels
- frame
- image
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/0464—Convolutional networks [CNN, ConvNet]
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T1/00—General purpose image data processing
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2200/00—Indexing scheme for image data processing or generation, in general
- G06T2200/04—Indexing scheme for image data processing or generation, in general involving 3D image data
Definitions
- the present application relates to the field of computer technology, and in particular, to a method and apparatus for image processing based on a convolutional neural network.
- Convolutional Neural Network The in-depth development of the Convolutional Neural Network (CNN) has made it difficult to solve many traditional computer methods in the fields of image processing, pattern recognition, intelligent robotics, automatic control, predictive estimation, biology, medicine, and economy.
- convolution calculation accounts for 90% of the calculation of the whole algorithm model. Therefore, the efficient calculation of convolutional layer is the key to greatly improve the computational efficiency of CNN algorithm model.
- Convolution calculation is realized by hardware acceleration. It is an effective way.
- FIG. 1 shows a schematic diagram of a conventional convolutional neural network convolutional layer.
- the convolution layer is an image feature map (output_fm) obtained by convolving the input image feature map (input_fm) and weights, wherein the number of feature layers of input_fm is N, and the number of feature layers of output_fm is M, weights
- the convolution kernel size is K*K, R is the height of the input image feature map, and P is the width of the input image feature map.
- the calculation of the convolutional layer is a three-dimensional input_fm(N*R*P) multiplied by four-dimensional weights (N*M*K*K) to obtain a three-dimensional output_fm(M*R*P), that is, a K*K convolution.
- the kernel and the corresponding K*K image content on the input image feature map are convoluted to obtain an output point, and it can be seen that when the convolution calculation of the image is performed by using the convolutional neural network convolution layer shown in FIG. Convolution calculation can only be performed on one pixel of the input image feature map, and the calculation performance is low.
- the embodiment of the present application provides a method and apparatus for image processing based on a convolutional neural network to solve the problem of low computational performance of the existing convolutional neural network convolutional layer.
- the embodiment of the present application provides a method for image processing based on a convolutional neural network, comprising: acquiring an FN frame image feature map; and dividing each frame in the FN frame image feature map into Q sub-images, Each of the sub-images has a height of C pixels and a width of P pixels, wherein the sub-images of the same position in the FN frame image feature map form a height of C pixels and a width of P a pixel, a three-dimensional image matrix of FN pixels, wherein Q, C, and P are positive integers; a preset weight matrix is obtained, and the preset weight matrix is a two-dimensional matrix of FNxFN; The weight matrix sequentially performs matrix multiplication calculation on each of the three-dimensional image matrices in the FN frame image feature map to obtain a processed image feature map.
- the value of the FN includes: one of 2, 3, and 4.
- the beneficial effect is that the value of the design FN is a small value, and the number of frames of the image feature map of the convolutional layer input and output is generally an integer multiple of 2, 3 or 4, and the frame of the image feature map that the FN can basically be input.
- the number of frames of the number and output image feature maps are divisible, or the remainder is small, which can improve the calculation performance and save hardware resources.
- the value of the P includes: one of 16, 32, 64, 128, and 256.
- each frame of image feature map is sliced into image blocks.
- the sub-image divided at this time has the same width as the original image feature map, and the height is the height of the preset image block, so that the image feature map can be divided into image blocks of the horizontal bar, and the image data of one line can be processed at one time. , thus compatible with existing image processing frameworks, reducing storage resources.
- the width of the image feature map is equal to the width of the sub-image.
- the C is 1; correspondingly, the height is C pixels, the width is P pixels, and the three-dimensional image matrix of FN pixels is wide P pixels, a two-dimensional image matrix of FN pixels.
- the image feature map is an image to be processed.
- the acquiring an FN frame image feature map includes: going to a previous adjacency
- the processed image feature map obtained in the neural network layer is used as the FN frame image feature map.
- the acquiring an FN frame image feature map includes: sequentially acquiring an image feature map in an N-frame image feature map, and acquiring the FN frame image feature map each time, wherein, N Is a positive integer.
- the number of frames of the image feature map input by the CNN convolutional layer is N.
- the input N-frame image feature maps may be grouped, and each group includes FN. Frame image feature map to improve processing efficiency.
- the obtaining the processed image feature map comprises: sequentially storing the processed image feature map, and storing the processed image feature map of the FN frame each time, wherein The stored image feature map is an M frame, and M is a positive integer.
- an embodiment of the present application provides an apparatus for image processing based on a convolutional neural network, including:
- a first acquiring unit configured to acquire an FN frame image feature map; and a dividing unit, each frame in the FN frame image feature image is divided into Q sub-images, wherein each of the sub-images has a height of C pixels
- the width is P pixels, wherein the sub-images at the same position in the image map of the FN frame form a three-dimensional image matrix with a height of C pixels, a width of P pixels, and a length of FN pixels.
- the Q, C, and P are all positive integers;
- the second acquiring unit is configured to obtain a preset weight matrix, the preset weight matrix is a two-dimensional matrix of FNxFN, and the processing unit is configured to use the preset weight matrix. And performing matrix multiplication calculation on each of the three-dimensional image matrices in the FN frame image feature map to obtain a processed image feature map.
- the value of the FN includes: one of 2, 3, and 4.
- the value of the P includes: one of 16, 32, 64, 128, and 256.
- the width of the image feature map is equal to the width of the sub-image.
- the C is 1; correspondingly, the height is C pixels, the width is P pixels, and the length of the three-dimensional image matrix of FN pixels is width P pixels, a two-dimensional image matrix of FN pixels.
- the image feature map is an image to be processed.
- the first acquiring unit when acquiring an FN frame image feature map, Specifically, the processed image feature map obtained in the last adjacent neural network layer is used as the FN frame image feature map.
- the first acquiring unit when acquiring the FN frame image feature map, is specifically configured to: sequentially acquire image feature maps in the N-frame image feature map, and acquire the FN each time.
- the processing unit when the processing unit obtains the processed image feature map, the processing unit is specifically configured to: sequentially store the processed image feature map, and store the FN frame after the processing.
- the image feature map wherein the stored image feature map is an M frame, and M is a positive integer.
- an embodiment of the present application provides an image processing device, where the device includes a processor and a memory, wherein the memory stores a computer readable program, and the processor is implemented by running a program in the memory.
- the first aspect relates to a method of image processing based on convolutional neural networks.
- the embodiment of the present application provides a computer storage medium for storing the computer software instructions according to the first aspect, which includes a program designed to perform the above aspects.
- an embodiment of the present application further provides a computer program product comprising instructions, when executed on a computer, causing a computer to perform the method described in the first aspect above.
- 1 is a schematic diagram of a convolutional neural network convolutional layer
- FIG. 2 is a diagram of a computing engine architecture of a convolutional neural network
- FIG. 3 is a schematic diagram of a convolutional neural network convolutional layer
- FIG. 4 is a diagram of a computing engine architecture of a convolutional neural network
- FIG. 5 is a flowchart of a method for image processing based on a convolutional neural network in an embodiment of the present application
- FIG. 6 is a schematic diagram of an image processing process of an image processing device in an embodiment of the present application.
- FIGS. 7A, 7B, and 7C are structural diagrams of image feature maps, weight data, and output image feature maps input in the embodiment of the present application;
- FIG. 8 is a structural diagram of a computing engine of a processor in an embodiment of the present application.
- FIG. 9 is a schematic diagram of an apparatus 900 for image processing based on a convolutional neural network according to an embodiment of the present application.
- FIG. 10 is a schematic structural diagram of an image processing apparatus 1000 according to an embodiment of the present application.
- the computational engine architecture designed using the convolutional layer of the convolutional neural network shown in Figure 1 is shown in Figure 2, consisting of K*K multipliers and (K*K-1) adders.
- the size of the convolution kernel K of each convolutional layer of CNN is not fixed, it may be 1x1, 3x3, 5x5 or even 11x11.
- the computing engine of this technology must support convolution kernels of various sizes, that is, the largest convolution kernel needs to be designed in the chip design, such as limiting the maximum support of 7x7, so that a PE needs 49 multipliers on the hardware, for the volume.
- the accumulation is 1x1 and 3x3 convolutional layers, only one or 9 multiplier units are used. In this case, the utilization rate is only 2% and 18%, which will result in a large waste of resources and inefficient use of hardware. Resources to reduce system performance.
- the original image to be convoluted is divided into a plurality of image blocks of Tr*Tc.
- the processing process is as follows.
- Figure 3 shows.
- the specific implementation process is: dividing the number of layers N of the input image feature map into units of Tn, and each Tn layer is used as a unit, and similarly, the number M of layers of the output image feature map is divided into units of Tm, each The Tm layer acts as a unit.
- the corresponding computing engine architecture for implementing the convolution operation is as shown in FIG.
- the calculation engine processes the Tn layer feature map corresponding to one point of the input image feature map, and outputs a Tm layer feature map corresponding to one point.
- the calculation engine consists of Tn*Tm multipliers and (Tn*Tm-1) adders.
- the present application provides a new method and device for image processing based on convolutional neural network. , can improve the calculation performance when convolving the image.
- the present application provides a method for image processing based on a convolutional neural network, which specifically includes the following process:
- Step 50 Acquire an FN frame image feature map.
- acquiring the FN frame image feature map includes: sequentially acquiring an image feature map in the N frame image feature map, and acquiring the FN frame image feature map each time, where N is a positive integer.
- the number of frames of the image feature map input by the CNN convolutional layer is N.
- the input N-frame image feature maps may be grouped, and each group includes FN. Frame image feature map to improve processing efficiency.
- the value of the FN includes: one of 2, 3, and 4.
- the reason for designing the FN in this way is that the number of frames of the image feature map of the input and output of the CNN convolution layer is generally an integer multiple of 2, 3 or 4, and the number of frames of the image feature map that the FN can basically be input is N, and the image features of the output image feature.
- the frame number M of the figure is divisible, or the remainder is small, thereby improving computational performance and saving hardware resources.
- Step 51 Divide each frame in the FN frame image feature map into Q sub-images, wherein each of the sub-images has a height of C pixels and a width of P pixels, wherein the FN frame
- the sub-images at the same position in the image feature map constitute a three-dimensional image matrix of C pixels, a width of P pixels, and a length of FN pixels, wherein Q, C, and P are positive integers.
- the value of the P includes: one of 16, 32, 64, 128, and 256; the width of the image feature map is equal to the width of the sub-image.
- each frame of the image feature map can be processed into a pattern of stripes.
- the sub-image segmented at this time has the same width as the original image feature map, and the height is the height of the preset image block, so that the image feature map can be divided into horizontal bar image blocks, and one line of image data can be processed at one time.
- the C is 1; correspondingly, the height is C pixels, the width is P pixels, and the three-dimensional image matrix of FN pixels is P pixels wide. A two-dimensional image matrix of FN pixels.
- Step 52 Acquire a preset weight matrix, where the preset weight matrix is a two-dimensional matrix of FNxFN.
- Step 53 Perform matrix multiplication calculation on each of the three-dimensional image matrices in the FN frame image feature map according to the preset weight matrix to obtain a processed image feature map.
- the image feature map is an image to be processed.
- the acquiring the FN frame image feature map includes: the processing to be obtained in the last adjacent neural network layer The image feature map is used as the FN frame image feature map.
- the obtaining the processed image feature map in step 53 includes: sequentially storing the processed image feature map, and storing the processed image feature map of the FN frame each time, wherein the stored image feature
- the image feature map is an M frame, and M is a positive integer.
- the embodiment of the present application proposes a new image processing device, where the image processing device includes a memory and a processor, wherein the number of frames of the input image feature map (input_fm) received by the image processing device is N, the number of frames of the output image feature map (output_fm) is M, and the size of the convolution kernel of the weight is K*K.
- the workflow of the image processing apparatus can be seen in FIG. 6.
- S101 Receive an input N frame image feature map, as shown in FIG. 7A.
- the input image feature map is the three-dimensional data of N*P*C, that is, the size of each feature map is P*C, there are N image feature maps in total, C is the height of the image feature map, and P is the image feature map. width.
- the weight data is a four-dimensional matrix composed of M*N K*K convolution kernels, that is, a four-dimensional matrix of M*N*K*K, as shown in FIG. 7B.
- the image feature map is stored in the memory in the order from the first image feature map to the Nth image feature map, and each image feature map is stored point by point in a left-to-right, top-to-bottom order.
- the number of frames of the output image feature map is M, which is stored in a similar manner to the input image feature map.
- the storage order of the weight data in the memory is to store the two-dimensional data of K*K first, then store the N-dimensional data, and finally store the M-dimensional data.
- S104 The processor calls an image feature map stored in the memory, and acquires a basic unit of the input image feature map in the memory.
- the basic unit of the image feature map is: a two-dimensional image matrix of FN*P composed of corresponding P pixels on the image map of the adjacent FN frame, wherein P is set to the width of one row of each image block.
- the acquiring process of the basic unit of the input image feature map is: taking a two-dimensional matrix of the FN*C as a basic unit and acquiring the loop image by using a loop Tiling on the input image feature map.
- the loop is first cycled in the direction of arrow i1 (i.e., N) in Figure 7A and then in the direction of arrow i2 (i.e., C).
- the two-dimensional matrix FN*P composed of all the pixels in the first row of the image feature map of the first, second, ..., FN frame is composed to form the first input image feature map basic unit; then, according to the arrow i1 in FIG.
- S105 The processor calls the weight data stored in the memory, and acquires the basic unit of the weight data in the memory.
- the basic unit of the weight data is: a two-dimensional matrix composed of FN*FN weights.
- the basic unit obtaining process of the weight data is: acquiring, by using a FN*FN*1*1 as a basic unit, a four-dimensional weight data stored in the memory in a loop Tiling manner.
- the direction of the cycle; the other is to first cycle in the direction of arrow w1 (ie K*K) in Figure 7B, then cycle in the direction of arrow w3 (ie M), and finally cycle in the direction of arrow w2 (ie N) .
- S106 The processor performs multiplication calculation on the basic unit of the image feature map and the basic unit of the weight data to output a basic unit of the image feature map.
- the basic unit of the output image feature map and the basic unit of the input image feature map have the same data format, and are: two-dimensional FN*P composed of P pixels corresponding to the image map of the adjacent FN frame image. matrix.
- the basic unit of the output image feature map is stored in the following manner: the basic unit of the output image feature map is filled with the FN*P as a basic unit in a cyclic block manner to the output image feature map, and the loop mode is It is first circulated in the direction of the arrow o1 (i.e., M) in Fig. 7C and then in the direction of the arrow o2 (i.e., C).
- S108 Determine whether the processor is applied to the last neural network layer of the convolutional neural network, and if yes, execute S109; otherwise, return the output image feature map as an input image feature map of the next neural network layer to execute S104.
- the processor designed by the image processing method of the present application can construct the basic unit of the input image feature map and the basic unit of the weight data, perform multiplication operation, and obtain the output basic unit of the special function diagram, and the calculation engine architecture of the processor is as shown in the figure. 8 shows:
- the computation engine architecture consists of P*FN*FN multipliers and P*FN*(FN-1) adders.
- the addition operation is performed on the device to obtain the basic unit of the output image feature map.
- the FN is set to a smaller value, specifically set to 2, 3 or 4.
- the number of image feature layers of the input and output of the CNN convolutional layer is generally an integer multiple of 2 or 3.
- the FN can be substantially divisible by M and N or the remainder is small. Therefore, it is possible to improve the utilization of hardware resources in the processor and improve resources. Utilization, achieving higher computing performance.
- P is set to the width of each image block in a specific implementation, so that the calculation engine can process image data of one line at a time.
- it is easier to expand when resources are allowed, and only need to increase P.
- the embodiment of the present application provides an apparatus 900 for image processing based on a convolutional neural network, where the apparatus 900 includes a first obtaining unit 901, a dividing unit 902, and a second acquiring unit 903.
- Processing unit 904 wherein:
- a first acquiring unit 901 configured to acquire an FN frame image feature map
- the dividing unit 902 is divided into Q sub-images for each frame in the FN frame image feature map, wherein each of the sub-images has a height of C pixels and a width of P pixels, wherein the FN
- the sub-images at the same position in the frame image feature map form a three-dimensional image matrix with C pixels, a P pixel, and a FN pixel, wherein Q, C, and P are positive integers;
- the second obtaining unit 903 is configured to acquire a preset weight matrix, where the preset weight matrix is a two-dimensional matrix of FNxFN;
- the processing unit 904 is configured to perform matrix multiplication calculation on each of the three-dimensional image matrices in the FN frame image feature map according to the preset weight matrix to obtain a processed image feature map.
- the value of the FN includes: one of 2, 3, and 4.
- the value of the P includes: one of 16, 32, 64, 128, and 256.
- the width of the image feature map is equal to the width of the sub-image.
- the C is 1; correspondingly, the height is C pixels, the width is P pixels, and the three-dimensional image matrix of FN pixels is P pixels wide and FN long. A two-dimensional image matrix of pixels.
- the image feature map is an image to be processed.
- the first acquiring unit 901 is specifically configured to: when acquiring the FN frame image feature map The processed image feature map obtained in an adjacent neural network layer is used as the FN frame image feature map.
- the first acquiring unit 901 when acquiring the FN frame image feature map, is specifically configured to:
- the image feature maps in the N-frame image feature map are sequentially acquired, and the FN frame image feature map is acquired each time, where N is a positive integer.
- the processing unit 904 is specifically configured to:
- the processed image feature map is sequentially stored, and the processed image feature map of the FN frame is stored each time, wherein the stored image feature map is an M frame, and M is a positive integer.
- an embodiment of the present application further provides an image processing apparatus 1000.
- the image processing apparatus 1000 includes a processor 1001 and a memory 1002.
- the program code for executing the solution of the present invention is stored in the memory 1002.
- the instruction processor 1001 is used to execute the image processing method shown in FIG.
- the application can also perform the design programming of the processor to solidify the code corresponding to the method shown in FIG. 5 into the chip, so that the chip can perform the method shown in FIG. 5 during operation.
- processors in the embodiment of the present application may be a CPU, a DSP, an ASIC, or one or more integrated circuits for controlling the execution of the program of the present invention.
- One or more memories included in the computer system which may be read-only memory (ROM: ROM) or other types of static storage devices that can store static information and instructions, random access memory (English: random accessmemory, Abbreviation: RAM) or other types of dynamic storage devices that can store information and instructions, or disk storage.
- ROM read-only memory
- RAM random access memory
- dynamic storage devices that can store information and instructions, or disk storage.
- embodiments of the present application can be provided as a method, system, or computer program product. Therefore, the embodiments of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Moreover, embodiments of the present application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
- computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
- Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present application. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG.
- These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device.
- the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
- the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
- These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
- the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- Artificial Intelligence (AREA)
- Biomedical Technology (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Life Sciences & Earth Sciences (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Health & Medical Sciences (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Image Analysis (AREA)
Abstract
Description
本申请要求在2018年03月28日提交中国专利局、申请号为201810266076.7、发明名称为《一种基于卷积神经网络的图像处理的方法和装置》的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application No. 201810266076.7, entitled "Method and Apparatus for Image Processing Based on Convolutional Neural Networks", filed on March 28, 2018, the entire contents of which is incorporated herein by reference. This is incorporated herein by reference.
本申请涉及计算机技术领域,尤其涉及一种基于卷积神经网络的图像处理的方法和装置。The present application relates to the field of computer technology, and in particular, to a method and apparatus for image processing based on a convolutional neural network.
卷积神经网络(Convolutional Neural Network,CNN)的深入发展,使其在图像处理、模式识别、智能机器人、自动控制、预测估计、生物、医学、经济等领域已成功地解决了许多传统计算机方法难以解决的实际问题。在实现卷积神经网络算法的模型中,卷积计算占整个算法模型90%的计算量,因此卷积层的高效计算是大幅提升CNN算法模型的计算效率的关键,通过硬件加速实现卷积计算是一种有效途径。The in-depth development of the Convolutional Neural Network (CNN) has made it difficult to solve many traditional computer methods in the fields of image processing, pattern recognition, intelligent robotics, automatic control, predictive estimation, biology, medicine, and economy. The actual problem solved. In the model of convolutional neural network algorithm, convolution calculation accounts for 90% of the calculation of the whole algorithm model. Therefore, the efficient calculation of convolutional layer is the key to greatly improve the computational efficiency of CNN algorithm model. Convolution calculation is realized by hardware acceleration. It is an effective way.
图1所示为传统的卷积神经网络卷积层的示意图。卷积层是输入的图像特征图(input_fm)与权重(weights)做卷积运算得到输出的图像特征图(output_fm),其中input_fm的特征层数为N,output_fm的特征层数为M,weights的卷积核大小为K*K,R为输入的图像特征图的高,P为输入的图像特征图的宽。卷积层的计算是三维的input_fm(N*R*P)与四维weights(N*M*K*K)相乘得到三维的output_fm(M*R*P),即一个K*K的卷积核与输入的图像特征图上对应的K*K的图像内容做卷积得到一个输出点,由此可知,利用图1所示的卷积神经网络卷积层进行图像的卷积计算时,一次仅能对输入的图像特征图的一个像素点进行卷积计算,计算性能低下。Figure 1 shows a schematic diagram of a conventional convolutional neural network convolutional layer. The convolution layer is an image feature map (output_fm) obtained by convolving the input image feature map (input_fm) and weights, wherein the number of feature layers of input_fm is N, and the number of feature layers of output_fm is M, weights The convolution kernel size is K*K, R is the height of the input image feature map, and P is the width of the input image feature map. The calculation of the convolutional layer is a three-dimensional input_fm(N*R*P) multiplied by four-dimensional weights (N*M*K*K) to obtain a three-dimensional output_fm(M*R*P), that is, a K*K convolution. The kernel and the corresponding K*K image content on the input image feature map are convoluted to obtain an output point, and it can be seen that when the convolution calculation of the image is performed by using the convolutional neural network convolution layer shown in FIG. Convolution calculation can only be performed on one pixel of the input image feature map, and the calculation performance is low.
发明内容Summary of the invention
本申请实施例提供一种基于卷积神经网络的图像处理的方法和装置,以解决现有的卷积神经网络卷积层的计算性能较低的问题。The embodiment of the present application provides a method and apparatus for image processing based on a convolutional neural network to solve the problem of low computational performance of the existing convolutional neural network convolutional layer.
本申请实施例提供的具体技术方案如下:The specific technical solutions provided by the embodiments of the present application are as follows:
第一方面,本申请实施例提供一种基于卷积神经网络的图像处理的方法,包括:获取FN帧图像特征图;对所述FN帧图像特征图中的每一帧均分成Q个子图像,其中每个所述子图像的高为C个像素点,宽为P个像素点,其中,所述FN帧图像特征图中相同位置的子图像组成一个高为C个像素点,宽为P个像素点,长为FN个像素点的三维图像矩阵,其中,Q,C,P均为正整数;获取预设权重矩阵,所述预设权重矩阵为FNxFN的二维矩阵;根据所述预设权重矩阵,依次对所述FN帧图像特征图中的每个所述三维图像矩阵进行矩阵乘法计算,以获得处理后的图像特征图。In a first aspect, the embodiment of the present application provides a method for image processing based on a convolutional neural network, comprising: acquiring an FN frame image feature map; and dividing each frame in the FN frame image feature map into Q sub-images, Each of the sub-images has a height of C pixels and a width of P pixels, wherein the sub-images of the same position in the FN frame image feature map form a height of C pixels and a width of P a pixel, a three-dimensional image matrix of FN pixels, wherein Q, C, and P are positive integers; a preset weight matrix is obtained, and the preset weight matrix is a two-dimensional matrix of FNxFN; The weight matrix sequentially performs matrix multiplication calculation on each of the three-dimensional image matrices in the FN frame image feature map to obtain a processed image feature map.
该有益效果在于,在对输入的图像特征图进行卷积处理时,一次图像卷积过程能够处理一个子图像的数据,提高计算性能。This has the advantage that, in the convolution processing of the input image feature map, the one-time image convolution process can process the data of one sub-image and improve the calculation performance.
结合第一方面,一种可能的设计中,所述FN的取值包括:2,3和4中的一个。In combination with the first aspect, in a possible design, the value of the FN includes: one of 2, 3, and 4.
该有益效果在于,设计FN的值为较小的值,卷积层输入输出的图像特征图的帧数一般为2,3或4的整数倍,FN基本上能够被输入的图像特征图的帧数、输出的图像特征图的帧数整除,或者余数很小,从而能够提高计算性能,节约硬件资源。The beneficial effect is that the value of the design FN is a small value, and the number of frames of the image feature map of the convolutional layer input and output is generally an integer multiple of 2, 3 or 4, and the frame of the image feature map that the FN can basically be input. The number of frames of the number and output image feature maps are divisible, or the remainder is small, which can improve the calculation performance and save hardware resources.
结合第一方面,一种可能的设计中,所述P的取值包括:16,32,64,128和256中的一个。In combination with the first aspect, in a possible design, the value of the P includes: one of 16, 32, 64, 128, and 256.
该有益效果在于,可以将每一帧图像特征图切分成图像块的方式处理。此时,此时切分的子图像与原来的图像特征图宽度相同,高度为预设的图像块的高度,这样能够将图像特征图切分成横条的图像块,一次可以处理一行的图像数据,从而与现有的图像处理框架兼容,减少存储资源。This has the advantage that it can be processed in such a way that each frame of image feature map is sliced into image blocks. At this time, the sub-image divided at this time has the same width as the original image feature map, and the height is the height of the preset image block, so that the image feature map can be divided into image blocks of the horizontal bar, and the image data of one line can be processed at one time. , thus compatible with existing image processing frameworks, reducing storage resources.
结合第一方面,一种可能的设计中,所述图像特征图的宽与所述子图像的宽相等。In conjunction with the first aspect, in one possible design, the width of the image feature map is equal to the width of the sub-image.
结合第一方面,一种可能的设计中,所述C为1;对应的,所述高为C个像素点,宽为P个像素点,长为FN个像素点的三维图像矩阵为宽为P个像素点,长为FN个像素点的二维图像矩阵。With reference to the first aspect, in a possible design, the C is 1; correspondingly, the height is C pixels, the width is P pixels, and the three-dimensional image matrix of FN pixels is wide P pixels, a two-dimensional image matrix of FN pixels.
结合第一方面,一种可能的设计中,当所述方法用于所述卷积神经网络的第一个神经网络层时,所述图像特征图为待处理图像。In conjunction with the first aspect, in one possible design, when the method is applied to the first neural network layer of the convolutional neural network, the image feature map is an image to be processed.
结合第一方面,一种可能的设计中,当所述方法用于所述卷积神经网络的非第一个神经网络层时,所述获取FN帧图像特征图,包括:将在上一个邻接的神经网络层中获得的处理后的图像特征图作为所述FN帧图像特征图。In conjunction with the first aspect, in a possible design, when the method is used for a non-first neural network layer of the convolutional neural network, the acquiring an FN frame image feature map includes: going to a previous adjacency The processed image feature map obtained in the neural network layer is used as the FN frame image feature map.
结合第一方面,一种可能的设计中,所述获取FN帧图像特征图,包括:依次获取N帧图像特征图中的图像特征图,每次获取所述FN帧图像特征图,其中,N为正整数。With reference to the first aspect, in a possible design, the acquiring an FN frame image feature map includes: sequentially acquiring an image feature map in an N-frame image feature map, and acquiring the FN frame image feature map each time, wherein, N Is a positive integer.
实际应用中,CNN卷积层输入的图像特征图的帧数为N,在进行基于卷积神经网络的图像处理时,可以对输入的N帧图像特征图进行分组处理,每个分组中包括FN帧图像特征图,提高处理效率。In practical applications, the number of frames of the image feature map input by the CNN convolutional layer is N. When performing image processing based on the convolutional neural network, the input N-frame image feature maps may be grouped, and each group includes FN. Frame image feature map to improve processing efficiency.
结合第一方面,一种可能的设计中,所述获得处理后的图像特征图,包括:依次存储所述处理后的图像特征图,每次存储FN帧所述处理后的图像特征图,其中,所述存储后的图像特征图为M帧,M为正整数。With reference to the first aspect, in a possible design, the obtaining the processed image feature map comprises: sequentially storing the processed image feature map, and storing the processed image feature map of the FN frame each time, wherein The stored image feature map is an M frame, and M is a positive integer.
第二方面,本申请实施例提供一种基于卷积神经网络的图像处理的装置,包括:In a second aspect, an embodiment of the present application provides an apparatus for image processing based on a convolutional neural network, including:
第一获取单元,用于获取FN帧图像特征图;划分单元,对所述FN帧图像特征图中的每一帧均分成Q个子图像,其中每个所述子图像的高为C个像素点,宽为P个像素点,其中,所述FN帧图像特征图中相同位置的子图像组成一个高为C个像素点,宽为P个像素点,长为FN个像素点的三维图像矩阵,其中,Q,C,P均为正整数;第二获取单元,用于获取预设权重矩阵,所述预设权重矩阵为FNxFN的二维矩阵;处理单元,用于根据所述预设权重矩阵,依次对所述FN帧图像特征图中的每个所述三维图像矩阵进行矩阵乘法计算,以获得处理后的图像特征图。a first acquiring unit, configured to acquire an FN frame image feature map; and a dividing unit, each frame in the FN frame image feature image is divided into Q sub-images, wherein each of the sub-images has a height of C pixels The width is P pixels, wherein the sub-images at the same position in the image map of the FN frame form a three-dimensional image matrix with a height of C pixels, a width of P pixels, and a length of FN pixels. The Q, C, and P are all positive integers; the second acquiring unit is configured to obtain a preset weight matrix, the preset weight matrix is a two-dimensional matrix of FNxFN, and the processing unit is configured to use the preset weight matrix. And performing matrix multiplication calculation on each of the three-dimensional image matrices in the FN frame image feature map to obtain a processed image feature map.
结合第二方面,一种可能的设计中,所述FN的取值包括:2,3和4中的一个。In combination with the second aspect, in a possible design, the value of the FN includes: one of 2, 3, and 4.
结合第二方面,一种可能的设计中,所述P的取值包括:16,32,64,128和256中的一个。In combination with the second aspect, in a possible design, the value of the P includes: one of 16, 32, 64, 128, and 256.
结合第二方面,一种可能的设计中,所述图像特征图的宽与所述子图像的宽相等。In conjunction with the second aspect, in one possible design, the width of the image feature map is equal to the width of the sub-image.
结合第二方面,一种可能的设计中,所述C为1;对应的,所述高为C个像素点,宽为P个像素点,长为FN个像素点的三维图像矩阵为宽为P个像素点,长为FN个像素点 的二维图像矩阵。With reference to the second aspect, in a possible design, the C is 1; correspondingly, the height is C pixels, the width is P pixels, and the length of the three-dimensional image matrix of FN pixels is width P pixels, a two-dimensional image matrix of FN pixels.
结合第二方面,一种可能的设计中,当所述装置用于处理所述卷积神经网络的第一个神经网络层时,所述图像特征图为待处理图像。In conjunction with the second aspect, in one possible design, when the apparatus is for processing a first neural network layer of the convolutional neural network, the image feature map is an image to be processed.
结合第二方面,一种可能的设计中,当所述装置用于处理所述卷积神经网络的非第一个神经网络层时,所述第一获取单元在获取FN帧图像特征图时,具体用于:将在上一个邻接的神经网络层中获得的处理后的图像特征图作为所述FN帧图像特征图。With reference to the second aspect, in a possible design, when the apparatus is configured to process a non-first neural network layer of the convolutional neural network, the first acquiring unit, when acquiring an FN frame image feature map, Specifically, the processed image feature map obtained in the last adjacent neural network layer is used as the FN frame image feature map.
结合第二方面,一种可能的设计中,所述第一获取单元在获取FN帧图像特征图时,具体用于:依次获取N帧图像特征图中的图像特征图,每次获取所述FN帧图像特征图,其中,N为正整数。With reference to the second aspect, in a possible design, when acquiring the FN frame image feature map, the first acquiring unit is specifically configured to: sequentially acquire image feature maps in the N-frame image feature map, and acquire the FN each time. A frame image feature map in which N is a positive integer.
结合第二方面,一种可能的设计中,所述处理单元在获得处理后的图像特征图时,具体用于:依次存储所述处理后的图像特征图,每次存储FN帧所述处理后的图像特征图,其中,所述存储后的图像特征图为M帧,M为正整数。With reference to the second aspect, in a possible design, when the processing unit obtains the processed image feature map, the processing unit is specifically configured to: sequentially store the processed image feature map, and store the FN frame after the processing. The image feature map, wherein the stored image feature map is an M frame, and M is a positive integer.
第三方面,本申请实施例提供一种图像处理设备,该设备包括处理器、存储器,其中,所述存储器中存有计算机可读程序,所述处理器通过运行所述存储器中的程序,实现第一方面涉及的基于卷积神经网络的图像处理的方法。In a third aspect, an embodiment of the present application provides an image processing device, where the device includes a processor and a memory, wherein the memory stores a computer readable program, and the processor is implemented by running a program in the memory. The first aspect relates to a method of image processing based on convolutional neural networks.
第四方面,本申请实施例提供一种计算机存储介质,用于储存为上述第一方面所述计算机软件指令,其包含用于执行上述方面所设计的程序。In a fourth aspect, the embodiment of the present application provides a computer storage medium for storing the computer software instructions according to the first aspect, which includes a program designed to perform the above aspects.
第五方面,本申请实施例还提供一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面所述的方法。In a fifth aspect, an embodiment of the present application further provides a computer program product comprising instructions, when executed on a computer, causing a computer to perform the method described in the first aspect above.
应理解,本申请实施例的第二至五方面与本申请实施例的第一、二方面的技术方案一致,各方面及对应的可实施的设计方式所取得的有益效果相似,不再赘述。It should be understood that the second to fifth aspects of the embodiments of the present application are consistent with the technical solutions of the first and second aspects of the embodiments of the present application, and the beneficial effects obtained by the aspects and the corresponding implementable design manners are similar, and are not described again.
图1为一种卷积神经网络卷积层示意图;1 is a schematic diagram of a convolutional neural network convolutional layer;
图2为一种卷积神经网络的计算引擎架构图;2 is a diagram of a computing engine architecture of a convolutional neural network;
图3为一种卷积神经网络卷积层示意图;3 is a schematic diagram of a convolutional neural network convolutional layer;
图4为一种卷积神经网络的计算引擎架构图;4 is a diagram of a computing engine architecture of a convolutional neural network;
图5为本申请实施例中的基于卷积神经网络的图像处理的方法流程图;FIG. 5 is a flowchart of a method for image processing based on a convolutional neural network in an embodiment of the present application; FIG.
图6为本申请实施例中的图像处理设备的图像处理过程示意图;6 is a schematic diagram of an image processing process of an image processing device in an embodiment of the present application;
图7A、图7B和图7C为本申请实施例中输入的图像特征图、权重数据和输出的图像特征图的结构图;7A, 7B, and 7C are structural diagrams of image feature maps, weight data, and output image feature maps input in the embodiment of the present application;
图8为本申请实施例中的处理器的计算引擎架构图;8 is a structural diagram of a computing engine of a processor in an embodiment of the present application;
图9为本申请实施例中基于卷积神经网络的图像处理的装置900示意图;FIG. 9 is a schematic diagram of an apparatus 900 for image processing based on a convolutional neural network according to an embodiment of the present application;
图10为本申请实施例中图像处理设备1000结构示意图。FIG. 10 is a schematic structural diagram of an
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。The technical solutions in the embodiments of the present application will be clearly and completely described in the following with reference to the accompanying drawings in the embodiments.
利用图1所示的卷积神经网络的卷积层所设计的计算引擎架构如图2所示,由K*K个 乘法器以及(K*K-1)个加法器组成。The computational engine architecture designed using the convolutional layer of the convolutional neural network shown in Figure 1 is shown in Figure 2, consisting of K*K multipliers and (K*K-1) adders.
由于CNN的各卷积层的卷积核K的大小不是固定的,有可能为1x1,3x3,5x5甚至到11x11。该技术的计算引擎必须要支持各种大小的卷积核,即在芯片设计时需要设计为最大的卷积核,比如限定最大支持7x7,这样在硬件上一个PE需要49个乘法器,对于卷积核为1x1以及3x3的卷积层,只用到其中1个或者9个乘法器单元,该情况下利用率只有2%以及18%,这样就会存在很大的资源浪费,不能高效利用硬件资源,降低系统性能。Since the size of the convolution kernel K of each convolutional layer of CNN is not fixed, it may be 1x1, 3x3, 5x5 or even 11x11. The computing engine of this technology must support convolution kernels of various sizes, that is, the largest convolution kernel needs to be designed in the chip design, such as limiting the maximum support of 7x7, so that a PE needs 49 multipliers on the hardware, for the volume. The accumulation is 1x1 and 3x3 convolutional layers, only one or 9 multiplier units are used. In this case, the utilization rate is only 2% and 18%, which will result in a large waste of resources and inefficient use of hardware. Resources to reduce system performance.
目前还有一种改进的卷积神经网络的计算方法是,按照分块处理的思想,将需要进行卷积运算原图划分成许多Tr*Tc的图像块,对于每一个图像块,其处理过程如图3所示。具体的实现过程为:将输入的图像特征图的层数N以Tn为单位进行划分,每Tn层作为一个单元,同理将输出的图像特征图的层数M以Tm为单位进行划分,每Tm层作为一个单元。具体的,对应的实现卷积运算的计算引擎架构如图4所示:该计算引擎处理输入的图像特征图的一个点对应的Tn层特征图,输出一个点对应的Tm层特征图。该计算引擎有Tn*Tm个乘法器和(Tn*Tm-1)个加法器组成。At present, there is an improved convolutional neural network calculation method. According to the idea of block processing, the original image to be convoluted is divided into a plurality of image blocks of Tr*Tc. For each image block, the processing process is as follows. Figure 3 shows. The specific implementation process is: dividing the number of layers N of the input image feature map into units of Tn, and each Tn layer is used as a unit, and similarly, the number M of layers of the output image feature map is divided into units of Tm, each The Tm layer acts as a unit. Specifically, the corresponding computing engine architecture for implementing the convolution operation is as shown in FIG. 4: the calculation engine processes the Tn layer feature map corresponding to one point of the input image feature map, and outputs a Tm layer feature map corresponding to one point. The calculation engine consists of Tn*Tm multipliers and (Tn*Tm-1) adders.
CNN各层卷积层的输入的图像特征图和输出的图像特征图的层数不同,如果Tm,Tn设置较小,该计算引擎的计算能力较小,性能较低。如果Tm,Tn设置较大会造成硬件资源的浪费。假设一种可能的设计中,设计Tm=64,Tn=7,这样一个计算引擎有448个乘法器。一般CNN网络中有很多卷积层中输入输出的图像特征图层数比7以及64小,并且很多不是7和64的整数倍,这样不能充分利用硬件资源造成资源浪费。例如,输入的图像特征图和输出的图像特征图的层数分别是3和6,此时只利用到448个乘法器中的18个乘法器,利用率只有4%,造成硬件资源的浪费。The input image feature map of the CNN layer convolution layer is different from the output image feature map. If the Tm and Tn settings are small, the calculation engine has a small calculation capability and low performance. If Tm, Tn setting is large, it will cause waste of hardware resources. Assuming a possible design, the design Tm = 64, Tn = 7, such a calculation engine has 448 multipliers. In many CNN networks, there are many convolutional layers in which the number of image feature layers is smaller than 7 and 64, and many are not integer multiples of 7 and 64. This does not make full use of hardware resources to waste resources. For example, the input image feature map and the output image feature map have layers of 3 and 6, respectively, and only 18 of the 448 multipliers are utilized, and the utilization rate is only 4%, resulting in waste of hardware resources.
由于采用现有的基于卷积神经网络的计算方法来设计的计算引擎不可避免的会出现硬件资源的浪费,鉴于此,本申请提供一种新的基于卷积神经网络的图像处理的方法和装置,在对图像进行卷积运算时能够提高计算性能。Since the calculation engine designed by using the existing convolutional neural network-based calculation method inevitably wastes hardware resources, the present application provides a new method and device for image processing based on convolutional neural network. , can improve the calculation performance when convolving the image.
参阅图5所示,本申请提供一种基于卷积神经网络的图像处理的方法,具体包括如下过程:As shown in FIG. 5, the present application provides a method for image processing based on a convolutional neural network, which specifically includes the following process:
步骤50:获取FN帧图像特征图。Step 50: Acquire an FN frame image feature map.
具体的,获取FN帧图像特征图,包括:依次获取N帧图像特征图中的图像特征图,每次获取所述FN帧图像特征图,其中,N为正整数。Specifically, acquiring the FN frame image feature map includes: sequentially acquiring an image feature map in the N frame image feature map, and acquiring the FN frame image feature map each time, where N is a positive integer.
实际应用中,CNN卷积层输入的图像特征图的帧数为N,在进行基于卷积神经网络的图像处理时,可以对输入的N帧图像特征图进行分组处理,每个分组中包括FN帧图像特征图,提高处理效率。In practical applications, the number of frames of the image feature map input by the CNN convolutional layer is N. When performing image processing based on the convolutional neural network, the input N-frame image feature maps may be grouped, and each group includes FN. Frame image feature map to improve processing efficiency.
其中,所述FN的取值包括:2,3和4中的一个。这样设计FN的原因是,CNN卷积层输入输出的图像特征图的帧数一般为2,3或4的整数倍,FN基本上能够被输入的图像特征图的帧数N、输出的图像特征图的帧数M整除,或者余数很小,从而能够提高计算性能,节约硬件资源。The value of the FN includes: one of 2, 3, and 4. The reason for designing the FN in this way is that the number of frames of the image feature map of the input and output of the CNN convolution layer is generally an integer multiple of 2, 3 or 4, and the number of frames of the image feature map that the FN can basically be input is N, and the image features of the output image feature. The frame number M of the figure is divisible, or the remainder is small, thereby improving computational performance and saving hardware resources.
步骤51:对所述FN帧图像特征图中的每一帧均分成Q个子图像,其中每个所述子图像的高为C个像素点,宽为P个像素点,其中,所述FN帧图像特征图中相同位置的子图像组成一个高为C个像素点,宽为P个像素点,长为FN个像素点的三维图像矩阵,其中,Q,C,P均为正整数。Step 51: Divide each frame in the FN frame image feature map into Q sub-images, wherein each of the sub-images has a height of C pixels and a width of P pixels, wherein the FN frame The sub-images at the same position in the image feature map constitute a three-dimensional image matrix of C pixels, a width of P pixels, and a length of FN pixels, wherein Q, C, and P are positive integers.
可选的,所述P的取值包括:16,32,64,128和256中的一个;所述图像特征图的 宽与所述子图像的宽相等。Optionally, the value of the P includes: one of 16, 32, 64, 128, and 256; the width of the image feature map is equal to the width of the sub-image.
这样,可以将每一帧图像特征图切分成图像块(stripe)的方式处理。此时,此时切分的子图像与原来的图像特征图宽度相同,高度为预设的图像块的高度,这样能够将图像特征图切分成横条图像块,一次可以处理一行的图像数据。In this way, each frame of the image feature map can be processed into a pattern of stripes. At this time, the sub-image segmented at this time has the same width as the original image feature map, and the height is the height of the preset image block, so that the image feature map can be divided into horizontal bar image blocks, and one line of image data can be processed at one time.
一种可能的设计中,所述C为1;对应的,所述高为C个像素点,宽为P个像素点,长为FN个像素点的三维图像矩阵为宽为P个像素点,长为FN个像素点的二维图像矩阵。In a possible design, the C is 1; correspondingly, the height is C pixels, the width is P pixels, and the three-dimensional image matrix of FN pixels is P pixels wide. A two-dimensional image matrix of FN pixels.
步骤52:获取预设权重矩阵,所述预设权重矩阵为FNxFN的二维矩阵。Step 52: Acquire a preset weight matrix, where the preset weight matrix is a two-dimensional matrix of FNxFN.
步骤53:根据所述预设权重矩阵,依次对所述FN帧图像特征图中的每个所述三维图像矩阵进行矩阵乘法计算,以获得处理后的图像特征图。Step 53: Perform matrix multiplication calculation on each of the three-dimensional image matrices in the FN frame image feature map according to the preset weight matrix to obtain a processed image feature map.
进一步的,当图5所示的方法用于所述卷积神经网络的第一个神经网络层时,所述图像特征图为待处理图像。当图5所示的方法用于所述卷积神经网络的非第一个神经网络层时,所述获取FN帧图像特征图,包括:将在上一个邻接的神经网络层中获得的处理后的图像特征图作为所述FN帧图像特征图。Further, when the method shown in FIG. 5 is used for the first neural network layer of the convolutional neural network, the image feature map is an image to be processed. When the method shown in FIG. 5 is used for the non-first neural network layer of the convolutional neural network, the acquiring the FN frame image feature map includes: the processing to be obtained in the last adjacent neural network layer The image feature map is used as the FN frame image feature map.
具体的,步骤53中所述获得处理后的图像特征图,包括:依次存储所述处理后的图像特征图,每次存储FN帧所述处理后的图像特征图,其中,所述存储后的图像特征图为M帧,M为正整数。Specifically, the obtaining the processed image feature map in
基于图5所示的方法,本申请实施例提出一种新的图像处理设备,该图像处理设备包括存储器和处理器其中,该图像处理设备接收的输入的图像特征图(input_fm)的帧数为N,输出的图像特征图(output_fm)的帧数为M,权重的卷积核大小为K*K,该图像处理设备的工作流程可以参阅图6所示。Based on the method shown in FIG. 5, the embodiment of the present application proposes a new image processing device, where the image processing device includes a memory and a processor, wherein the number of frames of the input image feature map (input_fm) received by the image processing device is N, the number of frames of the output image feature map (output_fm) is M, and the size of the convolution kernel of the weight is K*K. The workflow of the image processing apparatus can be seen in FIG. 6.
S101:接收输入的N帧图像特征图,如图7A所示。S101: Receive an input N frame image feature map, as shown in FIG. 7A.
输入的图像特征图即为N*P*C的三维数据,即每个特征图的大小为P*C,总共有N帧图像特征图,C为图像特征图的高度,P为图像特征图的宽度。The input image feature map is the three-dimensional data of N*P*C, that is, the size of each feature map is P*C, there are N image feature maps in total, C is the height of the image feature map, and P is the image feature map. width.
S102:获取权重数据。S102: Obtain weight data.
其中,权重数据是一个四维的矩阵,由M*N个K*K的卷积核组成,即M*N*K*K的四维矩阵,如图7B所示。The weight data is a four-dimensional matrix composed of M*N K*K convolution kernels, that is, a four-dimensional matrix of M*N*K*K, as shown in FIG. 7B.
S103:将输入的N帧图像特征图和权重数据存储到存储器中。S103: Store the input N-frame image feature map and weight data into a memory.
图像特征图在存储器中的存储格式为按照从第一幅图像特征图到第N幅图像特征图的顺序,每一幅图像特征图按照从左到右,从上到下的顺序逐点存储。输出的图像特征图的帧数为M,其存储方式与输入的图像特征图类似。The image feature map is stored in the memory in the order from the first image feature map to the Nth image feature map, and each image feature map is stored point by point in a left-to-right, top-to-bottom order. The number of frames of the output image feature map is M, which is stored in a similar manner to the input image feature map.
权重数据在存储器中的存储顺序为先存储K*K这两维的数据,然后存储N维的数据,最后存储M维的数据。The storage order of the weight data in the memory is to store the two-dimensional data of K*K first, then store the N-dimensional data, and finally store the M-dimensional data.
S104:处理器调用存储器中存储的图像特征图,在存储器中获取输入的图像特征图的基本单元。S104: The processor calls an image feature map stored in the memory, and acquires a basic unit of the input image feature map in the memory.
其中,图像特征图的基本单元为:相邻FN帧图像特征图上对应的P个像素点所组成的FN*P的二维图像矩阵,其中P设置为每个图像块的一行的宽度。The basic unit of the image feature map is: a two-dimensional image matrix of FN*P composed of corresponding P pixels on the image map of the adjacent FN frame, wherein P is set to the width of one row of each image block.
具体的,输入的图像特征图的基本单元的获取过程为:按照FN*C的二维矩阵为基本单元在输入的图像特征图上以循环分块(Loop Tiling)的方式获取。循环的方式是先按照如图7A中箭头i1(即N)的方向,然后按照箭头i2(即C)的方向循环。首先获取第1、2、…、FN帧图像特征图的第1行的所有像素点组成的二维矩阵FN*P组成第一个输入的图像特征 图基本单元;然后按照如图7A中箭头i1所示的方向移动FN帧图像特征图,即第FN+1,FN+2、…、2*FN帧图像特征图的第1行的所有像素点组成的二维矩阵FN*P组成第二个输入的图像特征图的基本单元;当所有N帧图像特征图的第一行的数据都循环完之后,按照图7A中箭头i2的方向移动到第二行,然后同理按照i1箭头所示循环。Specifically, the acquiring process of the basic unit of the input image feature map is: taking a two-dimensional matrix of the FN*C as a basic unit and acquiring the loop image by using a loop Tiling on the input image feature map. The loop is first cycled in the direction of arrow i1 (i.e., N) in Figure 7A and then in the direction of arrow i2 (i.e., C). First, the two-dimensional matrix FN*P composed of all the pixels in the first row of the image feature map of the first, second, ..., FN frame is composed to form the first input image feature map basic unit; then, according to the arrow i1 in FIG. 7A The direction shifting FN frame image feature map shown, that is, the two-dimensional matrix FN*P composed of all the pixels in the first row of the FN+1, FN+2, ..., 2*FN frame image feature map constitutes the second The basic unit of the input image feature map; after the data of the first line of all the N-frame image feature maps is cycled, move to the second line in the direction of the arrow i2 in FIG. 7A, and then circulate according to the i1 arrow. .
S105:处理器调用存储器中存储的权重数据,在存储器中获取权重数据的基本单元。S105: The processor calls the weight data stored in the memory, and acquires the basic unit of the weight data in the memory.
其中,权重数据的基本单元为:FN*FN个权重点所组成的二维矩阵。The basic unit of the weight data is: a two-dimensional matrix composed of FN*FN weights.
具体的,权重数据的基本单元获取过程为:按照FN*FN*1*1为基本单元在存储器存储的四维权重数据上以循环分块(Loop Tiling)的方式获取。权重数据的循环方式有两种方式,一种是先沿如图7B中箭头w1(即K*K)的方向循环,然后按照箭头w2(即N)的方向循环,最后按照箭头w3(即M)的方向循环;另一种是先沿如图7B中箭头w1(即K*K)的方向循环,然后按照箭头w3(即M)的方向循环,最后按照箭头w2(即N)的方向循环。Specifically, the basic unit obtaining process of the weight data is: acquiring, by using a FN*FN*1*1 as a basic unit, a four-dimensional weight data stored in the memory in a loop Tiling manner. There are two ways to cycle the weight data. One is to cycle in the direction of arrow w1 (ie K*K) in Figure 7B, then cycle in the direction of arrow w2 (ie N), and finally follow arrow w3 (ie M The direction of the cycle; the other is to first cycle in the direction of arrow w1 (ie K*K) in Figure 7B, then cycle in the direction of arrow w3 (ie M), and finally cycle in the direction of arrow w2 (ie N) .
S106:处理器对图像特征图的基本单元和权重数据的基本单元进行乘法计算,以输出图像特征图的基本单元。S106: The processor performs multiplication calculation on the basic unit of the image feature map and the basic unit of the weight data to output a basic unit of the image feature map.
其中:输出的图像特征图的基本单元和输入的图像特征图的基本单元的数据格式相同,均为:相邻FN帧图像特征图上对应的P个像素点所组成的FN*P的二维矩阵。Wherein: the basic unit of the output image feature map and the basic unit of the input image feature map have the same data format, and are: two-dimensional FN*P composed of P pixels corresponding to the image map of the adjacent FN frame image. matrix.
S107:将输出的图像特征图的基本单元存储到存储器中。S107: Store the basic unit of the output image feature map into the memory.
具体的,输出的图像特征图的基本单元的存储方式为:将输出的图像特征图的基本单元以FN*P为基本单元按照循环分块的方式填充到输出的图像特征图中,循环的方式是先按照如图7C中箭头o1(即M)的方向,然后按照箭头o2(即C)的方向循环。Specifically, the basic unit of the output image feature map is stored in the following manner: the basic unit of the output image feature map is filled with the FN*P as a basic unit in a cyclic block manner to the output image feature map, and the loop mode is It is first circulated in the direction of the arrow o1 (i.e., M) in Fig. 7C and then in the direction of the arrow o2 (i.e., C).
S108:判断处理器是否应用在卷积神经网络的最后一个神经网络层,若是,则执行S109;否则将输出的图像特征图作为下一个神经网络层的输入的图像特征图返回执行S104。S108: Determine whether the processor is applied to the last neural network layer of the convolutional neural network, and if yes, execute S109; otherwise, return the output image feature map as an input image feature map of the next neural network layer to execute S104.
S109:将输出的图像特征图作为图像处理设备的输出图像进行输出。S109: Output the output image feature map as an output image of the image processing device.
采用本申请的图像处理方法设计的处理器能够架构输入的图像特征图的基本单元和权重数据的基本单元,进行乘法运算,得到输出的特种功能图基本单元,其处理器的计算引擎架构如图8所示:The processor designed by the image processing method of the present application can construct the basic unit of the input image feature map and the basic unit of the weight data, perform multiplication operation, and obtain the output basic unit of the special function diagram, and the calculation engine architecture of the processor is as shown in the figure. 8 shows:
该计算引擎架构由P*FN*FN个乘法器和P*FN*(FN-1)个加法器组成。输入的图像特征图的基本单元:FN*P个二维数据和权重数据的基本单元:FN*FN个二维数据分配到对应的乘法器上进行乘法运算,再将中间结果分配到对应的加法器上进行加法运算,得到输出的图像特征图的基本单元。The computation engine architecture consists of P*FN*FN multipliers and P*FN*(FN-1) adders. The basic unit of the input image feature map: FN*P two-dimensional data and the basic unit of weight data: FN*FN two-dimensional data is allocated to the corresponding multiplier for multiplication, and then the intermediate result is assigned to the corresponding addition. The addition operation is performed on the device to obtain the basic unit of the output image feature map.
FN在具体实施中,设置为较小的值,具体设置为2,3或者4。CNN卷积层的输入输出的图像特征图层数一般为2或者3的整数倍,FN基本上能被M、N整除或者余数很小,因此,能够提高充分利用处理器中硬件资源,提高资源利用率,达到更高的计算性能。In the specific implementation, the FN is set to a smaller value, specifically set to 2, 3 or 4. The number of image feature layers of the input and output of the CNN convolutional layer is generally an integer multiple of 2 or 3. The FN can be substantially divisible by M and N or the remainder is small. Therefore, it is possible to improve the utilization of hardware resources in the processor and improve resources. Utilization, achieving higher computing performance.
一种可能的设计中,P在具体实施中设置为每个图像块的宽度,这样计算引擎一次能够处理一行的图像数据。在硬件实现上,在应将资源允许的情况下,比较容易扩展,只需要增大P即可。In one possible design, P is set to the width of each image block in a specific implementation, so that the calculation engine can process image data of one line at a time. In hardware implementation, it is easier to expand when resources are allowed, and only need to increase P.
基于上述方法实施例,如图9所示,本申请实施例提供一种基于卷积神经网络的图像处理的装置900,该装置900包括第一获取单元901、划分单元902、第二获取单元903、处理单元904,其中:Based on the foregoing method embodiment, as shown in FIG. 9, the embodiment of the present application provides an apparatus 900 for image processing based on a convolutional neural network, where the apparatus 900 includes a first obtaining
第一获取单元901,用于获取FN帧图像特征图;a first acquiring
划分单元902,对所述FN帧图像特征图中的每一帧均分成Q个子图像,其中每个所述子图像的高为C个像素点,宽为P个像素点,其中,所述FN帧图像特征图中相同位置的子图像组成一个高为C个像素点,宽为P个像素点,长为FN个像素点的三维图像矩阵,其中,Q,C,P均为正整数;The dividing
第二获取单元903,用于获取预设权重矩阵,所述预设权重矩阵为FNxFN的二维矩阵;The second obtaining
处理单元904,用于根据所述预设权重矩阵,依次对所述FN帧图像特征图中的每个所述三维图像矩阵进行矩阵乘法计算,以获得处理后的图像特征图。The
可选的,所述FN的取值包括:2,3和4中的一个。Optionally, the value of the FN includes: one of 2, 3, and 4.
可选的,所述P的取值包括:16,32,64,128和256中的一个。Optionally, the value of the P includes: one of 16, 32, 64, 128, and 256.
可选的,所述图像特征图的宽与所述子图像的宽相等。Optionally, the width of the image feature map is equal to the width of the sub-image.
可选的,所述C为1;对应的,所述高为C个像素点,宽为P个像素点,长为FN个像素点的三维图像矩阵为宽为P个像素点,长为FN个像素点的二维图像矩阵。Optionally, the C is 1; correspondingly, the height is C pixels, the width is P pixels, and the three-dimensional image matrix of FN pixels is P pixels wide and FN long. A two-dimensional image matrix of pixels.
可选的,当所述装置用于处理所述卷积神经网络的第一个神经网络层时,所述图像特征图为待处理图像。Optionally, when the apparatus is configured to process the first neural network layer of the convolutional neural network, the image feature map is an image to be processed.
可选的,当所述装置用于处理所述卷积神经网络的非第一个神经网络层时,所述第一获取单元901在获取FN帧图像特征图时,具体用于:将在上一个邻接的神经网络层中获得的处理后的图像特征图作为所述FN帧图像特征图。Optionally, when the device is used to process the non-first neural network layer of the convolutional neural network, the first acquiring
可选的,所述第一获取单元901在获取FN帧图像特征图时,具体用于:Optionally, when acquiring the FN frame image feature map, the first acquiring
依次获取N帧图像特征图中的图像特征图,每次获取所述FN帧图像特征图,其中,N为正整数。The image feature maps in the N-frame image feature map are sequentially acquired, and the FN frame image feature map is acquired each time, where N is a positive integer.
可选的,所述处理单元904在获得处理后的图像特征图时,具体用于:Optionally, when the processed image feature map is obtained, the
依次存储所述处理后的图像特征图,每次存储FN帧所述处理后的图像特征图,其中,所述存储后的图像特征图为M帧,M为正整数。The processed image feature map is sequentially stored, and the processed image feature map of the FN frame is stored each time, wherein the stored image feature map is an M frame, and M is a positive integer.
需要说明的是,本申请实施例中的装置900的各个单元的功能实现以及交互方式可以进一步参照相关方法实施例的描述,在此不再赘述。It should be noted that the function implementation and the interaction mode of the various units of the apparatus 900 in the embodiment of the present application may be further referred to the description of the related method embodiments, and details are not described herein again.
根据同一发明构思,本申请实施例还提供一种图像处理设备1000,如图10所示,该图像处理设备1000包括处理器1001和存储器1002,执行本发明方案的程序代码保存在存储器1002中,用于指令处理器1001执行图5所示的图像处理方法。According to the same inventive concept, an embodiment of the present application further provides an
本申请还可以通过对处理器进行设计编程,将图5所示的方法所对应的代码固化到芯片内,从而使芯片在运行时能够执行图5所示的方法。The application can also perform the design programming of the processor to solidify the code corresponding to the method shown in FIG. 5 into the chip, so that the chip can perform the method shown in FIG. 5 during operation.
可以理解的是,本申请实施例上述处理器可以是一个CPU,DSP,ASIC,或一个或多个用于控制本发明方案程序执行的集成电路。计算机系统中包括的一个或多个存储器,可以是只读存储器(英文:read-onlymemory,简称ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(英文:randomaccessmemory,简称:RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是磁盘存储器。这些存储器通过总线与处理器相连接,或者也可以通过专门的连接线与处理器连接。It can be understood that the foregoing processor in the embodiment of the present application may be a CPU, a DSP, an ASIC, or one or more integrated circuits for controlling the execution of the program of the present invention. One or more memories included in the computer system, which may be read-only memory (ROM: ROM) or other types of static storage devices that can store static information and instructions, random access memory (English: random accessmemory, Abbreviation: RAM) or other types of dynamic storage devices that can store information and instructions, or disk storage. These memories are connected to the processor via a bus or can also be connected to the processor via a dedicated cable.
本领域内的技术人员应明白,本申请实施例可提供为方法、系统、或计算机程序产品。因此,本申请实施例可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请实施例可采用在一个或多个其中包含有计算机可用程序代码 的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that embodiments of the present application can be provided as a method, system, or computer program product. Therefore, the embodiments of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Moreover, embodiments of the present application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
本申请实施例是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present application. It will be understood that each flow and/or block of the flowchart illustrations and/or FIG. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing device to produce a machine for the execution of instructions for execution by a processor of a computer or other programmable data processing device. Means for implementing the functions specified in one or more of the flow or in a block or blocks of the flow chart.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。The computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device. The apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device. The instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
显然,本领域的技术人员可以对本申请实施例进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本申请实施例的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。It is apparent that those skilled in the art can make various modifications and variations to the embodiments of the present application without departing from the spirit and scope of the application. Thus, it is intended that the present invention cover the modifications and variations of the embodiments of the present invention.
Claims (18)
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810266076.7A CN110321996B (en) | 2018-03-28 | 2018-03-28 | A method and device for image processing based on convolutional neural network |
| CN201810266076.7 | 2018-03-28 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2019184888A1 true WO2019184888A1 (en) | 2019-10-03 |
Family
ID=68062505
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2019/079583 Ceased WO2019184888A1 (en) | 2018-03-28 | 2019-03-25 | Image processing method and apparatus based on convolutional neural network |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN110321996B (en) |
| WO (1) | WO2019184888A1 (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112950462A (en) * | 2019-12-11 | 2021-06-11 | 北京金山云网络技术有限公司 | Image processing method and device, electronic equipment and storage medium |
| CN112949504A (en) * | 2021-03-05 | 2021-06-11 | 深圳市爱培科技术股份有限公司 | Stereo matching method, device, equipment and storage medium |
Families Citing this family (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111696094B (en) * | 2020-06-12 | 2021-06-08 | 杭州迪英加科技有限公司 | Immunohistochemical PD-L1 membrane staining pathological section image processing method, device and equipment |
| CN111967582B (en) * | 2020-08-07 | 2022-07-08 | 苏州浪潮智能科技有限公司 | CNN convolutional layer operation method and CNN convolutional layer operation accelerator |
| CN113434813B (en) * | 2021-06-26 | 2024-05-14 | 上海寒武纪信息科技有限公司 | Matrix multiplication operation method based on neural network and related device |
| CN116343009A (en) * | 2023-03-28 | 2023-06-27 | 国网浙江省电力有限公司电力科学研究院 | Three-dimensional neural network processing method, image processing method, system and storage medium |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105894046A (en) * | 2016-06-16 | 2016-08-24 | 北京市商汤科技开发有限公司 | Convolutional neural network training and image processing method and system and computer equipment |
| CN107424184A (en) * | 2017-04-27 | 2017-12-01 | 厦门美图之家科技有限公司 | A kind of image processing method based on convolutional neural networks, device and mobile terminal |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20160358069A1 (en) * | 2015-06-03 | 2016-12-08 | Samsung Electronics Co., Ltd. | Neural network suppression |
| CN104915322B (en) * | 2015-06-09 | 2018-05-01 | 中国人民解放军国防科学技术大学 | A kind of hardware-accelerated method of convolutional neural networks |
| CN107145902B (en) * | 2017-04-27 | 2019-10-11 | 厦门美图之家科技有限公司 | A kind of image processing method based on convolutional neural networks, device and mobile terminal |
| CN107578062A (en) * | 2017-08-19 | 2018-01-12 | 四川大学 | A Image Caption Method Based on Attribute Probability Vector Guided Attention Patterns |
-
2018
- 2018-03-28 CN CN201810266076.7A patent/CN110321996B/en active Active
-
2019
- 2019-03-25 WO PCT/CN2019/079583 patent/WO2019184888A1/en not_active Ceased
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN105894046A (en) * | 2016-06-16 | 2016-08-24 | 北京市商汤科技开发有限公司 | Convolutional neural network training and image processing method and system and computer equipment |
| CN107424184A (en) * | 2017-04-27 | 2017-12-01 | 厦门美图之家科技有限公司 | A kind of image processing method based on convolutional neural networks, device and mobile terminal |
Cited By (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112950462A (en) * | 2019-12-11 | 2021-06-11 | 北京金山云网络技术有限公司 | Image processing method and device, electronic equipment and storage medium |
| CN112950462B (en) * | 2019-12-11 | 2024-03-08 | 北京金山云网络技术有限公司 | Image processing method and device, electronic equipment and storage medium |
| CN112949504A (en) * | 2021-03-05 | 2021-06-11 | 深圳市爱培科技术股份有限公司 | Stereo matching method, device, equipment and storage medium |
| CN112949504B (en) * | 2021-03-05 | 2024-03-19 | 深圳市爱培科技术股份有限公司 | Stereo matching method, device, equipment and storage medium |
Also Published As
| Publication number | Publication date |
|---|---|
| CN110321996A (en) | 2019-10-11 |
| CN110321996B (en) | 2021-06-29 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN110046702B (en) | Neural Network Computing Accelerator and Method of Execution | |
| WO2019184888A1 (en) | Image processing method and apparatus based on convolutional neural network | |
| CN111667051B (en) | Neural network accelerator applicable to edge equipment and neural network acceleration calculation method | |
| CN108765247B (en) | Image processing method, device, storage medium and equipment | |
| CN113469350B (en) | Deep convolutional neural network acceleration method and system suitable for NPU | |
| KR102316670B1 (en) | computational accelerator | |
| KR102192468B1 (en) | CNN processing method and device | |
| US20210192246A1 (en) | Convolutional neural network-based image processing method and device, and unmanned aerial vehicle | |
| US10642622B2 (en) | Arithmetic processing device and control method of the arithmetic processing device | |
| EP4071619B1 (en) | Address generation method, related device and storage medium | |
| KR20200081044A (en) | Method and apparatus for processing convolution operation of neural network | |
| EP3093757B1 (en) | Multi-dimensional sliding window operation for a vector processor | |
| CN114995782B (en) | Data processing method, apparatus, device and readable storage medium | |
| CN120087414B (en) | Optimization method, device, storage medium and program product for attention mechanism calculation | |
| JP2022188301A (en) | Information processing apparatus, and information processing method | |
| JP2023541350A (en) | Table convolution and acceleration | |
| CN118643253B (en) | Data processing method, device, equipment and storage medium | |
| CN112215345B (en) | Convolutional neural network operation method and device based on Tenscorore | |
| WO2019136750A1 (en) | Artificial intelligence-based computer-aided processing device and method, storage medium, and terminal | |
| CN108470211B (en) | A method, device and computer storage medium for realizing convolution calculation | |
| WO2022121474A1 (en) | Method and system for optimizing convolutional residual structure of neural network, device, and medium | |
| CN108960203B (en) | A Vehicle Detection Method Based on FPGA Heterogeneous Computing | |
| CN113485750B (en) | Data processing method and data processing device | |
| KR101204866B1 (en) | Method and apparatus of executing pixel calculation within window area at high speed in window-based image processing | |
| CN117313811B (en) | Neural network accelerators for image processing and 3D reconstruction methods |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19775117 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 19775117 Country of ref document: EP Kind code of ref document: A1 |