CN109670598A - A kind of data processing method based on deep learning - Google Patents

A kind of data processing method based on deep learning Download PDF

Info

Publication number
CN109670598A
CN109670598A CN201811318143.1A CN201811318143A CN109670598A CN 109670598 A CN109670598 A CN 109670598A CN 201811318143 A CN201811318143 A CN 201811318143A CN 109670598 A CN109670598 A CN 109670598A
Authority
CN
China
Prior art keywords
matrix
channel
convolution
data
apposition
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.)
Pending
Application number
CN201811318143.1A
Other languages
Chinese (zh)
Inventor
林路路
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jianhu Yunfei Data Technology Co Ltd
Original Assignee
Jianhu Yunfei Data Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jianhu Yunfei Data Technology Co Ltd filed Critical Jianhu Yunfei Data Technology Co Ltd
Priority to CN201811318143.1A priority Critical patent/CN109670598A/en
Publication of CN109670598A publication Critical patent/CN109670598A/en
Pending legal-status Critical Current

Links

Abstract

The present invention provides a kind of data processing methods based on deep learning, using the data processing method provided by the invention based on deep learning, in convolution algorithm, position rearrangement reaction has been carried out to pretreated weighted data and pretreated characteristic, so that the data being used continuously in the matrix of generation are arranged on adjacent position, so the spatial locality of data can effectively be promoted by executing apposition operation based on this efficient data format, computation complexity can be reduced, the engagement of hardware resource is reduced.

Description

A kind of data processing method based on deep learning
Technical field
The present invention relates to field of artificial intelligence, in particular to a kind of data processing method based on deep learning.
Background technique
It has begun and is applied with deep learning progress data processing at present, convolution prediction model is as deep learning One of important foundation technology, obtained academia and the more concern of industry.Convolutional calculation provides hardware in the prior art Source it is more demanding, need higher memory bandwidth to be accomplished huge calculation amount, this undoubtedly proposes the complexity of hardware Higher requirement, at the same time, since the increase of calculation amount will lead to the gradually increasing of power consumption.
Summary of the invention
Based on this, the embodiment of the invention provides a kind of data processing methods based on deep learning:
A kind of data processing method based on deep learning disclosed by the embodiments of the present invention, comprising:
Obtain convolution prediction model;
In each convolutional layer of convolution prediction model, the data characteristic information for inputting the convolutional layer is obtained, it is described Convolution prediction model is used to carry out data processing according to the data characteristic information of pending data, and the data characteristic information includes The characteristic information of the pending data;
Each convolutional layer of the convolution prediction model corresponds to channel_in input channel, in each input channel M characteristic block is sequentially chosen in corresponding data characteristic information, obtains M*channel_in characteristic block;
According to i from 1 traversal to M and j from 1 traversal to channel_in, to characteristic block dijIt is pre-processed, obtains M* Channel_in matrix;
Element in M*channel_in matrix is re-started into position arrangement, obtains first matrix;
Wherein, i refers to i-th of output channel, and j refers to j-th of input channel, the pretreated data characteristic information The characteristic of middle continuous use is arranged in the adjacent position in first matrix;
According to i from 1 traversal to N and j from 1 traversal to channel_in, to the convolution kernel g of each convolutional layerijWeight It is handled, obtains N*channel_in matrix;
The N number of element being located in identical input channel and same position in N*channel_in matrix is arranged in adjacent Position obtains the second matrix so that N*channel_in element being located in same position is arranged in same a line;
Wherein, i refers to i-th of output channel, and j refers to j-th of input channel, and N is selected output channel number, N < Channel_out, channel_in and channel_out are respectively the convolution kernel gijCorresponding input channel sum and output Total number of channels;
Apposition operation is executed to every row element in first matrix and second matrix, is transported to obtained apposition After calculation result is handled, the convolution algorithm result of the pending data is obtained.
Preferably, the method also includes:
First matrix and second matrix are stored to the first memory;
The convolution algorithm result that the convolutional layer exports is transmitted to the second memory;
Wherein, first matrix is identical with the line number of second matrix;
Every row element in first matrix and second matrix executes apposition operation
First matrix and second matrix are read from first memory;
For identical any two row element of line number in first matrix and second matrix, in first matrix Row in choose N number of element and form the first vector, M element the second vector of composition is chosen in the row of second matrix, it is right Second vector described in first vector sum executes apposition operation, and currently available operation result is added to accumulator, weight Above-mentioned apposition and accumulation operations are executed again until row is last, and writes back accumulation result;
After the last line element to first matrix and second matrix is finished apposition and accumulation operations, Using the accumulation result write back before as the apposition operation result.
In convolution algorithm, the embodiment of the present invention to pretreated weighted data and pretreated characteristic into Position rearrangement reaction is gone, so that the data being used continuously in the matrix of generation are arranged on adjacent position, so being based on this The efficient data format of kind can effectively promote the spatial locality of data to execute apposition operation, and it is complicated can to reduce calculating Degree, reduces the engagement of hardware resource.
Detailed description of the invention
Fig. 1 is a kind of flow diagram of data processing method based on deep learning provided in an embodiment of the present invention.
Specific embodiment
As shown in Figure 1, a kind of data processing method based on deep learning disclosed by the embodiments of the present invention, including walk as follows It is rapid:
S10, convolution prediction model is obtained;
S20, in each convolutional layer of convolution prediction model, obtain the data characteristic information for inputting the convolutional layer, The convolution prediction model is used to carry out data processing, the data characteristic information according to the data characteristic information of pending data Characteristic information including the pending data;
S30, the convolution prediction model each convolutional layer correspond to channel_in input channel, each input M characteristic block is sequentially chosen in the corresponding data characteristic information in channel, obtains M*channel_in characteristic block;
S40, it is traversed from 1 traversal to M and j from 1 to channel_in, to characteristic block d according to iijIt is pre-processed, is obtained M*channel_in matrix;
S50, the element in M*channel_in matrix is re-started to position arrangement, obtains first matrix;
S60, wherein, i refer to i-th of output channel, and j refers to j-th of input channel, the pretreated data characteristics The characteristic being used continuously in information is arranged in the adjacent position in first matrix;
S70, it is traversed from 1 traversal to N and j from 1 to channel_in, to the convolution kernel g of each convolutional layer according to iij's Weight is handled, and N*channel_in matrix is obtained;
S80, N number of element in N*channel_in matrix in identical input channel and same position is arranged in Adjacent position obtains the second matrix so that N*channel_in element being located in same position is arranged in same a line;
Wherein, i refers to i-th of output channel, and j refers to j-th of input channel, and N is selected output channel number, N < Channel_out, channel_in and channel_out are respectively the convolution kernel gijCorresponding input channel sum and output Total number of channels;
S90, apposition operation is executed to every row element in first matrix and second matrix, outer to what is obtained After product operation result is handled, the convolution algorithm result of the pending data is obtained.
S100, first matrix and second matrix are stored to the first memory;
S101, the convolution algorithm result that the convolutional layer exports is transmitted to the second memory;
Wherein, first matrix is identical with the line number of second matrix;
Every row element in first matrix and second matrix executes apposition operation
S901, first matrix and second matrix are read from first memory;
S902, for identical any two row element of line number in first matrix and second matrix, described N number of element is chosen in the row of one matrix and forms the first vector, and M the second arrow of element composition is chosen in the row of second matrix Amount executes apposition operation to the second vector described in first vector sum, and currently available operation result is added to cumulative Device repeats above-mentioned apposition and accumulation operations until row is last, and writes back accumulation result;
S903, it is finished apposition and cumulative behaviour in the last line element to first matrix and second matrix After work, using the accumulation result write back before as the apposition operation result.
In the present embodiment, the convolution prediction model is winograd convolution mode, for multiplication and addition, the two Time complexity in hardware realization is usually different, wherein and the time needed for multiplying is typically much deeper than addition, Therefore expensive operation (such as multiplication) is replaced to become a kind of mode for carrying out accelerating operation with cheap operation.
By taking two-dimensional convolution algorithm as an example, it is assumed that the size of convolution kernel is 3*3, and is labeled as symbol g, needs to carry out convolution The data markers of operation are symbol d, then using winograd convolution mode, convolution output Y can use following formula and carry out It calculates:
Y=AT[(GgGT)+(BTdB)]A
Wherein, matrix A, AT、G、B、BTThere is different definition according to output size and convolution kernel are of different sizes, and is It determines in advance.Assuming that data d is divided be for size 4*4 size piecemeal, then BT, G and ATValue can be as follows:
Wherein, the specific value of matrix A and matrix B can be by matrix BTAnd matrix ATIt obtains.
For above situation, for winograd convolution mode compared to direct convolution mode, theoretical speed-up ratio is 2.25 times.When When data d is divided for larger-sized piecemeal, such as 6*6 size, then it can get higher theoretical speed-up ratio.
When taking winograd convolution mode in convolution prediction model, the above-mentioned formula about convolution input Y is also needed It is modified slightly.Since each convolutional layer of convolution prediction model has multiple input channels (input channel) and multiple defeated Therefore channel (output channel) out calculates the form that the convolution output Y of i-th of output channel can be expressed as. Wherein, i index refers to i-th of output channel, and j index refers to j-th of input channel.
It is practical when input channel number is channel_in, and output channel number is channel_out in above-mentioned formula On for each output channel, be required to channel_in convolution kernel, for respectively correspond each input channel into Row convolution, this is convolution kernel gijMeaning where;And djRefer to the data of j-th of input channel input.
The first memory refers to the on-chip memory being integrated on the chip of processor place in the present embodiment.Wherein, in first The memory space deposited is usually smaller, but data access speed is usually very fast.
Second memory is corresponding with the first memory, for the memory expanded on the basis of the first memory.Wherein, second The memory space of memory is usually larger, generally far larger than the first memory, but data access speed relative to the first memory compared with Slowly.
Since the realization of winograd convolution mode needs higher memory bandwidth and the first more memory, so related The platform for having winograd convolution ability in technology is based primarily upon powerful GPGPU, CPU, ASIC and FPGA, these are powerful Hardware side can effectively realize winograd convolution mode, realize that convolution algorithm accelerates with this, reach and improve AI chip The purpose of computational efficiency.
In the step S20, for each convolutional layer of convolution prediction model, the data for inputting the convolutional layer are obtained Characteristic information, the convolution prediction model are used to carry out process of convolution according to the data characteristic information of the pending data of input, should The characteristic information of pending data is carried in data characteristic information.
For being input to for the pending data of convolution prediction model, include by different convolutional layers at least one The convolution operation of convolution kernel can form a series of data characteristic information (feature map).Often pass through the volume of a convolution kernel Product operation, will obtain a data characteristic information, the above process also is understood as being filtered pending data, wherein Convolution prediction model carries out feature extraction by convolution kernel one by one from pending data.A upper convolutional layer is exported Data characteristic information, next convolutional layer can inputted after the processing of other layers such as pond layer.
In the step S70, about the weight of at least one convolution kernel, as the parameter of convolution prediction model, specifically It is to carry out network training using training sample and learn.
In the step S100, for the apposition operation, if matrix a=(a0, a1, a2, a3), matrix b=(b0, b1, b2, b3), then the apposition operation result of matrix a and matrix b is as follows:
Wherein, in the first matrix and the second matrix every row element execute apposition operation when, if the first matrix and Second matrix is located at the first memory, then directly carries out reading data from the first memory;It should be noted that because the size of piecemeal Unanimously, so the line number of the first matrix and the second matrix is identical.
When executing apposition operation, data specifically are read from same a line of the first matrix and the second matrix and are then based on The data read carry out apposition operation, and then currently available operation result is added to accumulator.Change a kind of expression side Formula, any two row element identical for line number in the first matrix and the second matrix, chooses N number of element in the row of the first matrix The first vector is formed, M element is chosen in the row of the second matrix and forms the second vector, first the second vector of vector sum is executed Apposition operation, and currently available operation result is added to accumulator, repeat above-mentioned apposition and accumulation operations until Row end, and write back accumulation result;It is finished apposition and cumulative behaviour in the last line element to the first matrix and the second matrix After work, using the accumulation result write back before as apposition operation result.
First point for needing to illustrate is that above-mentioned the first pretreatment being mentioned to and the second pretreatment can be referred to as pre-treatment, And the above-mentioned third pretreatment referred to can be referred to as to post-process.Wherein, under the specific implementation of post-processing includes but is not limited to State two kinds:
(1), after obtaining apposition operation result, previously mentioned matrix A and matrix A are based onTTo apposition operation result into Row post-processing, and then obtain convolution algorithm result.That is, convolution algorithm result is [AT(apposition operation result) A].
(2), post-processing not only includes using ATApposition operation result is converted with A, may also include pooling layers With activation layers of processing.
Wherein, pooling layers and activation layer are optional, and the embodiment of the present invention to the appearance of the two sequentially not Specifically limited, either conv layers+pooling layers+activation layers, it is also possible to conv layers of+activation + pooling layers of layer.It is expansible, can also by pooling operate and activation operation be summarized as " can and convolution All operations of fusion ", and it is not specific to pooling operation or activation operation.
Due to carrying the characteristic information of pending data in convolution algorithm result, so based on obtained convolution algorithm knot Fruit can complete the convolution operation processing to pending data.
The classification to pending data can be completed based on the convolution algorithm result of the last one convolutional layer, obtain number to be processed According to the probability for belonging to each classification;Or, can also be completed based on the convolution algorithm result of the last one convolutional layer to number to be processed According to identification, such as identification image occur object, carry out text identification etc.;Or, the convolution based on the last one convolutional layer is transported Result completion is calculated to the semantic segmentation of pending data;Wherein, image, semantic segmentation is meant that machine is divided and identified automatically The content for including in image out, for example the image of a width people by motorcycle is provided, people can be partitioned into automatically after machine judgement, rubbed Motorcycle and background, such as red mark is people, green is labeled as vehicle, and black is labeled as background.Or, can also be based on the last one volume The convolution algorithm result of lamination completes the content analysis to pending data, for example, by by background in image and target separate into And it analyzes and tracks the target occurred in the picture.
Those of ordinary skill in the art will appreciate that realizing that all or part of the steps of above-described embodiment can pass through hardware It completes, relevant hardware can also be instructed to complete by program, the program can store in a kind of computer-readable In storage medium, storage medium mentioned above can be read-only memory, disk or CD etc..
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all in spirit of the invention and Within principle, any modification, equivalent replacement, improvement and so on be should all be included in the protection scope of the present invention.

Claims (2)

1. a kind of data processing method based on deep learning, which is characterized in that the described method includes:
Obtain convolution prediction model;
In each convolutional layer of convolution prediction model, the data characteristic information for inputting the convolutional layer, the convolution are obtained Prediction model is used to carry out data processing according to the data characteristic information of pending data, and the data characteristic information includes described The characteristic information of pending data;
Each convolutional layer of the convolution prediction model corresponds to channel_in input channel, corresponding in each input channel Data characteristic information in sequentially choose M characteristic block, obtain M*channel_in characteristic block;
According to i from 1 traversal to M and j from 1 traversal to channel_in, to characteristic block dijIt is pre-processed, obtains M* Channel_in matrix;
Element in M*channel_in matrix is re-started into position arrangement, obtains first matrix;
Wherein, i refers to i-th of output channel, and j refers to j-th of input channel, connects in the pretreated data characteristic information The continuous characteristic used is arranged in the adjacent position in first matrix;
According to i from 1 traversal to N and j from 1 traversal to channel_in, to the convolution kernel g of each convolutional layerijWeight carry out Processing, obtains N*channel_in matrix;
Adjacent bit is arranged in by N number of element in identical input channel and same position is located in N*channel_in matrix It sets, so that N*channel_in element being located in same position is arranged in same a line, obtains the second matrix;
Wherein, i refers to i-th of output channel, and j refers to j-th of input channel, and N is selected output channel number, N < Channel_out, channel_in and channel_out are respectively the convolution kernel gijCorresponding input channel sum and output Total number of channels;
Apposition operation is executed to every row element in first matrix and second matrix, to obtained apposition operation knot After fruit is handled, the convolution algorithm result of the pending data is obtained.
2. the data processing method according to claim 1 based on deep learning, which is characterized in that further include:
First matrix and second matrix are stored to the first memory;
The convolution algorithm result that the convolutional layer exports is transmitted to the second memory;
Wherein, first matrix is identical with the line number of second matrix;
Every row element in first matrix and second matrix executes apposition operation
First matrix and second matrix are read from first memory;
For identical any two row element of line number in first matrix and second matrix, in the row of first matrix It is middle to choose the first vector of N number of element composition, M element is chosen in the row of second matrix and forms the second vector, to described Second vector described in first vector sum executes apposition operation, and currently available operation result is added to accumulator, and repetition is held The above-mentioned apposition of row and accumulation operations are until row is last, and writes back accumulation result;
After the last line element to first matrix and second matrix is finished apposition and accumulation operations, by it Before the accumulation result that writes back as the apposition operation result.
CN201811318143.1A 2018-11-07 2018-11-07 A kind of data processing method based on deep learning Pending CN109670598A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811318143.1A CN109670598A (en) 2018-11-07 2018-11-07 A kind of data processing method based on deep learning

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811318143.1A CN109670598A (en) 2018-11-07 2018-11-07 A kind of data processing method based on deep learning

Publications (1)

Publication Number Publication Date
CN109670598A true CN109670598A (en) 2019-04-23

Family

ID=66142659

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811318143.1A Pending CN109670598A (en) 2018-11-07 2018-11-07 A kind of data processing method based on deep learning

Country Status (1)

Country Link
CN (1) CN109670598A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111913744A (en) * 2020-07-15 2020-11-10 博流智能科技(南京)有限公司 AI deep learning data processing method and system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111913744A (en) * 2020-07-15 2020-11-10 博流智能科技(南京)有限公司 AI deep learning data processing method and system

Similar Documents

Publication Publication Date Title
CN108765247B (en) Image processing method, device, storage medium and equipment
CN107437110B (en) Block convolution optimization method and device of convolutional neural network
JP6309663B2 (en) Training constrained deconvolution networks for semantic segmentation of road scenes
CN109685819B (en) Three-dimensional medical image segmentation method based on feature enhancement
WO2019100723A1 (en) Method and device for training multi-label classification model
JP6924517B2 (en) How to recognize faces using multiple patch combinations of deep neural network infrastructure to improve fault tolerance and fracture robustness in extreme situations
CN108665063B (en) Bidirectional parallel processing convolution acceleration system for BNN hardware accelerator
JP7450815B2 (en) Method and system for hierarchical weight sparse convolution processing
WO2020073211A1 (en) Operation accelerator, processing method, and related device
Ye et al. 3d depthwise convolution: Reducing model parameters in 3d vision tasks
CN113874883A (en) Hand pose estimation
WO2020113355A1 (en) A content adaptive attention model for neural network-based image and video encoders
JP7403638B2 (en) Fast sparse neural network
CN110889416B (en) Salient object detection method based on cascade improved network
CN110879960B (en) Method and computing device for generating image data set for convolutional neural network learning
CN110222760A (en) A kind of fast image processing method based on winograd algorithm
CN113344188A (en) Lightweight neural network model based on channel attention module
CN111382867A (en) Neural network compression method, data processing method and related device
JP2018501579A (en) Semantic representation of image content
CN112766392B (en) Image classification method of deep learning network based on parallel asymmetric hole convolution
CN107977456A (en) A kind of multi-source big data analysis method based on multitask depth network
Yoo et al. Fast training of convolutional neural network classifiers through extreme learning machines
KR102305575B1 (en) Method and system for highlighting similar areas using similarity between images
KR20220045424A (en) Method and apparatus of compressing artificial neural network
US20230072445A1 (en) Self-supervised video representation learning by exploring spatiotemporal continuity

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20190423

WD01 Invention patent application deemed withdrawn after publication