CN111914987A - Data processing method and device based on neural network, equipment and readable medium - Google Patents
Data processing method and device based on neural network, equipment and readable medium Download PDFInfo
- Publication number
- CN111914987A CN111914987A CN201910390684.3A CN201910390684A CN111914987A CN 111914987 A CN111914987 A CN 111914987A CN 201910390684 A CN201910390684 A CN 201910390684A CN 111914987 A CN111914987 A CN 111914987A
- Authority
- CN
- China
- Prior art keywords
- input data
- processing
- channel
- binary
- data
- 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
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/045—Combinations of networks
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Health & Medical Sciences (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Evolutionary Computation (AREA)
- Artificial Intelligence (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Health & Medical Sciences (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本公开提供一种基于神经网络的数据处理方法、装置以及电子设备和计算机可读介质,涉及数据处理领域,该方法包括:对所述神经网络的输入数据进行通道拆分处理,并对通道拆分后的输入数据进行通道混洗处理;对通道混洗后的输入数据进行二值化处理,以获得二值输入数据;对所述二值输入数据进行分组卷积处理,所述分组卷积处理对应的卷积核中的权重是二值数据;根据通道顺序将通道混洗后的输入数据与分组卷积处理后的二值数据进行累加处理,以获得输出结果。本公开实施例提供的技术方案可以提高数据处理的速度,减少数据信息的损失。
The present disclosure provides a neural network-based data processing method, device, electronic device, and computer-readable medium, and relates to the field of data processing. The method includes: performing channel splitting processing on input data of the neural network, and splitting the channel The divided input data is subjected to channel shuffling processing; the input data after channel shuffling is subjected to binarization processing to obtain binary input data; the binary input data is subjected to group convolution processing, and the group convolution The weights in the corresponding convolution kernels are binary data; the input data after channel shuffling and the binary data after group convolution processing are accumulated according to the channel order to obtain the output result. The technical solutions provided by the embodiments of the present disclosure can improve the speed of data processing and reduce the loss of data information.
Description
技术领域technical field
本公开涉及数据处理领域,尤其涉及一种基于神经网络的数据处理方法及装置、电子设备和计算机可读介质。The present disclosure relates to the field of data processing, and in particular, to a neural network-based data processing method and apparatus, electronic device, and computer-readable medium.
背景技术Background technique
在相关技术中,深度学习技术中的神经网络一般采用浮点计算方式对输入数据进行处理,但是浮点计算方式需要较大的存储空间并会产生极大的计算量,严重阻碍了神经网络在移动端的应用。二值化神经网络以其高模型压缩率和快计算速度的潜在优势,近些年成为深度学习的热门研究方向。In related technologies, the neural network in deep learning technology generally uses floating-point calculation to process the input data, but the floating-point calculation requires a large storage space and generates a huge amount of calculation, which seriously hinders the neural network in the mobile applications. Binarized neural network has become a popular research direction of deep learning in recent years due to its potential advantages of high model compression rate and fast calculation speed.
但是相关技术中,二值神经网络存在很强的信息损失的问题。因此,找到一种可以减少二值神经网络的信息损失的方法,对二值神经网络的应用是极其具有意义的。However, in the related art, the binary neural network has a strong information loss problem. Therefore, finding a method that can reduce the information loss of the binary neural network is extremely meaningful for the application of the binary neural network.
需要说明的是,在上述背景技术部分公开的信息仅用于加强对本公开的背景的理解,因此可以包括不构成对本领域普通技术人员已知的现有技术的信息。It should be noted that the information disclosed in the above Background section is only for enhancement of understanding of the background of the present disclosure, and therefore may contain information that does not form the prior art that is already known to a person of ordinary skill in the art.
发明内容SUMMARY OF THE INVENTION
有鉴于此,本公开提供一种基于神经网络的数据处理方法及装置、电子设备和计算机可读介质,能够减少二值神经网络中产生的信息损失,并减少内存损耗以提高计算速度。In view of this, the present disclosure provides a neural network-based data processing method and apparatus, electronic device, and computer-readable medium, which can reduce the information loss generated in the binary neural network, and reduce the memory consumption to improve the calculation speed.
本公开的其他特性和优点将通过下面的详细描述变得显然,或部分地通过本公开的实践而习得。Other features and advantages of the present disclosure will become apparent from the following detailed description, or be learned in part by practice of the present disclosure.
根据本公开实施例的第一个方面,提出一种基于神经网络的数据处理方法,该方法包括:对所述神经网络的输入数据进行通道拆分处理,并对通道拆分后的输入数据进行通道混洗处理;对通道混洗后的输入数据进行二值化处理,以获得二值输入数据;对所述二值输入数据进行分组卷积处理,所述分组卷积处理对应的卷积核中的权重是二值数据;根据通道顺序将通道混洗后的输入数据与分组卷积处理后的二值数据进行累加处理,以获得输出结果。According to a first aspect of the embodiments of the present disclosure, a data processing method based on a neural network is proposed, the method includes: performing channel splitting processing on input data of the neural network, and performing channel splitting on the input data after channel splitting. Channel shuffling processing; performing binarization processing on the input data after channel shuffling to obtain binary input data; performing grouping convolution processing on the binary input data, and the grouping convolution processing corresponding convolution kernels The weights in are binary data; the input data after channel shuffling and the binary data after group convolution processing are accumulated according to the channel order to obtain the output result.
在一些实施例中,对通道拆分后的输入数据进行通道混洗处理,包括:对所述通道拆分后的输入数据的通道进行随机排列组合处理。In some embodiments, performing channel shuffling processing on the channel-split input data includes: performing random permutation and combination processing on channels of the channel-split input data.
在一些实施例中,对通道混洗后的输入数据进行二值化处理,包括:若所述通道混洗后的输入数据大于预设阈值,则将所述通道混洗后的输入数据转换为第一值;若所述通道混洗后的输入数据小于等于所述预设阈值,则将所述通道混洗后的输入数据转换为第二值。In some embodiments, performing binarization processing on the channel-shuffled input data includes: if the channel-shuffled input data is greater than a preset threshold, converting the channel-shuffled input data into a first value; if the input data after channel shuffling is less than or equal to the preset threshold, convert the input data after channel shuffling into a second value.
在一些实施例中,所述第一值为1,所述第二值为-1。In some embodiments, the first value is 1 and the second value is -1.
在一些实施例中,对所述二值输入数据进行分组卷积处理,包括:将所述二值输入数据以及所述神经网络中的卷积核按照通道对应分组;将分组后的二值输入数据与其对应的卷积核进行二值运算处理。In some embodiments, performing grouped convolution processing on the binary input data includes: grouping the binary input data and the convolution kernels in the neural network according to channel correspondence; grouping the grouped binary input data The data and its corresponding convolution kernel are processed by binary operation.
在一些实施例中,所述二值运算处理包括:异或非运算、异或运算或者同或运算。In some embodiments, the binary operation processing includes: XOR operation, XOR operation or XOR operation.
在一些实施例中,所述卷积核为3×3的卷积核。In some embodiments, the convolution kernel is a 3×3 convolution kernel.
根据本公开实施例的第二方面,提出一种基于神经网络的数据处理装置,该装置包括:通道混洗模块,配置为对所述神经网络的输入数据进行通道拆分处理,并对通道拆分后的输入数据进行通道混洗处理;二值处理模块,配置为对通道混洗后的输入数据进行二值化处理,以获得二值输入数据;分组卷积模块,配置为对所述二值输入数据进行分组卷积处理,所述分组卷积处理对应的卷积核中的权重是二值数据;累加模块,配置为根据通道顺序将通道混洗后的输入数据与分组卷积处理后的二值数据进行累加处理,以获得输出结果。According to a second aspect of the embodiments of the present disclosure, a data processing apparatus based on a neural network is proposed, the apparatus includes: a channel shuffling module, configured to perform channel splitting processing on input data of the neural network, and split the channel The divided input data is subjected to channel shuffling processing; the binary processing module is configured to perform binary processing on the input data after channel shuffling to obtain binary input data; the grouping convolution module is configured to The value input data is subjected to grouped convolution processing, and the weights in the convolution kernels corresponding to the grouped convolution processing are binary data; the accumulation module is configured to perform channel shuffled input data and grouped convolution processing according to the channel order. The binary data is accumulated to obtain the output result.
根据本公开实施例的第三方面,提出一种电子设备,该电子设备包括:一个或多个处理器;存储装置,用于存储一个或多个程序,当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现上述任一项所述的基于神经网络的数据处理方法。According to a third aspect of the embodiments of the present disclosure, an electronic device is provided, the electronic device includes: one or more processors; and a storage device for storing one or more programs, when the one or more programs are stored The one or more processors execute, so that the one or more processors implement the neural network-based data processing method described in any one of the above.
根据本公开实施例的第四方面,提出一种计算机可读介质,其上存储有计算机程序,其特征在于,所述程序被处理器执行时实现如上述任一项所述的基于神经网络的数据处理方法。According to a fourth aspect of the embodiments of the present disclosure, a computer-readable medium is provided on which a computer program is stored, characterized in that, when the program is executed by a processor, the neural network-based neural network as described in any of the above is implemented. data processing method.
根据本公开某些实施例提供的基于神经网络的数据处理方法、装置及电子设备和计算机可读介质,一方面,通过对输入数据进行通道拆分、通道混洗等操作来实现对输入数据的分组卷积,减少了卷积参数,提高了数据的处理速度;另一方面,通过对输入数据进行二值化以实现对输入数据的压缩,进一步提高了神经网络对数据处理的速度;最后,本公开实施例提供的技术方案仅使用了一次二值化处理,减少了输入数据的信息损失,提高了输出结果的准确性。According to the neural network-based data processing method, apparatus, electronic device, and computer-readable medium provided according to some embodiments of the present disclosure, on the one hand, the input data is processed by performing channel splitting, channel shuffling and other operations on the input data. The grouped convolution reduces the convolution parameters and improves the data processing speed; on the other hand, the input data is compressed by binarizing the input data, which further improves the data processing speed of the neural network; finally, The technical solutions provided by the embodiments of the present disclosure use only one binarization process, which reduces the information loss of the input data and improves the accuracy of the output results.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性的,并不能限制本公开。It is to be understood that the foregoing general description and the following detailed description are exemplary only and do not limit the present disclosure.
附图说明Description of drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。下面描述的附图仅仅是本公开的一些实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description serve to explain the principles of the disclosure. The drawings described below are only some embodiments of the present disclosure, and for those of ordinary skill in the art, other drawings can also be obtained from these drawings without creative efforts.
图1示出了应用于本公开实施例的基于神经网络的数据处理方法或基于神经网络的数据处理装置的示例性系统架构的示意图。FIG. 1 shows a schematic diagram of an exemplary system architecture of a neural network-based data processing method or a neural network-based data processing apparatus applied to an embodiment of the present disclosure.
图2是根据相关技术示出的一种ShuffleNet架构的示意图。FIG. 2 is a schematic diagram of a ShuffleNet architecture according to the related art.
图3是根据相关技术示出的一种ResNet架构的示意图。FIG. 3 is a schematic diagram of a ResNet architecture according to the related art.
图4是根据相关技术示出的一种Bi-RealNet架构的示意图。FIG. 4 is a schematic diagram of a Bi-RealNet architecture according to the related art.
图5是根据一示例性实施例示出的一种基于神经网络的数据处理方法的流程图。Fig. 5 is a flow chart of a data processing method based on a neural network according to an exemplary embodiment.
图6是根据一示例性实施例示出的另一种基于神经网络的数据处理方法的流程图。Fig. 6 is a flowchart of another data processing method based on a neural network according to an exemplary embodiment.
图7是根据一示例性实施例示出的再一种基于神经网络的数据处理方法的流程图。Fig. 7 is a flow chart of yet another method for data processing based on a neural network according to an exemplary embodiment.
图8是根据一示例性实施例示出的一种二值神经网络的示意图。Fig. 8 is a schematic diagram of a binary neural network according to an exemplary embodiment.
图9是根据一示例性实施例示出的一种基于神经网络的数据处理装置的框图。Fig. 9 is a block diagram of a data processing apparatus based on a neural network according to an exemplary embodiment.
图10是根据一示例性实施例示出的另一种基于神经网络的数据处理装置的框图。Fig. 10 is a block diagram of another neural network-based data processing apparatus according to an exemplary embodiment.
图11是根据一示例性实施例示出的再一种基于神经网络的数据处理装置的框图。Fig. 11 is a block diagram of yet another neural network-based data processing apparatus according to an exemplary embodiment.
图12是根据一示例性实施例示出的一种应用于基于神经网络的数据处理装置的计算机系统的结构示意图。FIG. 12 is a schematic structural diagram of a computer system applied to a neural network-based data processing apparatus according to an exemplary embodiment.
具体实施方式Detailed ways
现在将参考附图更全面地描述示例实施例。然而,示例实施例能够以多种形式实施,且不应被理解为限于在此阐述的实施例;相反,提供这些实施例使得本公开将全面和完整,并将示例实施例的构思全面地传达给本领域的技术人员。在图中相同的附图标记表示相同或类似的部分,因而将省略对它们的重复描述。Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments, however, can be embodied in various forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The same reference numerals in the drawings denote the same or similar parts, and thus their repeated descriptions will be omitted.
所描述的特征、结构或特性可以以任何合适的方式结合在一个或更多实施方式中。在下面的描述中,提供许多具体细节从而给出对本公开的实施方式的充分理解。然而,本领域技术人员将意识到,可以实践本公开的技术方案而省略特定细节中的一个或更多,或者可以采用其它的方法、组元、装置、步骤等。在其它情况下,不详细示出或描述公知方法、装置、实现或者操作以避免模糊本公开的各方面。The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided in order to give a thorough understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be employed. In other instances, well-known methods, devices, implementations, or operations have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
附图仅为本公开的示意性图解,图中相同的附图标记表示相同或类似的部分,因而将省略对它们的重复描述。附图中所示的一些方框图不一定必须与物理或逻辑上独立的实体相对应。可以采用软件形式来实现这些功能实体,或在一个或多个硬件模块或集成电路中实现这些功能实体,或在不同网络和/或处理器装置和/或微控制器装置中实现这些功能实体。The accompanying drawings are merely schematic illustrations of the present disclosure, and the same reference numerals in the drawings denote the same or similar parts, and thus their repeated descriptions will be omitted. Some of the block diagrams shown in the figures do not necessarily necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
附图中所示的流程图仅是示例性说明,不是必须包括所有的内容和步骤,也不是必须按所描述的顺序执行。例如,有的步骤还可以分解,而有的步骤可以合并或部分合并,因此实际执行的顺序有可能根据实际情况改变。The flowcharts shown in the figures are only exemplary illustrations, and do not necessarily include all contents and steps, nor do they have to be performed in the order described. For example, some steps can be decomposed, and some steps can be combined or partially combined, so the actual execution order may be changed according to the actual situation.
本说明书中,用语“一个”、“一”、“该”、“所述”和“至少一个”用以表示存在一个或多个要素/组成部分/等;用语“包含”、“包括”和“具有”用以表示开放式的包括在内的意思并且是指除了列出的要素/组成部分/等之外还可存在另外的要素/组成部分/等;用语“第一”、“第二”和“第三”等仅作为标记使用,不是对其对象的数量限制。In this specification, the terms "a", "an", "the", "the" and "at least one" are used to indicate the presence of one or more elements/components/etc.; the terms "comprising", "including" and "Having" is used to indicate an open-ended inclusive meaning and to mean that there may be additional elements/components/etc. in addition to the listed elements/components/etc.; the terms "first", "secondary" " and "Third" etc. are used only as markers, not as restrictions on the number of their objects.
下面结合附图对本公开示例实施方式进行详细说明。The exemplary embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
图1示出了可以应用于本公开实施例的基于神经网络的数据处理方法或基于神经网络的数据处理装置的示例性系统架构的示意图。FIG. 1 shows a schematic diagram of an exemplary system architecture of a neural network-based data processing method or a neural network-based data processing apparatus that can be applied to an embodiment of the present disclosure.
如图1所示,系统架构100可以包括终端设备101、102、103,网络104和服务器105。网络104用以在终端设备101、102、103和服务器105之间提供通信链路的介质。网络104可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。As shown in FIG. 1 , the
用户可以使用终端设备101、102、103通过网络104与服务器105交互,以接收或发送消息等。其中,终端设备101、102、103可以是具有显示屏并且支持网页浏览的各种电子设备,包括但不限于智能手机、平板电脑、膝上型便携计算机和台式计算机等等。The user can use the
服务器105可以是提供各种服务的服务器,例如对用户利用终端设备101、102、103所进行操作的装置提供支持的后台管理服务器。后台管理服务器可以对接收到的请求等数据进行分析等处理,并将处理结果反馈给终端设备。The
服务器105可例如对所述神经网络的输入数据进行通道拆分处理,并对通道拆分后的输入数据进行通道混洗处理;对通道混洗后的输入数据进行二值化处理,以获得二值输入数据;对所述二值输入数据进行分组卷积处理,所述分组卷积处理对应的卷积核中的权重是二值数据;根据通道顺序将通道混洗后的输入数据与分组卷积处理后的二值数据进行累加处理,以获得输出结果。The
应该理解,图1中的终端设备、网络和服务器的数目仅仅是示意性的,服务器105可以是一个实体的服务器,还可以为多个服务器组成,根据实际需要,可以具有任意数目的终端设备、网络和服务器。It should be understood that the numbers of terminal devices, networks and servers in FIG. 1 are only illustrative, and the
在相关技术中,浮点(实值)神经网络存在高内存消耗,低计算速度问题。由于浮点神经网络的内存消耗较大,通常不能在内存较低的嵌入式设备或者移动设备上使用。为了解决浮点神经网络占用内存较大的问题,通常会采用二值神经网络代替浮点神经网络,以降低神经网络的内存消耗并提高神经网络的计算速度。In the related art, floating-point (real-valued) neural networks have problems of high memory consumption and low calculation speed. Due to the large memory consumption of floating-point neural networks, they usually cannot be used on embedded devices or mobile devices with low memory. In order to solve the problem that the floating-point neural network occupies a large amount of memory, a binary neural network is usually used to replace the floating-point neural network to reduce the memory consumption of the neural network and improve the calculation speed of the neural network.
在相关技术中,如图2所示的ShuffleNet(混洗网)架构以及图3所示的ResNet(雷斯网)架构是一种CNN网络。In the related art, the ShuffleNet architecture shown in FIG. 2 and the ResNet architecture shown in FIG. 3 are a kind of CNN network.
图2是根据相关技术示出的一种ShuffleNet架构的示意图。FIG. 2 is a schematic diagram of a ShuffleNet architecture according to the related art.
如图2所示,ShuffleNet架构包括第一二值化网络202、第一二值组卷积网络203(采用1×1大小的卷积核)、通道混洗网络204、第二二值化网络205、二值深度分离卷积网络206(采用3×3大小的卷积核)、第三二值化网络207、二值组卷积网络208(采用1×1大小的卷积核)。As shown in Figure 2, the ShuffleNet architecture includes a
图3是根据相关技术示出的一种ResNet架构的示意图。FIG. 3 is a schematic diagram of a ResNet architecture according to the related art.
如图3所示,ResNet网络包括第四二值化网络302、第一二值卷积网络303(采用1×1大小的卷积核)、第五二值化网络304、第二二值组卷积网络305(采用3×3大小的卷积核)、第六二值化网络307以及第二二值卷积网络308(采用1×1大小的卷积核)。As shown in FIG. 3, the ResNet network includes a
如图2和图3所示,可以认为ShuffleNet网络和ResNet网络都将一个普通卷积分解为了多个小卷积,而每次卷积前都会对数据进行一次二值化,每次二值化处理都会使得输入数据损失很多信息。这样一来,数据中包括的信息被极大的抹去,使得最后拟合的能力大大下降。As shown in Figure 2 and Figure 3, it can be considered that both the ShuffleNet network and the ResNet network decompose an ordinary convolution into multiple small convolutions, and the data will be binarized once before each convolution, and each binarization will be performed. Processing will make the input data lose a lot of information. In this way, the information included in the data is greatly erased, which greatly reduces the ability of the final fitting.
在本公开实施例中,为了减少信息的损失,可以减少二值神经网络中卷积的数量(即减少对数据进行二值化的次数),来减少数据损失以提高数据处理的准确度。In the embodiment of the present disclosure, in order to reduce the loss of information, the number of convolutions in the binary neural network can be reduced (ie, the number of times of binarizing the data) can be reduced, so as to reduce the data loss and improve the accuracy of data processing.
在相关技术中,还提出了一种二值神经网络架构,即Bi-RealNet(二值-实数网络)架构。In the related art, a binary neural network architecture, that is, a Bi-RealNet (Binary-Real Network) architecture is also proposed.
图4是根据相关技术示出的一种Bi-RealNet架构的示意图。FIG. 4 is a schematic diagram of a Bi-RealNet architecture according to the related art.
如图4所示,该Bi-RealNet架构中包括二值化网络402和二值卷积网络403(采用3×3大小的卷积核)。在如图4所示的Bi-RealNet架构中的二值卷积网络403使用的是普通的卷积,即对输入数据的整体一起做卷积操作,相较于分组卷积,普通卷积的运行速度较慢。As shown in FIG. 4 , the Bi-RealNet architecture includes a
在本公开实施例中,为了克服普通卷积的运行速度较慢的问题,可以采用分组卷积降低计算量以提高运算速度。In the embodiment of the present disclosure, in order to overcome the problem of slow running speed of ordinary convolution, grouped convolution can be used to reduce the amount of calculation and improve the operation speed.
图5是根据一示例性实施例示出的一种基于神经网络的数据处理方法的流程图。本公开实施例所提供的方法可以由任意具备计算处理能力的电子设备处理,例如上述图1实施例中的服务器105和/或终端设备102、103,在下面的实施例中,以服务器105为执行主体为例进行举例说明,但本公开并不限定于此。Fig. 5 is a flow chart of a data processing method based on a neural network according to an exemplary embodiment. The methods provided by the embodiments of the present disclosure can be processed by any electronic device with computing processing capabilities, such as the
参照图5,本公开实施例提供的基于神经网络的数据处理可以包括以下步骤。Referring to FIG. 5 , the neural network-based data processing provided by the embodiments of the present disclosure may include the following steps.
步骤S501,对所述神经网络的输入数据进行通道拆分处理,并对通道拆分后的输入数据进行通道混洗处理。Step S501: Perform channel splitting processing on the input data of the neural network, and perform channel shuffling processing on the input data after channel splitting.
在一些实施例中,神经网络的输入数据可以包括多个通道,例如一张RGB彩色图像数据就可以包括R、G、B三个通道。In some embodiments, the input data of the neural network may include multiple channels, for example, a piece of RGB color image data may include three channels of R, G, and B.
在一些实施例中,可以将输入数据的多个通道分离开来,例如可以将RGB彩色图像数据按照R、G、B三个通道进行数据拆分。In some embodiments, multiple channels of the input data can be separated, for example, the RGB color image data can be split according to three channels of R, G, and B.
在一些实施例中,为了增强神经网络的表达能力,可以对通道拆分后的输入数据进行通道混洗处理,即对通道拆分后的输入数据的通道进行随机排列组合处理。例如,对通道拆分后RGB彩色图像数据的三个通道R、G、B进行随机排列组合,以获得一组随机通道组合,例如G、R、B。In some embodiments, in order to enhance the expressive ability of the neural network, channel shuffling processing may be performed on the input data after channel splitting, that is, random arrangement and combination processing may be performed on the channels of the input data after channel splitting. For example, three channels R, G, B of the RGB color image data after channel splitting are randomly arranged and combined to obtain a set of random channel combinations, such as G, R, B.
步骤S502,对通道混洗后的输入数据进行二值化处理,以获得二值输入数据。Step S502 , performing binarization processing on the input data after channel shuffling to obtain binary input data.
在一些实施例中,对通道混洗后的输入数据进行二值化处理,可以包括:若所述通道混洗后的输入数据大于预设阈值,则将所述通道混洗后的输入数据转换为第一值;若所述通道混洗后的输入数据小于等于所述预设阈值,则将所述通道混洗后的输入数据转换为第二值。In some embodiments, performing binarization processing on the channel-shuffled input data may include: if the channel-shuffled input data is greater than a preset threshold, converting the channel-shuffled input data is a first value; if the input data after channel shuffling is less than or equal to the preset threshold, convert the input data after channel shuffling into a second value.
在一些实施例中,第一值为1,第二值为-1。本领域技术领域人员可以理解,二值数据的两个取值不限于1和-1,也可以是1和0,或者其它二值数据。本本公开实施例中,都以二值数据为1和-1为例进行说明,但本公开对此不做限制。In some embodiments, the first value is 1 and the second value is -1. Those skilled in the art can understand that the two values of the binary data are not limited to 1 and -1, but may also be 1 and 0, or other binary data. In the embodiments of the present disclosure, the binary data is 1 and -1 as examples for description, but the present disclosure does not limit this.
在一些实施例中,预设阈值可以设置为10。若所述通道混洗后的输入数据大于预设阈值,则将所述通道混洗后的输入数据转换为1;若所述通道混洗后的输入数据小于等于所述预设阈值,则将所述通道混洗后的输入数据转换为-1。In some embodiments, the preset threshold may be set to 10. If the input data after channel shuffling is greater than the preset threshold, convert the input data after channel shuffling to 1; if the input data after channel shuffling is less than or equal to the preset threshold, convert The channel shuffled input data is converted to -1.
步骤S503,对所述二值输入数据进行分组卷积处理,所述分组卷积处理对应的卷积核中的权重是二值数据。Step S503 , performing grouped convolution processing on the binary input data, and the weights in the convolution kernels corresponding to the grouped convolution processing are binary data.
在一些实施例中,对所述二值输入数据进行分组卷积处理,可以包括:将所述二值输入数据以及所述神经网络中的卷积核按照通道对应分组;将分组后的二值输入数据与其对应的卷积核进行二值运算处理。In some embodiments, performing grouped convolution processing on the binary input data may include: grouping the binary input data and the convolution kernels in the neural network according to channel correspondence; The input data and its corresponding convolution kernel are processed by binary operation.
步骤S504,根据通道顺序将通道混洗后的输入数据与分组卷积处理后的二值数据进行累加处理,以获得输出结果。Step S504: Accumulate the input data after channel shuffling and the binary data after packet convolution processing according to the channel sequence to obtain an output result.
本公开实施例提供的技术方案,一方面通过对输入数据进行通道拆分、通道混洗等操作实现对输入数据的分组卷积,极大的减少了卷积参数,提高了数据的处理速度;另一方面,通过对输入数据进行二值化以实现对输入数据的压缩,进一步提高了神经网络对数据处理的速度;最后,本公开实施例提高的技术方案仅使用了一次二值化处理,减少了输入数据的信息损失,提高了输出结果的准确性。The technical solutions provided by the embodiments of the present disclosure, on the one hand, realize grouped convolution of the input data by performing channel splitting, channel shuffling and other operations on the input data, which greatly reduces the convolution parameters and improves the data processing speed; On the other hand, by binarizing the input data to realize the compression of the input data, the speed of data processing by the neural network is further improved. The information loss of the input data is reduced, and the accuracy of the output results is improved.
在一些实施例中,图5所示实施例中对通道混洗后的输入数据进行二值化处理可以包括图6所示步骤。In some embodiments, the binarization processing on the input data after channel shuffling in the embodiment shown in FIG. 5 may include the steps shown in FIG. 6 .
步骤S5021,若所述通道混洗后的输入数据大于预设阈值,则将所述通道混洗后的输入数据转换为第一值。Step S5021, if the input data after channel shuffling is greater than a preset threshold, convert the input data after channel shuffling into a first value.
步骤S5022,若所述通道混洗后的输入数据小于等于所述预设阈值,则将所述通道混洗后的输入数据转换为第二值。Step S5022, if the input data after channel shuffling is less than or equal to the preset threshold, convert the input data after channel shuffling into a second value.
在一些实施例中,第一值为1,第二值为-1。本领域技术领域人员可以理解,二值数据的两个取值不限于1和-1,也可以是1和0,或者其它二值数据。本本公开实施例中,都以二值数据为1和-1为例进行说明,但本公开对此不做限制。In some embodiments, the first value is 1 and the second value is -1. Those skilled in the art can understand that the two values of the binary data are not limited to 1 and -1, but may also be 1 and 0, or other binary data. In the embodiments of the present disclosure, the binary data is 1 and -1 as examples for description, but the present disclosure does not limit this.
在一些实施例中,二值数据网络是对权值和激活值(特征值)做二值化处理的网络,浮点数据网络指的是那些权值和激活值都是浮点型数据的网络。In some embodiments, the binary data network is a network that performs binarization processing on weights and activation values (eigenvalues), and the floating-point data network refers to those networks whose weights and activation values are both floating-point data. .
本一些实施例,一个浮点型数据至少占用32个比特位(还可以是16或者64个比特位),而二值数据仅占用一个比特位,二值数据网络模型相对于浮点数据网络模型的内存消耗理论上能减少很多倍,因此二值数据网络在模型压缩上具有很大的优势。In some embodiments, a floating-point data occupies at least 32 bits (may also be 16 or 64 bits), and a binary data occupies only one bit. The binary data network model is compared with the floating-point data network model. The memory consumption can theoretically be reduced many times, so the binary data network has great advantages in model compression.
另外,对神经网络的输入数据、激活函数、权重值同时进行二值化之后,原来32个浮点型数的乘加运算,可以通过一次异或运算(xnor)和一次加法运算解决,在模型加速上具有很大的潜力。In addition, after binarizing the input data, activation function, and weight value of the neural network at the same time, the multiplication and addition of the original 32 floating-point numbers can be solved by an XOR operation (xnor) and an addition operation. Great potential for acceleration.
本实施例提供的技术方案,对输入数据进行二值化,极大的减少了神经网络的内存消耗,并提高了神经网络的运行速度。The technical solution provided by this embodiment binarizes the input data, which greatly reduces the memory consumption of the neural network and improves the running speed of the neural network.
在一些实施例中,图5所示实施例中对所述二值输入数据进行分组卷积处理可以包括如图7所示步骤。In some embodiments, the grouped convolution processing on the binary input data in the embodiment shown in FIG. 5 may include the steps shown in FIG. 7 .
参考图7,对所述二值输入数据进行分组卷积处理可以包括以下步骤。Referring to FIG. 7 , performing a grouped convolution process on the binary input data may include the following steps.
步骤S5031,将所述二值输入数据以及所述神经网络中的卷积核按照通道对应分组。Step S5031, grouping the binary input data and the convolution kernels in the neural network according to channel correspondence.
在相关技术中,一般的卷积会对输入数据的整体一起做卷积操作,即输入数据:H1×W1×C1;而卷积核大小为h1×w1,一共有C2个,然后卷积得到的输出数据就是H2×W2×C2。这里我们假设输出和输出的分辨率是不变的。上述卷积过程是一气呵成的,这对于存储器的容量提出了更高的要求。In the related art, the general convolution will perform the convolution operation on the entire input data, that is, the input data: H 1 ×W 1 ×C 1 ; and the size of the convolution kernel is h1 × w1, there are C 2 in total, Then the output data obtained by convolution is H 2 ×W 2 ×C 2 . Here we assume that the output and output resolution are constant. The above-mentioned convolution process is completed in one go, which puts forward higher requirements on the capacity of the memory.
在相关技术中,分组卷积则是将输入数据分成了g(例如2组)组,需要注意的是,这种分组根据通道进行划分,即某几个通道编为一组,每组包括C1/g个通道(C1代表输入数据的通道数,C1可例如为256)。因为输入数据的改变,相应的,卷积核也需要做出同样的改变。即每组中卷积核的通道数也就变成了C1/g,而卷积核的大小是不需要改变的,此时每组的卷积核的个数就变成了C2/g个,而不是原来的C2了。然后用每组的卷积核同它们对应组内的输入数据卷积,得到了输出数据以后,再用连接的方式组合起来,最终的输出数据的通道仍旧是C2。也就是说,分组数g决定以后,那么我们将并行的运算g个相同的卷积过程,每个过程里(每组),输入数据为H1×W1×C1/g,卷积核大小为h1×w1×C1/g,一共有C2/g个,输出数据为H2×W2×C2/g。In the related art, grouped convolution divides the input data into g (for example, 2 groups) groups. It should be noted that this grouping is divided according to channels, that is, certain channels are grouped into a group, and each group includes C 1 /g channels (C 1 represents the number of channels of input data, and C 1 can be, for example, 256). Because the input data changes, correspondingly, the convolution kernel also needs to make the same change. That is, the number of channels of the convolution kernel in each group becomes C 1 /g, and the size of the convolution kernel does not need to be changed. At this time, the number of convolution kernels in each group becomes C 2 / g instead of the original C 2 . Then, the convolution kernels of each group are convolved with the input data in their corresponding groups, and after the output data is obtained, they are combined in a connected manner, and the final output data channel is still C 2 . That is to say, after the number of groups g is determined, then we will operate g identical convolution processes in parallel. In each process (each group), the input data is H 1 ×W 1 ×C 1 /g, and the convolution kernel The size is h 1 ×w 1 ×C 1 /g, there are C 2 /g in total, and the output data is H 2 ×W 2 ×C 2 /g.
在一些实施例中,按照预设的分组个数对输入数据和神经网络中的卷积核在深度上对应分组,即将某几个通道的输入数据分为一组,并将对应点通道的卷积和数据分为对应组。In some embodiments, the input data and the convolution kernels in the neural network are correspondingly grouped in depth according to a preset number of groups, that is, the input data of certain channels are grouped into one group, and the volume of the corresponding point channel is grouped. The product and data are divided into corresponding groups.
步骤S5032,将分组后的二值输入数据与其对应的卷积核进行二值运算处理。Step S5032, perform binary operation processing on the grouped binary input data and its corresponding convolution kernel.
在一些实施例中,可以并行的运算多个卷积过程(每组输入数据分别与该组对应的卷积和进行卷积)。In some embodiments, multiple convolution processes may be performed in parallel (each group of input data is convolved and convolved with the group corresponding to that group, respectively).
在一些实施例中,在浮点数据卷积过程主要涉及乘、加运算过程,但是对于二值数据卷积过程中除了包括加法过程还可以包括一些逻辑运算过程,例如可包括:异或非运算、异或运算或者同或运算等。In some embodiments, the floating-point data convolution process mainly involves multiplication and addition operations, but the binary data convolution process may include some logical operation processes in addition to the addition process, for example, may include: XOR operation , XOR operation or XOR operation, etc.
在一些实施例中,将分组后的二值输入数据与其对应的卷积核进行二值运算处理中二值运算处理可以包括:异或非运算、异或运算或者同或运算等,本公开对二值运算处理不做限定,以本技术领域人员实际需要为准。In some embodiments, performing binary operation processing on the grouped binary input data and its corresponding convolution kernel, the binary operation processing may include: XOR operation, XOR operation or XOR operation, etc. The binary operation processing is not limited, and the actual needs of those skilled in the art shall prevail.
本实施例提供的技术方案,通过对输入数据和神经网络中的卷积核进行分组处理,使得该神经网络能够并行处理多个卷积以实现对输入数据的处理,极大的减少了内存的消耗,提高了运行的速度。The technical solution provided by this embodiment, by grouping the input data and the convolution kernels in the neural network, enables the neural network to process multiple convolutions in parallel to realize the processing of the input data, which greatly reduces the memory usage. consumption, increasing the speed of operation.
图8是根据一示例性实施例示出的一种神经网络的结构示意图。Fig. 8 is a schematic structural diagram of a neural network according to an exemplary embodiment.
图8所示神经网络可以包括:数据输入网络801、通道混洗网络802、二值处理网络803、二值组卷积处理网络804、累加网络805以及结果输出网络806。The neural network shown in FIG. 8 may include a
数据输入网络801,可以配置为获取神经网络的输入数据。在一些实施例中,获取的神经网络的输入数据包括多个通道。例如,神经网络的输入数据可以是RGB彩色图像,该彩色图像数据可以包括R、G、B三个通道的数据。The
通道混洗网络802,可以配置为对所述神经网络的输入数据进行通道拆分处理,并对通道拆分后的输入数据进行通道混洗处理。The
在一些实施例中,可以将输入数据的多个通道分离开来,例如可以将RGB彩色图像数据按照R、G、B三个通道进行数据拆分。In some embodiments, multiple channels of the input data can be separated, for example, the RGB color image data can be split according to three channels of R, G, and B.
在一些实施例中,为了增强神经网络的表达能力,可以对通道拆分后的输入数据进行通道混洗处理,即对通道拆分后的输入数据的通道进行随机排列组合处理。例如,对通道拆分后RGB彩色图像数据的三个通道R、G、B进行随机排列组合,以获得一组随机通道组合,例如G、R、B。In some embodiments, in order to enhance the expressive ability of the neural network, channel shuffling processing may be performed on the input data after channel splitting, that is, random arrangement and combination processing may be performed on the channels of the input data after channel splitting. For example, three channels R, G, B of the RGB color image data after channel splitting are randomly arranged and combined to obtain a set of random channel combinations, such as G, R, B.
二值处理网络803,可以配置为对通道混洗处理后的输入数据进行二值处理,以生成二值输入数据。The
在一些实施例中,对通道混洗后的输入数据进行二值化处理,包括:若所述通道混洗后的输入数据大于预设阈值,则将所述通道混洗后的输入数据转换为第一值;若所述通道混洗后的输入数据小于等于所述预设阈值,则将所述通道混洗后的输入数据转换为第二值。In some embodiments, performing binarization processing on the channel-shuffled input data includes: if the channel-shuffled input data is greater than a preset threshold, converting the channel-shuffled input data into a first value; if the input data after channel shuffling is less than or equal to the preset threshold, convert the input data after channel shuffling into a second value.
在一些实施例中,第一值为1,第二值为-1。本领域技术领域人员可以理解,二值数据的两个取值不限于1和-1,也可以是1和0,或者其它二值数据。本本公开实施例中,都以二值数据为1和-1为例进行说明,但本公开对此不做限制。In some embodiments, the first value is 1 and the second value is -1. Those skilled in the art can understand that the two values of the binary data are not limited to 1 and -1, but may also be 1 and 0, or other binary data. In the embodiments of the present disclosure, the binary data is 1 and -1 as examples for description, but the present disclosure does not limit this.
二值组卷积处理网络804,可以配置为对二值输入数据进行二值组卷积处理,所述分组卷积处理对应的卷积核中的权重是二值数据。The binary group
在一些实施例中,对所述二值输入数据进行分组卷积处理,包括:将所述二值输入数据以及所述神经网络中的卷积核按照通道对应分组;将分组后的二值输入数据与其对应的卷积核进行二值运算处理。In some embodiments, performing grouped convolution processing on the binary input data includes: grouping the binary input data and the convolution kernels in the neural network according to channel correspondence; grouping the grouped binary input data The data and its corresponding convolution kernel are processed by binary operation.
在一些实施例中,神经网络中的卷积核可以是一个3×3的卷积核。In some embodiments, the convolution kernel in the neural network may be a 3×3 convolution kernel.
累加网络805,可以配置为根据通道数据将通道混洗后的输入数据与二值分组卷积处理后的二值数据进行累加处理。The
结果输出网络806,可以配置为输出累加处理结果。A
本实施例提供的神经网络,通过对输入数据进行二值处理降低了神经网络的内存消耗,并使用二值组卷积以提高了神经网络的运行速度,在此基础上还使用了通道混洗操作以实现不同组通道之间的信息交流。本公开提供的技术方案既可以降低神经网络的内存消耗,又可以减少信息损失。The neural network provided by this embodiment reduces the memory consumption of the neural network by performing binary processing on the input data, and uses binary group convolution to improve the running speed of the neural network. On this basis, channel shuffling is also used. Operates to enable the exchange of information between different groups of channels. The technical solution provided by the present disclosure can not only reduce the memory consumption of the neural network, but also reduce the information loss.
图9是根据一示例性实施例示出的一种基于神经网络的数据处理装置的框图。参照图9,该装置900包括通道混洗模块901、二值处理模块902和分组卷积模块903以及累加模块904。Fig. 9 is a block diagram of a data processing apparatus based on a neural network according to an exemplary embodiment. Referring to FIG. 9 , the
其中,通道混洗模块901可以配置为对所述神经网络的输入数据进行通道拆分处理,并对通道拆分后的输入数据进行通道混洗处理。二值处理模块902可以配置为对通道混洗后的输入数据进行二值化处理,以获得二值输入数据。分组卷积模块903可以配置为对所述二值输入数据进行分组卷积处理,所述分组卷积处理对应的卷积核中的权重是二值数据。累加模块904可以配置为根据通道顺序将通道混洗后的输入数据与分组卷积处理后的二值数据进行累加处理,以获得输出结果。The
在一些实施例中,通道混洗模块901还可以配置为对所述通道拆分后的输入数据的通道进行随机排列组合处理。In some embodiments, the
在一些实施例中,图9所示实施例中的二值处理模块902可以包括如图10所示第一值确定单元9021和第二值确定的单元9022。In some embodiments, the
其中,第一值确定的单元9021可以配置为若所述通道混洗后的输入数据大于预设阈值,则将所述通道混洗后的输入数据转换为第一值.第二值确定单元9022可以配置为若所述通道混洗后的输入数据小于等于所述预设阈值,则将所述通道混洗后的输入数据转换为第二值。Wherein, the
在一些实施例中,所述第一值为1,所述第二值为-1。In some embodiments, the first value is 1 and the second value is -1.
在一些实施例中,图9实施例所示的分组卷积模块903可以包括如图11所示的分组单元9031和二值运算单元9032。In some embodiments, the grouped
其中,分组单元9031可以配置为将所述二值输入数据以及所述神经网络中的卷积核按照通道对应分组;二值运算单元9032可以配置为将分组后的二值输入数据与其对应的卷积核进行二值运算处理。The
在一些实施例中,所述二值运算处理包括:异或非运算、异或运算或者同或运算。In some embodiments, the binary operation processing includes: XOR operation, XOR operation or XOR operation.
由于本公开的示例实施例的基于神经网络的数据处理装置900的各个功能模块与上述基于神经网络的数据处理方法的示例实施例的步骤对应,因此在此不再赘述。Since each functional module of the neural network-based
下面参考图12,其示出了适于用来实现本申请实施例的终端设备的计算机系统1200的结构示意图。图12示出的终端设备仅仅是一个示例,不应对本申请实施例的功能和使用范围带来任何限制。Referring to FIG. 12 below, it shows a schematic structural diagram of a
如图12所示,计算机系统1200包括中央处理单元(CPU)1201,其可以根据存储在只读存储器(ROM)1202中的程序或者从存储部分1208加载到随机访问存储器(RAM)1203中的程序而执行各种适当的动作和处理。在RAM1203中,还存储有系统1200操作所需的各种程序和数据。CPU 1201、ROM1202以及RAM 1203通过总线1204彼此相连。输入/输出(I/O)接口1205也连接至总线1204。As shown in FIG. 12, a
以下部件连接至I/O接口1205:包括键盘、鼠标等的输入部分1206;包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分1207;包括硬盘等的存储部分1208;以及包括诸如LAN卡、调制解调器等的网络接口卡的通信部分1209。通信部分1209经由诸如因特网的网络执行通信处理。驱动器1210也根据需要连接至I/O接口1205。可拆卸介质1211,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器1210上,以便于从其上读出的计算机程序根据需要被安装入存储部分1208。The following components are connected to the I/O interface 1205: an
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分1209从网络上被下载和安装,和/或从可拆卸介质1211被安装。在该计算机程序被中央处理单元(CPU)1201执行时,执行本申请的系统中限定的上述功能。In particular, according to embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the method illustrated in the flowchart. In such an embodiment, the computer program may be downloaded and installed from the network via the
需要说明的是,本申请所示的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本申请中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本申请中,计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:无线、电线、光缆、RF等等,或者上述的任意合适的组合。It should be noted that the computer-readable medium shown in this application may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the above two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or a combination of any of the above. More specific examples of computer readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable Programmable read only memory (EPROM or flash memory), fiber optics, portable compact disk read only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing. In this application, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code therein. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device . Program code embodied on a computer readable medium may be transmitted using any suitable medium including, but not limited to, wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
附图中的流程图和框图,图示了按照本申请各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,上述模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图或流程图中的每个方框、以及框图或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code that contains one or more logical functions for implementing the specified functions executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It is also noted that each block of the block diagrams or flowchart illustrations, and combinations of blocks in the block diagrams or flowchart illustrations, can be implemented in special purpose hardware-based systems that perform the specified functions or operations, or can be implemented using A combination of dedicated hardware and computer instructions is implemented.
描述于本申请实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的单元也可以设置在处理器中,例如,可以描述为:一种处理器包括发送单元、获取单元、确定单元和第一处理单元。其中,这些单元的名称在某种情况下并不构成对该单元本身的限定。The units involved in the embodiments of the present application may be implemented in a software manner, and may also be implemented in a hardware manner. The described unit may also be provided in a processor, for example, it may be described as: a processor includes a sending unit, an obtaining unit, a determining unit and a first processing unit. Among them, the names of these units do not constitute a limitation on the unit itself under certain circumstances.
作为另一方面,本申请还提供了一种计算机可读介质,该计算机可读介质可以是上述实施例中描述的设备中所包含的;也可以是单独存在,而未装配入该设备中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被一个该设备执行时,使得该设备可实现功能包括:对所述神经网络的输入数据进行通道拆分处理,并对通道拆分后的输入数据进行通道混洗处理;对通道混洗后的输入数据进行二值化处理,以获得二值输入数据;对所述二值输入数据进行分组卷积处理,所述分组卷积处理对应的卷积核中的权重是二值数据;根据通道顺序将通道混洗后的输入数据与分组卷积处理后的二值数据进行累加处理,以获得输出结果。As another aspect, the present application also provides a computer-readable medium. The computer-readable medium may be included in the device described in the above embodiments, or may exist alone without being assembled into the device. The above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by a device, the device can realize functions including: performing channel splitting processing on the input data of the neural network, and Perform channel shuffling processing on the input data after channel splitting; perform binarization processing on the input data after channel shuffling to obtain binary input data; perform packet convolution processing on the binary input data, the The weight in the convolution kernel corresponding to the grouped convolution processing is binary data; the input data after channel shuffling and the binary data after grouped convolution processing are accumulated according to the channel order to obtain the output result.
通过以上的实施方式的描述,本领域的技术人员易于理解,这里描述的示例实施方式可以通过软件实现,也可以通过软件结合必要的硬件的方式来实现。因此,本公开实施例的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等)中,包括若干指令用以使得一台计算设备(可以是个人计算机、服务器、移动终端、或者智能设备等)执行根据本公开实施例的方法,例如图5的一个或多个所示的步骤。From the description of the above embodiments, those skilled in the art can easily understand that the exemplary embodiments described herein may be implemented by software, or may be implemented by software combined with necessary hardware. Therefore, the technical solutions of the embodiments of the present disclosure may be embodied in the form of software products, and the software products may be stored in a non-volatile storage medium (which may be CD-ROM, U disk, mobile hard disk, etc.), including several instructions It is used to cause a computing device (which may be a personal computer, a server, a mobile terminal, or a smart device, etc.) to execute the method according to the embodiment of the present disclosure, such as one or more steps shown in FIG. 5 .
此外,上述附图仅是根据本公开示例性实施例的方法所包括的处理的示意性说明,而不是限制目的。易于理解,上述附图所示的处理并不表明或限制这些处理的时间顺序。另外,也易于理解,这些处理可以是例如在多个模块中同步或异步执行的。Furthermore, the above-mentioned figures are merely schematic illustrations of the processes included in the methods according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above figures do not indicate or limit the chronological order of these processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, for example, in multiple modules.
本领域技术人员在考虑说明书及实践这里公开的公开后,将容易想到本公开的其他实施例。本公开旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未申请的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本公开的真正范围和精神由权利要求指出。Other embodiments of the present disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common general knowledge or techniques in the technical field to which this disclosure is not claimed . The specification and examples are to be regarded as exemplary only, with the true scope and spirit of the disclosure being indicated by the claims.
应当理解的是,本公开并不限于这里已经示出的详细结构、附图方式或实现方法,相反,本公开意图涵盖包含在所附权利要求的精神和范围内的各种修改和等效设置。It should be understood that the present disclosure is not limited to the detailed structures, drawings, or implementations shown herein, but on the contrary, the present disclosure is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims .
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910390684.3A CN111914987A (en) | 2019-05-10 | 2019-05-10 | Data processing method and device based on neural network, equipment and readable medium |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910390684.3A CN111914987A (en) | 2019-05-10 | 2019-05-10 | Data processing method and device based on neural network, equipment and readable medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN111914987A true CN111914987A (en) | 2020-11-10 |
Family
ID=73242939
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201910390684.3A Pending CN111914987A (en) | 2019-05-10 | 2019-05-10 | Data processing method and device based on neural network, equipment and readable medium |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN111914987A (en) |
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112907600A (en) * | 2021-03-10 | 2021-06-04 | 江苏禹空间科技有限公司 | Optimization method and system of target detection model |
| CN113177638A (en) * | 2020-12-11 | 2021-07-27 | 联合微电子中心(香港)有限公司 | Processor and method for generating binarization weights for neural networks |
| CN113743582A (en) * | 2021-08-06 | 2021-12-03 | 北京邮电大学 | A novel channel shuffling method and device based on stack shuffling |
| CN114386576A (en) * | 2022-01-10 | 2022-04-22 | 重庆大学 | Brain-like binary neural network automated structure learning method |
| CN119984404A (en) * | 2025-04-08 | 2025-05-13 | 河南建保盒子科技发展有限公司 | An intelligent real-time monitoring and early warning device for heterogeneous ancient buildings based on multi-sensors |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107145939A (en) * | 2017-06-21 | 2017-09-08 | 北京图森未来科技有限公司 | A kind of Neural network optimization and device |
| CN107491787A (en) * | 2017-08-21 | 2017-12-19 | 珠海习悦信息技术有限公司 | Local binarization CNN processing method, device, storage medium and processor |
| CN108009594A (en) * | 2017-12-25 | 2018-05-08 | 北京航空航天大学 | A kind of image-recognizing method based on change packet convolution |
| CN108875904A (en) * | 2018-04-04 | 2018-11-23 | 北京迈格威科技有限公司 | Image processing method, image processing apparatus and computer readable storage medium |
-
2019
- 2019-05-10 CN CN201910390684.3A patent/CN111914987A/en active Pending
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN107145939A (en) * | 2017-06-21 | 2017-09-08 | 北京图森未来科技有限公司 | A kind of Neural network optimization and device |
| US20180373981A1 (en) * | 2017-06-21 | 2018-12-27 | TuSimple | Method and device for optimizing neural network |
| CN107491787A (en) * | 2017-08-21 | 2017-12-19 | 珠海习悦信息技术有限公司 | Local binarization CNN processing method, device, storage medium and processor |
| CN108009594A (en) * | 2017-12-25 | 2018-05-08 | 北京航空航天大学 | A kind of image-recognizing method based on change packet convolution |
| CN108875904A (en) * | 2018-04-04 | 2018-11-23 | 北京迈格威科技有限公司 | Image processing method, image processing apparatus and computer readable storage medium |
Cited By (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113177638A (en) * | 2020-12-11 | 2021-07-27 | 联合微电子中心(香港)有限公司 | Processor and method for generating binarization weights for neural networks |
| CN112907600A (en) * | 2021-03-10 | 2021-06-04 | 江苏禹空间科技有限公司 | Optimization method and system of target detection model |
| CN112907600B (en) * | 2021-03-10 | 2024-05-24 | 无锡禹空间智能科技有限公司 | Optimization method and system of target detection model |
| CN113743582A (en) * | 2021-08-06 | 2021-12-03 | 北京邮电大学 | A novel channel shuffling method and device based on stack shuffling |
| CN113743582B (en) * | 2021-08-06 | 2023-11-17 | 北京邮电大学 | Novel channel shuffling method and device based on stack shuffling |
| CN114386576A (en) * | 2022-01-10 | 2022-04-22 | 重庆大学 | Brain-like binary neural network automated structure learning method |
| CN119984404A (en) * | 2025-04-08 | 2025-05-13 | 河南建保盒子科技发展有限公司 | An intelligent real-time monitoring and early warning device for heterogeneous ancient buildings based on multi-sensors |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN111914987A (en) | Data processing method and device based on neural network, equipment and readable medium | |
| CN110852882B (en) | Group consensus method, apparatus, device and medium for blockchain network | |
| CN109508326B (en) | Method, device and system for processing data | |
| CN111950279B (en) | Entity relationship processing method, device, equipment and computer readable storage medium | |
| CN108932124A (en) | Neural network model compression method and device, terminal equipment and storage medium | |
| CN108628898B (en) | Data storage method, device and device | |
| CN109993179A (en) | The method and apparatus that a kind of pair of data are clustered | |
| CN110765354A (en) | Information pushing method and device, electronic equipment and storage medium | |
| WO2023185515A1 (en) | Feature extraction method and apparatus, and storage medium and electronic device | |
| CN114925811A (en) | Multivariable time sequence processing method, device, equipment and medium | |
| WO2020207410A1 (en) | Data compression method, electronic device, and storage medium | |
| CN110472385A (en) | A kind of password cracking method and device | |
| CN115878642A (en) | A batch-flow integrated data processing method, device and equipment based on data lake | |
| CN110390011B (en) | Data classification method and device | |
| CN110377822A (en) | Method, apparatus and electronic equipment for network characterisation study | |
| CN115221957A (en) | Data processing method, data processing device, medium and electronic equipment | |
| CN113536078B (en) | Method, apparatus and computer storage medium for screening data | |
| CN111915689B (en) | Method, apparatus, electronic device, and computer-readable medium for generating an objective function | |
| CN112100211B (en) | Data storage method, apparatus, electronic device, and computer readable medium | |
| CN111933122B (en) | Speech recognition method, apparatus, electronic device, and computer-readable medium | |
| CA2956155A1 (en) | Methods and apparatus for comparing different types of data | |
| CN113807056B (en) | A document name serial number error correction method, device and equipment | |
| CN117931439A (en) | Map reduction task processing method, device, related equipment and program product | |
| CN110362763A (en) | Data reordering method, data sorting device, medium and electronic equipment | |
| CN111523295A (en) | Data rendering method, device, medium and electronic device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20201110 |
|
| RJ01 | Rejection of invention patent application after publication |