Method, device and electronic system for processing data using convolutional neural network
By using a convolution kernel with a convolution step greater than 1 in the convolutional neural network to perform convolution operations and expansion processing on the input data, the problem of increased time complexity caused by the increase in the number of parameters is solved, and the problem of increased time complexity is achieved without increasing space complexity. In this case, the effect of reducing time complexity and increasing calculation rate is achieved.
Patent Information
- Application Number
- CN202010465620.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-05-27
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2040-05-27
AI Technical Summary
When the convolutional neural network improves the accuracy of the output results, the increase in the number of parameters leads to an increase in time complexity and reduces the calculation rate. It is difficult to reduce the time complexity without increasing the space complexity.
By using a convolution kernel with a convolution step greater than 1 in the target convolution layer of the convolutional neural network to perform convolution and expansion processing on the input data, the target data is output so that its matrix size is the same as the input data, reducing time complexity. , improve the calculation speed.
While ensuring that the space complexity remains unchanged, the time complexity is reduced, the calculation rate of the convolutional neural network is improved, and the expression ability of the model is increased.
Smart Images

Figure CN111797972B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a method, device and electronic system for processing data using a convolutional neural network. Background Art
[0002] Convolutional neural networks have been widely used in the fields of text recognition, speech recognition, etc. Among them, time complexity is one of the commonly used evaluation indicators to measure the performance of convolutional neural networks. In practical applications, in order to improve the accuracy of the output results of convolutional neural networks, a common method is to increase the number of parameters. However, the increase in the number of parameters inevitably increases the time complexity, thereby reducing the calculation rate of the network. Summary of the invention
[0003] In view of this, an object of the present invention is to provide a method, device and electronic system for processing data using a convolutional neural network to alleviate the above-mentioned technical problems.
[0004] In a first aspect, an embodiment of the present invention provides a method for processing data using a convolutional neural network, wherein the method comprises: obtaining collected data of a target object; inputting the collected data into a pre-trained convolutional neural network for convolution processing; wherein the convolutional neural network comprises at least one target convolution layer, and the convolution step corresponding to the target convolution kernel of the target convolution layer is greater than 1; when the target convolution layer receives input data, the input data is convolved and expanded with the target convolution kernel, and the target data is output; wherein the target data comprises a convolution result unit and an expansion unit group inserted adjacent to each convolution result unit, so that the matrix size of the target data is the same as the matrix size of the input data; the data in the expansion unit group is the same as the input data corresponding to the convolution result unit adjacent to the expansion unit group; the target data is input to the next convolution layer of the target convolution layer, and subsequent operations are continued until the convolutional neural network outputs the final result.
[0005] In combination with the first aspect, an embodiment of the present invention provides a first possible implementation of the first aspect, wherein the step of performing convolution operation and expansion processing on the input data and outputting the target data includes: taking each data in the input data as the convolution center data one by one, and performing the following operations for each convolution center data to obtain the target data: taking the convolution center data as the convolution center, applying the convolution operation with the target convolution kernel to obtain the current convolution result; based on the convolution step size of the target convolution kernel, reading the inserted data corresponding to the convolution center data from the input data; inserting the inserted data into the position corresponding to the current convolution result according to the positional relationship with the convolution center data; wherein the position of the current convolution result is the convolution result unit of the target data, the position of the inserted data is the expansion unit of the target data, and each expansion unit corresponding to the current convolution result is an expansion unit group.
[0006] In combination with the first possible implementation of the first aspect, an embodiment of the present invention provides a second possible implementation of the first aspect, wherein the target convolution kernel is an N×N convolution kernel; N is an odd number greater than or equal to 3; based on the convolution step of the target convolution kernel, the step of reading the insertion data corresponding to the convolution center data from the input data includes: based on the convolution step of the target convolution kernel, determining the spanning data area corresponding to the convolution center data in the input data; and using the data in the spanning data area as the insertion data corresponding to the convolution center data.
[0007] In combination with the first aspect, an embodiment of the present invention provides a third possible implementation of the first aspect, wherein the step of performing convolution operation and expansion processing on the input data and outputting the target data includes: performing convolution operation on the input data and the target convolution kernel to obtain a convolution result matrix; based on the convolution step size of the target convolution kernel, splitting the location of each convolution result in the convolution result matrix into a convolution result unit and an expansion unit group, so that the matrix size of the split convolution result matrix is the same as the matrix size of the input data; wherein the convolution result unit stores the convolution results; taking each convolution result unit as a target unit one by one, and performing the following operations for each target unit to obtain the target data: based on the convolution step size of the target convolution kernel, reading the inserted data corresponding to the target unit from the input data; and adding the inserted data to the expansion unit group corresponding to the target unit.
[0008] In combination with the third possible implementation of the first aspect, an embodiment of the present invention provides a fourth possible implementation of the first aspect, wherein the target convolution kernel is an N×N convolution kernel; wherein N is an odd number greater than or equal to 3; based on the convolution step of the target convolution kernel, the step of reading the insertion data corresponding to the target unit from the input data includes: based on the convolution step of the target convolution kernel, determining the spanning data area corresponding to the target unit in the input data; and using the data in the spanning data area as the insertion data corresponding to the target unit.
[0009] In combination with the first aspect, an embodiment of the present invention provides a fifth possible implementation of the first aspect, wherein the step of obtaining collected data of the target object includes: obtaining image data of the target object through a camera; wherein the target object is one of the following objects: a human body, a part of a human body, a vehicle or a license plate.
[0010] In combination with the first aspect, an embodiment of the present invention provides a sixth possible implementation of the first aspect, wherein a convolutional neural network is used to detect or identify a target object.
[0011] In a second aspect, an embodiment of the present invention further provides a device for processing data using a convolutional neural network, wherein the device includes: an acquisition module for acquiring collected data of a target object; a processing module for inputting the collected data into a pre-trained convolutional neural network for convolution processing; wherein the convolutional neural network includes at least one target convolution layer, and the convolution step corresponding to the target convolution kernel of the target convolution layer is greater than 1; an operation module for performing convolution operation and expansion processing on the input data and the target convolution kernel when the target convolution layer receives the input data, and outputting the target data; wherein the target data includes a convolution result unit and an expansion unit group inserted in the vicinity of each convolution result unit, so that the matrix size of the target data is the same as the matrix size of the input data; the data in the expansion unit group is the same as the input data corresponding to the convolution result unit in the vicinity of the expansion unit group; an output module for inputting the target data to the next convolution layer of the target convolution layer, and continuing subsequent operations until the convolutional neural network outputs the final result.
[0012] In a third aspect, an embodiment of the present invention further provides an electronic system, wherein the electronic system comprises: an image acquisition device, a processing device and a storage device; the image acquisition device is used to acquire an image to be detected; a computer program is stored on the storage device, and the computer program executes the method of applying a convolutional neural network to process data when the processed device is running.
[0013] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, wherein the computer program executes the steps of the above-mentioned method of applying a convolutional neural network to process data when executed by a processing device.
[0014] The embodiments of the present invention bring the following beneficial effects:
[0015] The method, device and electronic system for processing data using a convolutional neural network provided by the present invention can, after acquiring the collected data of the target object, input the data into a pre-trained convolutional neural network for convolution processing, wherein the convolutional neural network includes at least one target convolution layer, the convolution step corresponding to the target convolution kernel of the target convolution layer is greater than 1, and when the target convolution layer receives the input data, the input data is convolved and expanded with the target convolution kernel, and the target data is output; the target data is input to the next convolution layer of the target convolution layer, and subsequent operations are continued until the convolutional neural network outputs the final result. This data processing method makes the matrix size of the target data the same as the matrix size of the input data after convolution and expansion processing are performed on the input data using the target convolution kernel with a convolution step greater than 1, wherein the expanded data does not require convolution calculation, thus reducing the time complexity while ensuring that the matrix size of the target data is the same as the matrix size of the input data, thereby improving the calculation rate of the network.
[0016] Other features and advantages of the present disclosure will be set forth in the following description, or some features and advantages may be inferred or unambiguously determined from the description, or may be learned by implementing the above-mentioned technology of the present disclosure.
[0017] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 A flowchart of a method for processing data using a convolutional neural network provided by an embodiment of the present invention;
[0020] Figure 2 A schematic diagram of a convolution result structure provided by an embodiment of the present invention;
[0021] Figure 3 A flowchart of another method for processing data using a convolutional neural network provided by an embodiment of the present invention;
[0022] Figure 4 A flowchart of another method for processing data using a convolutional neural network provided by an embodiment of the present invention;
[0023] Figure 5 A schematic diagram of the structure of another convolution result provided by an embodiment of the present invention;
[0024] Figure 6 A schematic diagram of the structure of another convolution result provided by an embodiment of the present invention;
[0025] Figure 7 A schematic diagram of the structure of a resnet network provided in an embodiment of the present invention;
[0026] Figure 8 A schematic diagram of the structure of a device for processing data using a convolutional neural network provided by an embodiment of the present invention;
[0027] Fig. 9 A schematic diagram of the structure of an electronic system provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0029] Convolutional Neural Networks (CNN) are a type of feedforward neural network that includes convolutional calculations and has a deep structure. It is one of the representative algorithms of deep learning. Since convolutional neural networks have the ability to represent learning and can classify input information in a translation-invariant manner according to their hierarchical structure, they are widely used in the processing and calculation of target detection and recognition. In order to measure the performance of a trained convolutional neural network, time complexity and space complexity are usually used as indicators to evaluate its performance.
[0030] Time complexity determines the training / prediction time of the model. If the complexity is too high, it will take a lot of time to train and predict the model, making it impossible to quickly verify ideas and improve the model, nor to make fast predictions. Space complexity determines the number of model parameters. Due to dimensionality limitations, the more parameters a model has, the more data is required to train the model. However, data sets in real life are usually not too large, which can make model training more prone to overfitting. Therefore, the above time complexity and space complexity are often used as one of the criteria for evaluating neural networks.
[0031] In actual use, in order to improve the accuracy of the output results of the convolutional neural network, a common method is to increase the number of parameters. However, since the increase in the number of parameters inevitably increases the time complexity, it is impossible to increase the number of parameters without increasing the time complexity. For ease of understanding, the time complexity and space complexity are explained as follows: the input data is c*h*w(1*6*6), the convolution kernel of the convolutional neural network is k*k(3*3), padding=1, and the step size is 1 and 2 respectively. Among them, w represents the width of the input data, h represents the height of the input data, and c represents the number of channels; when the step size is 1, The matrix of input data and the matrix of output data are of the same size. Therefore, the time complexity is c*c*h'*w'*k*k=c*c*h*w*k*k=324, and the space complexity, that is, the number of parameters, is k*k*c*c=9, where h' is the height of the output data and w' is the width of the output data. When the step size is 2, the matrix of output data is half of the matrix of input data. Since the data matrix is proportional to the time complexity, when the matrix of output data with a step size of 2 is the same size as the matrix of output data with a step size of 1, the time complexity of a step size of 2 is greater than the time complexity of a step size of 1.
[0032] In summary, as the number of parameters increases, the time complexity also increases. In order to reduce the time complexity and improve the network calculation rate without reducing the space complexity, the embodiments of the present invention provide a method, device and electronic system for processing data using a convolutional neural network, which can alleviate the above technical problems and are described below through embodiments.
[0033] This embodiment provides a method for processing data using a convolutional neural network. Figure 1 A flow chart of a method for processing data using a convolutional neural network is shown, the method specifically comprising the following steps:
[0034] Step S102, acquiring the collected data of the target object;
[0035] The above-mentioned collected data is image data of the target object obtained by photographing with a camera, wherein the target object is an object to be identified or detected, and may be one of the following objects: a human body, a human body part, a vehicle or a license plate, but is not limited to the above-mentioned objects.
[0036] Step S104, inputting the collected data into a pre-trained convolutional neural network for convolution processing; wherein the convolutional neural network includes at least one target convolution layer, and the convolution step length corresponding to the target convolution kernel of the target convolution layer is greater than 1;
[0037] The above-mentioned pre-trained convolutional neural network is used to detect or identify the target object. Usually, the image attributes such as brightness and contrast have a great influence on the image. The same object has very different brightness and contrast. However, in many image recognition and detection problems, these factors should not affect the final recognition and detection results. By preprocessing the image, the convolutional neural network can be prevented from being affected by irrelevant factors as much as possible. Therefore, in this embodiment, the above-mentioned collected data can be preprocessed before being input into the convolutional neural network for convolution processing to improve the accuracy of convolutional neural network recognition and detection.
[0038] The above-mentioned pre-trained convolutional neural network is obtained by training the convolutional neural network using the training data samples of the target object. In the convolutional neural network, the convolution layer where the convolution kernel with a convolution step size greater than 1 is located is set as the target convolution layer, and the convolution kernel of the target convolution layer is called the target convolution kernel; the above-mentioned convolutional neural network includes at least one target convolution layer, wherein the convolution layer is a key part for feature extraction. In actual use, in order to fully extract data features, multiple stacked convolution layers can be set in the convolutional neural network, and the convolution kernel of the convolution layer is used to perform convolution operations on the data to realize the extraction of data features.
[0039] Step S106, when the target convolution layer receives the input data, the input data is convolved and expanded with the target convolution kernel, and the target data is output; wherein the target data includes the convolution result unit and the expansion unit group inserted in the adjacent position of each convolution result unit, so that the matrix size of the target data is the same as the matrix size of the input data; the data in the expansion unit group is the same as the input data corresponding to the convolution result unit in the adjacent position of the expansion unit group;
[0040] The above-mentioned input data refers to the data input to the target convolution layer. If the target convolution layer is in the first layer of the convolutional neural network, the input data is the collected data after the above-mentioned preprocessing; if the target convolution layer is not in the first layer of the convolutional neural network, the input data is the output result of the previous layer of the target convolution layer, and the previous layer of the target convolution layer can be a convolution layer or a pooling layer, etc.
[0041] After the target convolution layer receives the above input data, it uses the target convolution kernel to perform a convolution operation on the input data to obtain a convolution result. The target convolution layer also performs expansion processing on the convolution result to obtain the target data after the target convolution layer processes it; wherein, the expansion processing refers to expanding the matrix of the convolution result data to the same matrix size as the input data. Since the convolution step size corresponding to the target convolution kernel is greater than 1, the dimension of the data matrix after the convolution operation is lower than the matrix dimension of the input data. The expansion processing is to directly insert the expanded data in the adjacent position of the convolution result. The expanded data is the input data that has not been convolved by the convolution kernel. Therefore, the above target data includes a convolution result unit and an expansion unit group inserted in the adjacent position of each convolution result unit, wherein the convolution result unit stores the convolution result, and the expansion unit group stores the expanded data.
[0042] In the process of using the above convolutional neural network containing the target convolution layer to identify or detect the target object, the time complexity can be reduced and the calculation rate of the network can be improved. For ease of understanding, Figure 2 A schematic diagram of the structure of a convolution result is shown, such as Figure 2 As shown in the figure, the matrix on the left side of the arrow represents the matrix of the input data input to the target convolution layer, and the matrix on the right side of the arrow represents the matrix of the target data after convolution and expansion by the target convolution layer. The matrix of the target data is the same as the matrix of the input data, which is an 8*8 matrix; wherein, in the matrix of the target data, the slash unit represents the convolution result unit, and the set of blank units represents the expansion unit group. Each blank unit can be regarded as an expansion unit, and the set of expansion units in the same area constitutes an expansion unit group. The target data in this example is the result of the input data processing by the target convolution kernel with a step size of 2, padding (expansion) set to 1, and 3*3.
[0043] Depend on Figure 2 It can be seen that only 1 / 4 of the units in the target data are the result of calculation by the target convolution layer, and 3 / 4 of the units are the result of directly inserting the left input data into the target data. 1,1 Convolution is performed to obtain Y 1,1 For example, Y 1,1 The location is the convolution result unit, and the adjacent position of the convolution result unit is the expansion unit group. The data filled in each expansion unit in the expansion unit group are the same as Y 1,1 The corresponding input data, namely X 1,1 The relevant data, specifically X 1,1 The adjacent data of Figure 2 As shown, Y 1,1 The data in the corresponding expansion unit group are X 1,2 , X 2,1 and X 2,2 .
[0044] Depend on Figure 2 It can be seen that taking the step size of the convolution kernel as 2 as an example, while ensuring that the spatial complexity c*c*k*k remains unchanged, the time complexity of the above target convolution layer becomes c*c*h'*w'*k*k / s / s=1 / 4*c*c*h'*w'*k*k=1 / 4*c*c*h*w*k*k, which means that under the same time complexity, the spatial complexity can be quadrupled. The above convolutional neural network increases the expressive power of the model while ensuring the running speed remains unchanged.
[0045] Step S108, input the target data to the next convolutional layer of the target convolutional layer, and continue subsequent operations until the convolutional neural network outputs the final result.
[0046] If the next convolution layer is also the target convolution layer, the above process is also executed and will not be repeated here. If the next convolution layer is not the above target convolution layer, only the convolution operation is performed without the expansion processing. The entire convolution neural network is used to process the collected data to realize the recognition or detection of the target object.
[0047] The method for processing data using a convolutional neural network provided by the present invention can, after acquiring the collected data of the target object, input the data into a pre-trained convolutional neural network for convolution processing, wherein the convolutional neural network includes at least one target convolution layer, and the convolution step corresponding to the target convolution kernel of the target convolution layer is greater than 1. When the target convolution layer receives the input data, the input data is convolved and expanded with the target convolution kernel, and the target data is output; the target data is input to the next convolution layer of the target convolution layer, and subsequent operations are continued until the convolutional neural network outputs the final result. After the target convolution kernel with a convolution step greater than 1 is used to perform convolution operations and expansion processing on the input data, the data processing method makes the matrix size of the target data the same as the matrix size of the input data, wherein the data processed by the expansion does not require convolution calculation, thus reducing the time complexity while ensuring that the spatial complexity remains unchanged, thereby improving the calculation rate of the network.
[0048] This embodiment provides another method for processing data using a convolutional neural network, which is implemented on the basis of the above embodiment; this embodiment focuses on describing the specific implementation method of performing convolution operation and expansion processing on the input data and the target convolution kernel to output the target data, that is, the method of convolution and expansion at the same time. Figure 3 FIG. 1 is a flowchart of another method for processing data using a convolutional neural network. The method for processing data in this embodiment includes the following steps:
[0049] Step S302, obtaining the collected data of the target object;
[0050] Step S304, inputting the collected data into a pre-trained convolutional neural network for convolution processing; wherein the convolutional neural network includes at least one target convolution layer, and the convolution step size corresponding to the target convolution kernel of the target convolution layer is greater than 1;
[0051] Step S306, taking each data in the input data as convolution center data one by one, for each convolution center data, taking the convolution center data as the convolution center, applying the convolution operation with the target convolution kernel to obtain the current convolution result;
[0052] The above-mentioned convolution center data as the convolution center means that when the convolution kernel is used to perform convolution operation on the input data, the input data corresponding to the center position of the convolution kernel is used as the convolution center. For example, the convolution kernel is 3×3, the convolution step size is 2, and the convolution kernel is 3×3. Figure 2 When the input data in is convolved for the first time, the median position of the convolution kernel is opposite to the X 1,1 , when performing the second convolution, the median position of the convolution kernel is opposite to the X of the input data 1,3 , and so on, which will not be described in detail here; wherein, the convolution operation in the embodiment of the present invention is similar to the existing convolution operation, which will not be described in detail here.
[0053] Step S308, based on the convolution step size of the target convolution kernel, read the insertion data corresponding to the convolution center data from the input data;
[0054] The above-mentioned insertion data is determined based on the convolution step size corresponding to the target convolution kernel, taking the target convolution kernel as an N×N convolution kernel as an example, where N is an odd number greater than or equal to 3; based on the convolution step size of the target convolution kernel, the step of reading the insertion data corresponding to the convolution center data from the input data includes: based on the convolution step size of the target convolution kernel, determining the spanning data area corresponding to the convolution center data in the input data; and using the data in the spanning data area as the insertion data corresponding to the convolution center data.
[0055] From the above, it can be seen that since the N of the target convolution kernel is greater than or equal to 3, and the convolution step size of the target convolution kernel is greater than 1, in the process of convolving the above input data, there are spanning data that do not participate in the convolution operation, and the positions corresponding to these spanning data are called spanning data areas.
[0056] If the convolution step size of the target convolution kernel is 2, the area where N data adjacent to the convolution center data in the input data are located is used as the spanning data area, and the data in the spanning data area is used as the inserted data corresponding to the convolution center data; for ease of understanding, Figure 2 For example, the target convolution kernel is 3×3 and the convolution step size is 2. For the 3×3 convolution kernel, padding is set to 1, so Figure 2The outer circle of the matrix of the input data on the left is filled with a circle of 0s, such as Figure 2 As shown in the figure, the dotted line unit is the location of the zero padding. When the 3*3 convolution kernel performs the first convolution on the input data, the X in the matrix of the input data is 1,1 Perform convolution operation as the convolution center to obtain Y in the right matrix 1,1 , the Y 1,1 is the convolution result. Since the matrix X of the input data is not included in the first convolution process, 1,2 , X 2,1 , X 2,2 The data at the three positions are used as the convolution center, so the above X 1,2 , X 2,1 , X 2,2 As the convolution center data X 1,1 The corresponding spanning data area.
[0057] Since the convolution step size corresponding to the target convolution kernel is 2, when the 3*3 convolution kernel performs the second convolution on the input data, the X in the matrix of the input data is 1,3 Perform convolution operation as the convolution center to obtain Y in the right matrix 1,3 Convolution result, X 1,4 , X 2,3 , X 2,4 The data at the three positions are used as the convolution center data X 1,3 The corresponding spanning data area.
[0058] Similarly, the other three inserted data adjacent to the convolution result are also determined by the above process, which will not be described in detail here, so that the size of the matrix of the target data is the same as the matrix size of the input data. The process of determining the inserted data of convolution kernels of other sizes, as well as the process of determining the inserted data when the input data is not padded with zeros, refer to the above process and will not be described in detail here.
[0059] The above content is for the case where the convolution step length of the target convolution kernel is 2. If the convolution step length of the target convolution kernel is 3, the N data adjacent to the convolution center data and the N+2 data adjacent to the N data in the input data are regarded as data spanning the data area and will be used as inserted data;
[0060] Take the input data matrix as 9*9 and padding as 1 as an example. When the 3*3 convolution kernel convolves the input data, a 3*3 convolution result matrix can be generated. In this embodiment, when the 3*3 convolution kernel convolves the input data X 1,1 When the first convolution is performed as the convolution center, Y in the target data matrix is obtained 1,1 , the Y 1,1is the convolution result. Since the convolution step size corresponding to the target convolution kernel is 3, when the 3*3 convolution kernel performs the second convolution on the input data, its essence is to convert the X in the matrix of the input data into 1,4 Perform convolution operation as the convolution center to obtain Y in the target data matrix 1,4 Convolution result, because the matrix X of the input data is not included in the convolution process 1,2 , X 1,3 , X 2,1 , X 2,2 , X 2,3 , X 3,1 , X 3,2 , X 3,3 These 8 input data are used as the convolution center. Therefore, the input data and the convolution center data X 1,1 Three adjacent data X 1,2 , X 2,1 , X 2,2 As the inserted data, the five data X adjacent to the above three data 1,3 , X 2,3 , X 3,1 , X 3,2 , X 3,3 Also as X 1,1 Insert data.
[0061] Similarly, the input data and the current data X 1,4 Adjacent 8 data X 1,5 , X 1,6 , X 2,4 , X 2,5 , X 2,6 , X 3, 4X 3,5 , X 3,6 As the inserted data, the corresponding inserting data process of other convolution center data is as described above, which will not be described again here.
[0062] If the convolution step of the target convolution kernel is 4, the N data adjacent to the convolution center data in the input data, the N+2 data adjacent to the N data, and the N+4 data adjacent to the N+2 data will be used as data in the spanning data area and will be inserted as data.
[0063] Continue with Figure 2 The matrix of the input data is 8*8, and padding is set to 1. When the convolution kernel is 3*3 and the convolution step is 4, a 3*3 convolution result matrix can be generated when the input data is convolved. In this embodiment, when the 3*3 convolution kernel convolves the input data X 1,1 When the first convolution is performed as the convolution center, Y in the target data matrix is obtained 1,1, the Y 1,1 is the convolution result. Since the convolution step size corresponding to the target convolution kernel is 4, when the 3*3 convolution kernel performs the second convolution on the input data, its essence is to convert the X in the matrix of the input data into 1,5 Perform convolution operation as the convolution center to obtain Y in the target data matrix 1,5 Convolution result, because the matrix X of the input data is not included in the convolution process 1,2 , X 1,3 , X 1,4 , X 2,1 , X 2,2 , X 2,3 , X 2,4 , X 3,1 , X 3,2 , X 3,3 , X 3,4 , X 4,1 , X 4,2 , X 4,3 , X 4,4 These 15 input data are used as the convolution center, so the input data that is related to the current data X 1,1 Three adjacent data X 1,2 , X 2,1 , X 2,2 As the inserted data, the five data X adjacent to the above three data 1,3 , X 2,3 , X 3,1 , X 3,2 , X 3,3 Also as X 1,1 Insert data, and insert the 7 data adjacent to the above 5 data X 1,4 , X 2,4 , X 3,4 , X 4,1 , X 4,2 , X 4,3 , X 4,4 Also as X 1,1 Insert data.
[0064] Similarly, the input data and the current data X 1,5 15 adjacent data X 1,6 , X 1,7 , X 1,8 , X 2,5 , X 2,6 , X 2,7 , X 2,8 , X 3,5 , X 3,6 , X 3,7 , X 3,8 , X 4,5 , X 4,6 , X4,7 , X 4,8 As inserted data, other inserted data corresponding to the current data are also determined by the above process, which will not be repeated here. The above inserted data are inserted at a position adjacent to the convolution result so that the size of the matrix of the target data is the same as the matrix size of the input data.
[0065] In summary, when the width k of the matrix of k*k input data is divisible by the step size s, after obtaining the convolution result using the target convolution kernel, s-1 insertion data are inserted between two adjacent convolution results so that the size of the matrix of the target data is the same as the matrix size of the input data. For example, if the matrix size of the input data is 8*8, one insertion data is inserted between the convolution results with a step size of 2, and three insertion data are inserted between the convolution results with a step size of 4, so that the matrix of the target data after expansion processing is 8*8; and when the matrix size of the input data is 9*9, two insertion data are inserted between the convolution results with a step size of 3, so that the matrix of the target data after expansion processing is 9*9; if the matrix size of the input data is 10*10, one insertion data is inserted between the convolution results with a step size of 2, and four insertion data are inserted between the convolution results with a step size of 5, so that the matrix of the target data after expansion processing is 10*10; therefore, the number of insertion data is related to the step size.
[0066] Step S310, inserting the inserted data into the position corresponding to the current convolution result according to the positional relationship with the convolution center data; wherein the position of the current convolution result is the convolution result unit of the target data, the position of the inserted data is the expansion unit of the target data, and each expansion unit corresponding to the current convolution result is an expansion unit group;
[0067] Since the matrix size of the expanded target data is the same as the matrix size of the input data, the unit position coordinates in the two matrices are one-to-one corresponding. Therefore, the data at the same position as the position coordinates of the inserted data in the expanded convolution result matrix can be read in the matrix of the input data. The data is the above-mentioned inserted data; and the data at the position corresponding to the convolution result unit in the matrix of the input data does not need to be read.
[0068] In this embodiment, the above steps S306 to S310 are repeatedly executed until each data in the input data is used as the current data to perform convolution operation and expansion processing with the target convolution kernel, that is, the target data after all the input data are convolved and expanded is obtained.
[0069] Step S312, input the target data to the next convolution layer of the target convolution layer, and continue the subsequent operations until the convolutional neural network outputs the final result.
[0070] Another method for processing data using a convolutional neural network provided by an embodiment of the present invention describes in detail the specific process of convolution operation and expansion processing. After acquiring the collected data of the target object, the method can input the collected data into a pre-trained convolutional neural network for convolution processing, use each data in the input data as the convolution center data one by one, and perform convolution operation on the convolution center data and the target convolution kernel to obtain the current convolution result; based on the convolution step of the target convolution kernel, read the insertion data corresponding to the convolution center data from the input data; insert the insertion data into the position corresponding to the current convolution result according to the position relationship with the convolution center data; input the target data into the next convolution layer of the target convolution layer, and continue the subsequent operation until the convolution neural network outputs the final result. This method can insert the read insertion data into the position corresponding to the current convolution result according to the position relationship with the convolution center data according to the convolution step, so that the matrix of the inserted target data is consistent with the matrix size of the input data, and the insertion data can be directly read in the matrix of the input data without the need for convolution calculation, thus reducing the time complexity while ensuring that the space complexity remains unchanged.
[0071] This embodiment provides another method for processing data using a convolutional neural network, which is implemented on the basis of the above embodiment; this embodiment focuses on describing the specific implementation method of performing convolution operation and expansion processing on the input data and the target convolution kernel to output the target data, that is, the method of expanding the capacity after the overall convolution. Figure 4 FIG. 1 is a flowchart of another method for processing data using a convolutional neural network. The method for processing data in this embodiment includes the following steps:
[0072] Step S402, obtaining the collected data of the target object;
[0073] Step S404, inputting the collected data into a pre-trained convolutional neural network for convolution processing; wherein the convolutional neural network includes at least one target convolution layer, and the convolution step length corresponding to the target convolution kernel of the target convolution layer is greater than 1;
[0074] Step S406, performing a convolution operation on the input data and the target convolution kernel to obtain a convolution result matrix;
[0075] The convolution operation process can be implemented by referring to the existing technology and will not be described in detail here.
[0076] Step S408, based on the convolution step size of the target convolution kernel, split the location of each convolution result in the convolution result matrix into a convolution result unit and an expansion unit group, so that the matrix size of the split convolution result matrix is the same as the matrix size of the input data; wherein the convolution result unit stores the convolution result;
[0077] Since the step size corresponding to the target convolution kernel is not less than 1, even if the input data is expanded by zero padding, the size of the convolution result matrix obtained is smaller than the matrix size of the input data. In this embodiment, in order to expand the convolution result matrix to the same matrix size as the input data, the convolution result matrix can be split according to the convolution step size corresponding to the target convolution kernel to achieve the same size of the convolution result matrix as the matrix size of the input data. The above split expansion unit group includes multiple expansion units, and each expansion unit stores an expansion data. For example, the convolution step size of the target convolution kernel is 2, and the location of each convolution result in the convolution result matrix is split into a first unit structure of (N-1)×(N-1). The first unit structure includes: a convolution result unit and N expansion units adjacent to the convolution result unit;
[0078] For ease of understanding, take the input data as an 8*8 matrix and the target convolution kernel as a 3*3 example. When the 3*3 convolution kernel is used to perform convolution operation on the input data, since its convolution step size is 2, the resulting convolution matrix is a 4*4 matrix. Each convolution result position in the convolution result matrix is split into a 2×2 first unit structure. For ease of understanding, see Figure 2 The matrix to the right of the arrow is the convolution result matrix after splitting, such as Figure 2 As shown, there are 16 first unit structures in total, and in each first unit structure, the slash unit is the location of the convolution result, and the blank unit is the location of the expansion unit. In each first unit structure, the convolution result unit is located at the first row and first column position of the first unit structure, and the remaining three positions are the locations of three expansion units.
[0079] For example, the convolution step size of the target convolution kernel is 3, and the location of each convolution result in the convolution result matrix is split into an N×N second unit structure, and the second unit structure includes: a convolution result unit and N expansion units adjacent to the convolution result unit, and N+2 expansion units adjacent to the N expansion units.
[0080] Similarly, if a 4*4 convolution result matrix is obtained by convolution of the target convolution kernel, each convolution result position in the convolution result matrix is split into a 3×3 second unit structure. For ease of understanding, see Figure 5 The structural diagram of another convolution result is shown in Figure 5As shown, the dotted frame is the second unit structure, therefore, there are 16 second unit structures in total, and, in each second unit structure, the slash unit is the location of the convolution result, and the blank unit is the location of the expansion unit, wherein, in each second unit structure, the convolution result unit is located at the first row and first column of the second unit structure, and the remaining 8 positions are the locations of 8 expansion units, and the matrix of the target data after expansion is a 12*12 matrix.
[0081] For example, the convolution step size of the target convolution kernel is 4, and the position of each convolution result in the convolution result matrix is split into a third unit structure of (N+1)×(N+1), and the third unit structure includes: a convolution result unit and N expansion units adjacent to the convolution result unit, N+2 expansion units adjacent to the N expansion units, and N+4 expansion units adjacent to the N+2 expansion units.
[0082] If a 2*2 convolution result matrix is obtained by convolution of the target convolution kernel, each convolution result position in the convolution result matrix is split into a 4×4 third unit structure. For ease of understanding, see Figure 6 The structural diagram of another convolution result is shown in Figure 6 As shown, the dotted frame is the third unit structure, therefore, there are 4 third unit structures in total, and, in each third unit structure, the slash unit is the location of the convolution result, and the blank unit is the location of the expansion unit, wherein, in each third unit structure, the convolution result unit is located at the first row and first column position of the third unit structure, and the remaining 15 positions are the locations of 15 expansion units, and the matrix of the target data after expansion is an 8*8 matrix.
[0083] By analogy, when the convolution step size of the target convolution kernel is s (s>1), the location of each convolution result in the convolution result matrix is split into an s×s unit structure, where each convolution result unit is located at the first row and first column of the unit structure, and the remaining s×(s-1) positions are where the expansion units are located.
[0084] Step S410, taking each convolution result unit as a target unit one by one, and for each target unit, reading the insertion data corresponding to the target unit from the input data based on the convolution step size of the target convolution kernel;
[0085] The target convolution kernel is an N×N convolution kernel; wherein N is an odd number greater than or equal to 3; based on the convolution step size of the target convolution kernel, the step of reading the insertion data corresponding to the target unit from the input data can be performed by step B1-step B2:
[0086] Step B1, based on the convolution step size of the target convolution kernel, determining the spanning data area corresponding to the target unit in the input data;
[0087] Based on the above-mentioned convolution result matrix after splitting, since its size is consistent with the matrix of the input data, the process of determining the spanning data area corresponding to the target unit is the same as the process of determining the spanning data area corresponding to the convolution center data in the input data based on the convolution step size of the target convolution kernel. Therefore, the determination of the spanning data area will not be repeated.
[0088] Step B2, use the data in the spanning data area as the inserted data corresponding to the target unit. Take the above-mentioned target convolution kernel with a convolution step size of 2 to obtain the split convolution result matrix as an example for explanation. Since the input data matrix and the split convolution result matrix are both 8*8 matrices, the unit position coordinates in the two matrices are one-to-one corresponding. Therefore, according to the position coordinate of the expansion unit in the split convolution result matrix, the data at the same position as the position coordinate can be read in the input data matrix. This data is the above-mentioned inserted data; and the data at the position corresponding to the convolution result unit in the input data matrix does not need to be read.
[0089] Step S412, adding the inserted data to the expansion unit group corresponding to the target unit;
[0090] Based on the coordinate position of the above-mentioned inserted data in the matrix of the input data, it is added to the expansion unit having the same coordinate position to complete the expansion processing.
[0091] Step S414, input the target data to the next convolutional layer of the target convolutional layer, and continue the subsequent operations until the convolutional neural network outputs the final result.
[0092] Another method for processing data using a convolutional neural network provided by an embodiment of the present invention describes in detail the specific process of convolution operation and expansion processing. After acquiring the collected data of the target object, the method can input the collected data into a pre-trained convolutional neural network for convolution processing, perform convolution operation on the input data and the target convolution kernel to obtain a convolution result matrix, and based on the convolution step size of the target convolution kernel, split the location of each convolution result in the convolution result matrix into a convolution result unit and an expansion unit group, take each convolution result unit as a target unit one by one, read the inserted data corresponding to the target unit from the input data based on the convolution step size of the target convolution kernel, add the inserted data to the expansion unit group corresponding to the target unit, input the target data to the next convolution layer of the target convolution layer, and continue subsequent operations until the convolutional neural network outputs the final result. This method can split the convolution result matrix so that the split convolution result matrix is consistent with the matrix scale of the input data, and the data in the split expansion unit group can be directly read from the matrix of the input data without the need for convolution calculation. This reduces the time complexity while ensuring that the space complexity remains unchanged, which means that under the same time complexity, the above-mentioned convolutional neural network can increase the expression ability of the neural network while ensuring the running speed remains unchanged.
[0093] In summary, the data in the matrix after the above convolution and expansion can be expressed by the following formula:
[0094]
[0095] Wherein, h[N,N] represents the N*N convolution kernel, N is an odd number greater than or equal to 3, and the division of N / 2 is a floor division operation. For example, if N=3, then N / 2=1; if N=5, then N / 2=2; if N=7, then N / 2=3;
[0096] X(i,j) represents the data in the i-th row and j-th column in the matrix of the input data, i = 0, 1, 2, ..., M-1, j = 0, 1, 2, ..., M-1, M represents the dimension of the matrix of the input data, Y(i,j) represents the data in the i-th row and j-th column in the convolution result matrix (that is, the matrix of the above target data), and s represents the convolution step size.
[0097] The above % refers to Mod, that is, the remainder operation. i%s==0 means that the remainder of i divided by s is 0. In other words, i can divide s. In this embodiment, the matrix of input data and the matrix corresponding to the convolution result matrix (that is, the above target data) are of the same size. From the above formula, it can be seen that the result of Y(i, j) is determined by the values of i and j. That is, if i%s==0 and j%s==0, then In other cases, such as i%s≠0 or j%s≠0, then Y(i,j)=X(i,j).
[0098] Of course, the above formula is explained with i and j in the matrix identifier both starting from 0. In a specific application, i and j in the matrix identifier can also be marked starting from 1. Accordingly, the above formula can be transformed accordingly, which will not be repeated here.
[0099] In practical application, the resnet network including three convolutional layers is used as an example. Figure 7 A structural schematic diagram of a resnet network is shown, and the resnet network includes two convolution layers with a convolution kernel of 1*1 and one convolution layer with a convolution kernel of 3*3. In this embodiment, the 3*3 convolution layer in the resnet network is replaced by the above-mentioned target convolution layer, and the target convolution kernel of the target convolution layer is 3*3. The above-mentioned two convolution layers are used to perform target recognition tasks on the ImageNet1000 class respectively. Table 1 shows the experimental results of two different convolution layers. It can be seen from the results in Table 1 that while the target convolution layer has a significantly improved parameter amount, the error rate is significantly lower than that of the convolution layer of the resnet network.
[0100] Table 1
[0101] Convolutional Layer Calculation Amount Parameter quantity Error rate Resnet network convolutional layer 3x3 556M 5.3M 30.2% Target convolution layer 3x3 561M 10M 27.1%
[0102] It should be noted that the above method embodiments are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referenced to each other.
[0103] Corresponding to the above method embodiment, the embodiment of the present invention provides a device for processing data using a convolutional neural network, Figure 8 A schematic diagram of the structure of a device for processing data using a convolutional neural network is shown. Figure 8 As shown, the device comprises:
[0104] An acquisition module 802 is used to acquire the collected data of the target object;
[0105] The processing module 804 is used to input the collected data into a pre-trained convolutional neural network for convolution processing; wherein the convolutional neural network includes at least one target convolution layer, and the convolution step size corresponding to the target convolution kernel of the target convolution layer is greater than 1;
[0106] The operation module 806 is used for performing convolution operation and expansion processing on the input data and the target convolution kernel when the target convolution layer receives the input data, and outputting the target data; wherein the target data includes the convolution result unit and the expansion unit group inserted in the adjacent position of each convolution result unit, so that the matrix size of the target data is the same as the matrix size of the input data; the data in the expansion unit group is the same as the input data corresponding to the convolution result unit in the adjacent position of the expansion unit group;
[0107] The output module 808 is used to input the target data into the next convolution layer of the target convolution layer and continue the subsequent operations until the convolution neural network outputs the final result.
[0108] The device for processing data using a convolutional neural network provided by the present invention can, after acquiring the collected data of the target object, input the data into a pre-trained convolutional neural network for convolution processing, wherein the convolutional neural network includes at least one target convolution layer, and the convolution step corresponding to the target convolution kernel of the target convolution layer is greater than 1. When the target convolution layer receives the input data, the input data is convolved and expanded with the target convolution kernel, and the target data is output; the target data is input to the next convolution layer of the target convolution layer, and subsequent operations are continued until the convolutional neural network outputs the final result. This data processing method makes the matrix size of the target data the same as the matrix size of the input data after convolution and expansion processing are performed on the input data using a target convolution kernel with a convolution step greater than 1, wherein the expanded data does not require convolution calculation, thus reducing the time complexity while ensuring that the spatial complexity remains unchanged, thereby improving the calculation rate of the network.
[0109] Furthermore, the acquisition module 802 is also used to acquire image data of a target object through a camera; wherein the target object is one of the following objects: a human body, a human body part, a vehicle or a license plate.
[0110] Typically, convolutional neural networks are used to detect or identify target objects.
[0111] Furthermore, the above-mentioned processing module 804 is also used to take each data in the input data as the convolution center data one by one, and for each convolution center data, perform the following operations to obtain the target data: take the convolution center data as the convolution center, apply the convolution operation with the target convolution kernel to obtain the current convolution result; based on the convolution step of the target convolution kernel, read the inserted data corresponding to the convolution center data from the input data; insert the inserted data into the position corresponding to the current convolution result according to the positional relationship with the convolution center data; wherein, the position of the current convolution result is the convolution result unit of the target data, the position of the inserted data is the expansion unit of the target data, and each expansion unit corresponding to the current convolution result is an expansion unit group.
[0112] Among them, the target convolution kernel is an N×N convolution kernel; N is an odd number greater than or equal to 3; based on the convolution step of the target convolution kernel, the step of reading the insertion data corresponding to the convolution center data from the input data includes: based on the convolution step of the target convolution kernel, determining the spanning data area corresponding to the convolution center data in the input data; using the data in the spanning data area as the insertion data corresponding to the convolution center data.
[0113] Furthermore, the above-mentioned processing module 804 is also used to perform a convolution operation on the input data and the target convolution kernel to obtain a convolution result matrix; based on the convolution step size of the target convolution kernel, the location of each convolution result in the convolution result matrix is split into a convolution result unit and an expansion unit group, so that the matrix size of the split convolution result matrix is the same as the matrix size of the input data; wherein the convolution result unit stores the convolution results; each convolution result unit is used as a target unit one by one, and the following operations are performed for each target unit to obtain target data: based on the convolution step size of the target convolution kernel, the inserted data corresponding to the target unit is read from the input data; the inserted data is added to the expansion unit group corresponding to the target unit, so that the matrix size of the split convolution result matrix is the same as the matrix size of the input data.
[0114] The device for processing data using a convolutional neural network provided in the embodiment of the present invention has the same implementation principle and technical effects as those in the aforementioned method embodiment. For the sake of brief description, for parts not mentioned in the embodiment of the device for processing data using a convolutional neural network, reference may be made to the corresponding contents in the aforementioned method embodiment.
[0115] The embodiment of the present invention further provides an electronic system, referring to Fig. 9 The electronic system 900 is a schematic diagram of the structure of the electronic system 900. The electronic system can be used to implement the method and device for processing data using a convolutional neural network according to an embodiment of the present invention.
[0116] like Fig. 9 The electronic system 900 includes one or more processing devices 902, one or more storage devices 904, an input device 906, an output device 908, and one or more image acquisition devices 910. These components are interconnected via a bus system 912 and / or other forms of connection mechanisms (not shown). It should be noted that Fig. 9 The components and structure of the electronic system 900 shown are merely exemplary and non-limiting. The electronic system may also have other components and structures as required.
[0117] The processing device 902 can be a server, an intelligent terminal, or a device including a central processing unit (CPU) or other forms of processing units with data processing capabilities and / or instruction execution capabilities. It can process data of other components in the electronic system 900 and can also control other components in the electronic system 900 to perform the function of processing data.
[0118] The storage device 904 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on a computer-readable storage medium, and the processing device 902 may run the program instructions to implement the client functions and / or other desired functions in the embodiments of the present invention (implemented by the processing device) described below. Various applications and various data, such as various data used and / or generated by the application, may also be stored in the computer-readable storage medium.
[0119] The input device 906 may be a device used by a user to input instructions, and may include one or more of a keyboard, a mouse, a microphone, a touch screen, and the like.
[0120] The output device 908 may output various information (eg, images or sounds) to the outside (eg, a user), and may include one or more of a display, a speaker, and the like.
[0121] The image acquisition device 910 can acquire image data of the target object and store the acquired image data in the storage device 904 for use by other components.
[0122] Exemplarily, the various devices in the method, device, and electronic system for implementing the method, device, and electronic system for processing data using a convolutional neural network according to an embodiment of the present invention may be integrated or dispersed, such as integrating the processing device 902, the storage device 904, the input device 906, and the output device 908 into one, and arranging the image acquisition device 910 at a designated location where image data can be acquired. When the various devices in the above electronic system are integrated, the electronic system may be implemented as an intelligent terminal such as a camera, a smart phone, a tablet computer, a computer, a vehicle-mounted terminal, or the like.
[0123] An embodiment of the present invention further provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the above-mentioned method of processing data using a convolutional neural network. The specific implementation can be found in the method embodiment, which will not be repeated here.
[0124] The computer program product of the method, device and electronic system for processing data using a convolutional neural network provided in the embodiments of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the method in the previous method embodiment. The specific implementation can be found in the method embodiment, which will not be repeated here.
[0125] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the electronic system and / or device described above can refer to the corresponding process in the aforementioned method embodiment and will not be repeated here.
[0126] In addition, in the description of the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0127] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0128] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A method for processing data using a convolutional neural network, characterized in that: The method comprises: Acquire acquisition data of the target object; wherein the acquisition data is an image to be detected acquired by an image acquisition device; Inputting the collected data into a pre-trained convolutional neural network for convolution processing; wherein the convolutional neural network includes at least one target convolution layer, and the convolution step length corresponding to the target convolution kernel of the target convolution layer is greater than 1; When the target convolution layer receives input data, the input data is convolved and expanded with the target convolution kernel to output target data; wherein the target data includes convolution result units and expansion unit groups inserted in adjacent positions of each convolution result unit, so that the matrix size of the target data is the same as the matrix size of the input data; the data in the expansion unit group is the same as the input data corresponding to the convolution result unit in the adjacent position of the expansion unit group; The target data is input into the next convolutional layer of the target convolutional layer, and subsequent operations are continued until the convolutional neural network outputs a final result.
2. The method according to claim 1, characterized in that The step of performing convolution operation and expansion processing on the input data and the target convolution kernel, and outputting the target data, comprises: Each data in the input data is used as convolution center data one by one, and for each convolution center data, the following operations are performed to obtain the target data: Using the convolution center data as the convolution center, applying the target convolution kernel to perform a convolution operation to obtain a current convolution result; Based on the convolution step size of the target convolution kernel, reading the insertion data corresponding to the convolution center data from the input data; The inserted data is inserted into the position corresponding to the current convolution result according to the positional relationship with the convolution center data; wherein the position of the current convolution result is the convolution result unit of the target data, the position of the inserted data is the expansion unit of the target data, and each expansion unit corresponding to the current convolution result is an expansion unit group.
3. The method according to claim 2, characterized in that The target convolution kernel is an N×N convolution kernel; wherein N is an odd number greater than or equal to 3; The step of reading the insertion data corresponding to the convolution center data from the input data based on the convolution step size of the target convolution kernel comprises: Based on the convolution step size of the target convolution kernel, determining a spanning data area corresponding to the convolution center data in the input data; The data in the spanning data area is used as the insertion data corresponding to the convolution center data.
4. The method according to claim 1, characterized in that The step of performing convolution operation and expansion processing on the input data and the target convolution kernel, and outputting the target data, comprises: Performing a convolution operation on the input data and the target convolution kernel to obtain a convolution result matrix; Based on the convolution step size of the target convolution kernel, split the location of each convolution result in the convolution result matrix into a convolution result unit and an expansion unit group, so that the matrix size of the split convolution result matrix is the same as the matrix size of the input data; wherein the convolution result unit stores the convolution result; Each of the convolution result units is used as a target unit one by one, and the following operations are performed for each of the target units to obtain target data: Based on the convolution step size of the target convolution kernel, insert data corresponding to the target unit is read from the input data; and the insert data is added to the expansion unit group corresponding to the target unit.
5. The method according to claim 4, characterized in that The target convolution kernel is an N×N convolution kernel; wherein N is an odd number greater than or equal to 3; The step of reading the insertion data corresponding to the target unit from the input data based on the convolution step size of the target convolution kernel comprises: Based on the convolution step size of the target convolution kernel, determining a spanning data area corresponding to the target unit in the input data; The data in the spanning data area is used as the insertion data corresponding to the target unit.
6. The method according to claim 1, characterized in that The steps of obtaining the collected data of the target object include: Image data of a target object is acquired through a camera; wherein the target object is one of the following objects: a human body, a human body part, a vehicle or a license plate.
7. The method according to claim 1, characterized in that The convolutional neural network is used to detect or identify the target object.
8. A device for processing data using a convolutional neural network, characterized in that: The device comprises: An acquisition module, used to acquire acquisition data of a target object; wherein the acquisition data is an image to be detected acquired by an image acquisition device; A processing module, used for inputting the collected data into a pre-trained convolutional neural network for convolution processing; wherein the convolutional neural network includes at least one target convolution layer, and the convolution step size corresponding to the target convolution kernel of the target convolution layer is greater than 1; A computing module, configured to perform convolution operation and expansion processing on the input data and the target convolution kernel when the target convolution layer receives input data, and output target data; wherein the target data includes convolution result units and expansion unit groups inserted in adjacent positions of each of the convolution result units, so that the matrix size of the target data is the same as the matrix size of the input data; and the data in the expansion unit group is the same as the input data corresponding to the convolution result unit adjacent to the expansion unit group; An output module is used to input the target data into the next convolution layer of the target convolution layer, and continue subsequent operations until the convolution neural network outputs a final result.
9. An electronic system, characterized in that: The electronic system includes: an image acquisition device, a processing device and a storage device; The image acquisition device is used to acquire the image to be detected; The storage device stores a computer program, which, when executed by the processing device, executes the method for processing data using a convolutional neural network as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processing device, the steps of the method for processing data using a convolutional neural network as described in any one of claims 1 to 7 are executed.
