WO2021110147A1 - Methods and apparatuses for image processing, image training and channel shuffling - Google Patents

Methods and apparatuses for image processing, image training and channel shuffling Download PDF

Info

Publication number
WO2021110147A1
WO2021110147A1 PCT/CN2020/133972 CN2020133972W WO2021110147A1 WO 2021110147 A1 WO2021110147 A1 WO 2021110147A1 CN 2020133972 W CN2020133972 W CN 2020133972W WO 2021110147 A1 WO2021110147 A1 WO 2021110147A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
convolution
image group
subconvolution
feature
Prior art date
Application number
PCT/CN2020/133972
Other languages
French (fr)
Chinese (zh)
Inventor
张昱航
陈长国
杨凤海
Original Assignee
阿里巴巴集团控股有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 阿里巴巴集团控股有限公司 filed Critical 阿里巴巴集团控股有限公司
Publication of WO2021110147A1 publication Critical patent/WO2021110147A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features

Definitions

  • This application relates to the field of computer application technology, in particular to an image processing method and device, an image training method and device based on a residual network, a neural network channel shuffling method and device, a neural network architecture, and a computer storage medium and electronic equipment .
  • neural networks are widely used in transportation, medicine and other fields. For example: image recognition, audio recognition, human posture recognition, etc.
  • the residual network structure can be used to solve the above-mentioned problems of gradient disappearance, gradient explosion and network degradation.
  • ShuffleNet in the prior art is a lightweight neural network that adopts a residual network structure, but the lightweight neural network performs channel shuffling work after the end of the network is output, resulting in calculations The amount is large, and because the lightweight neural network involves more operations on the intermediate channel, the accuracy of the output data is not good.
  • the present application provides an image processing method to solve the problem of large amount of calculation and poor accuracy in the process of processing an image in the prior art.
  • This application provides an image processing method, including:
  • the channels of the first subconvolution image group and the second subconvolution image group are shuffled sequentially to obtain a shuffled feature image.
  • the splitting the set of convolutional images to obtain a first convolutional image group and a second convolutional image group includes:
  • the convolutional image set is split based on the number of channels in the convolutional image set to obtain the first convolutional image group and the second convolutional image group.
  • the convolutional image set is split based on the number of channels in the convolutional image set to obtain the first convolutional image set and the first convolutional image set.
  • Two convolution image group including:
  • the number of channels is an even number, split the set of convolutional images into a first convolutional image group and a second convolutional image group with the same number of channels according to the order of channel arrangement;
  • the convolution image corresponding to the adjacent channel greater than the integer is taken as the last convolution image of the first convolution image group, and the convolution image adjacent and greater than the last convolution image channel is taken as the convolution image The first convolution image of the second convolution image group.
  • the respectively convolution operation on the first convolution image group and the second convolution image group to obtain the first subconvolution image group and the second subconvolution image group includes:
  • the first convolution image group and the second convolution image group are respectively used to perform a convolution operation with a preset convolution kernel to obtain the first subconvolution image group and the second subconvolution image group.
  • the first convolution image group and the second convolution image group are respectively used to perform a convolution operation with a preset convolution kernel to obtain the first subconvolution image group and
  • the second subconvolution image group includes:
  • the performing channel shuffling sequentially on the channels of the first subconvolution image group and the second subconvolution image group to obtain the shuffled feature image includes:
  • Channel shuffling is performed on the spliced feature image set to obtain the shuffled feature image.
  • the splicing the first subconvolutional image group and the second subconvolutional image group to obtain a spliced feature image set includes:
  • the first convolution map in the second subconvolution image group is placed after the last convolution map in the first subconvolution image group to obtain the mosaic feature image set.
  • the performing channel shuffling on the mosaic feature image set to obtain the shuffled feature image includes:
  • it further includes:
  • the output feature image is determined.
  • the determining the output characteristic image according to the acquired image characteristic data of the characteristic image and the image characteristic data of the shuffled characteristic image includes:
  • the image feature data of the feature image and the image feature data of the shuffled feature image are added image by image feature data to determine the output feature image.
  • This application also provides an image processing device, including:
  • the first convolution unit is used to perform a convolution operation on the acquired feature images to obtain a convolution image set
  • a splitting unit configured to split the set of convolutional images to obtain a first convolutional image group and a second convolutional image group;
  • a second convolution unit configured to perform a convolution operation on the first convolution image group and the second convolution image group to obtain the first subconvolution image group and the second subconvolution image group;
  • the channel shuffling unit is configured to sequentially perform channel shuffling on the channels of the first subconvolution image group and the second subconvolution image group to obtain shuffled feature images.
  • This application also provides an image training method based on residual network, including:
  • the feature image after the feature image training is determined.
  • This application also provides an image training device based on residual network, including:
  • the first convolution unit is used to perform a convolution operation on the input feature image based on the residual network model architecture to obtain a convolution image set;
  • a splitting unit configured to split the set of convolutional images to obtain a first convolutional image group and a second convolutional image group;
  • a second convolution unit configured to perform a convolution operation on the first convolution image group and the second convolution image group to obtain the first subconvolution image group and the second subconvolution image group;
  • a channel shuffling unit configured to sequentially perform channel shuffling on the channels of the first subconvolution image group and the second subconvolution image group to obtain a shuffled feature image
  • the determining unit is configured to determine the characteristic image of the characteristic image after the training of the characteristic image according to the acquired image characteristic data of the characteristic image and the image characteristic data of the shuffled characteristic image.
  • This application also provides a channel shuffling method of neural network, including:
  • Channel shuffling is sequentially performed on the channels of the first subconvolution image group and the second subconvolution image group.
  • the performing channel shuffling sequentially on the channels of the first subconvolution image group and the second subconvolution image group includes:
  • Channel shuffling is performed on the spliced feature image set.
  • the splicing the first subconvolutional image group and the second subconvolutional image group to obtain the spliced feature image set includes:
  • the first convolution map in the second subconvolution image group is placed after the last convolution map in the first subconvolution image group to obtain the spliced feature map set.
  • the performing channel shuffling on the mosaic feature image set includes:
  • the splicing feature image set is rearranged.
  • This application also provides a neural network channel shuffling device, including:
  • the first convolution unit is configured to perform a convolution operation on the characteristic image input to the neural network to obtain a convolution image set;
  • a splitting unit configured to split the set of convolutional images to obtain a first convolutional image group and a second convolutional image group;
  • a second convolution unit configured to perform a convolution operation on the first convolution image group and the second convolution image group to obtain the first subconvolution image group and the second subconvolution image group;
  • the shuffling unit is configured to sequentially perform channel shuffling on the channels of the first subconvolution image group and the second subconvolution image group.
  • This application also provides a neural network architecture, including:
  • the first convolution layer is used to perform a convolution operation on the input feature image to obtain a convolution image set
  • the second convolution layer is used to perform convolution operations on the first convolution image group and the second convolution image group after the split layer is split to obtain the first subconvolution image group and The second sub-convolution image group;
  • the shuffling layer is used to perform channel shuffling on the channels of the first subconvolution image group and the second subconvolution image group convolved by the second convolution layer to obtain a shuffled feature image ;
  • the calculation layer is used to calculate the feature image to be output according to the image feature data of the feature image input to the first convolutional layer and the image feature data of the feature image shuffled by the shuffle layer.
  • This application also provides a computer storage medium for storing data generated by a network platform and a program corresponding to the data generated by the network platform for processing;
  • the program When the program is read and executed, it executes the steps of the image processing method as described above; or executes the steps of the image training method based on the residual network as described above; or executes the channel shuffling of the neural network as described above method.
  • This application also provides an electronic device, including:
  • the memory is used to store a program for processing the data generated by the network platform.
  • the program When the program is read and executed by the processor, it executes the steps of the image processing method as described above; or executes the residual network-based network as described above.
  • An image processing method provided by the present application obtains a convolutional image set by performing a convolution operation on the acquired feature images; then splits the convolutional image set to obtain a first convolutional image group and a second convolution Convolution image group; afterwards, perform convolution operations on the first convolution image group and the second convolution image group to obtain the first subconvolution image group and the second subconvolution image group; finally, to The first sub-convolution image group and the second sub-convolution image group are channel shuffled to obtain shuffled feature images.
  • the convolution image set is split, at least two branches are formed, namely the first convolution image group and the second convolution image group, so as to disperse the calculation amount of the feature image processing, and the final output of the feature image
  • the first subconvolution image group and the second subconvolution image group perform channel shuffling, shorten the processing process and reduce the loss of image feature data, so the accuracy of the final output feature image can be improved.
  • Figure 1 is a schematic diagram of the structure of a lightweight network in the prior art
  • Fig. 2 is a flowchart of an embodiment of an image processing method provided by the present application
  • FIG. 3 is a schematic structural diagram of an embodiment of an image processing device provided by the present application.
  • FIG. 4 is a flowchart of an embodiment of an image training method based on a residual network provided by the present application
  • FIG. 5 is a schematic structural diagram of a residual network in an embodiment of an image training method based on a residual network provided by the present application;
  • FIG. 6 is a schematic diagram of a training process in an embodiment of an image training method based on a residual network provided by the present application
  • FIG. 7 is a schematic structural diagram of an embodiment of an image training device based on a residual network provided by the present application.
  • FIG. 8 is a flowchart of an embodiment of a channel shuffling method of a neural network provided by the present application.
  • Fig. 9 is a schematic structural diagram of an embodiment of a neural network channel shuffling device provided by the present application.
  • Figure 1 is a schematic diagram of a relatively simple deep network in the prior art.
  • the network is a four-layer fully connected network. It is assumed that the output of each layer of the network after activation is f i (x), where i is the i-th layer, x represents the input of the i-th layer, that is, the output of the i-1th layer, and f is the activation function.
  • BP algorithm is an optimization algorithm based on gradient descent method in neural network
  • the problem of network degradation mainly means that as the network depth increases, a large number of redundant layers will appear. These redundant layers will cause the difference between input and output, which will lead to network degradation, which leads to image recognition. The processing precision or accuracy is reduced.
  • the prior art provides a lightweight network that adopts a residual network structure, thereby avoiding the problem of vanishing gradient (explosion) and network degradation.
  • the lightweight network performs channel shuffling work on the data after the end of the network is output, resulting in a large amount of calculation, and the lightweight network still has the problem of poor image processing accuracy.
  • the present application provides an image processing method, which can reduce the amount of calculation and improve the accuracy of image processing.
  • FIG. 2 is a flowchart of an embodiment of an image processing method provided by the present application. The method includes:
  • Step S201 Perform a convolution operation on the acquired feature images to obtain a set of convolution images
  • the purpose of the step S201 is to perform a dimension upgrade operation on the feature image.
  • the specific implementation process may be that the acquired characteristic image may be the characteristic image input through the input terminal of the neural network as the acquired characteristic image.
  • a convolution operation is performed on the feature image to obtain a plurality of convolution images after convolution, and the convolution images constitute a convolution image set.
  • the convolution operation in step S201 may use a 1 ⁇ 1 convolution kernel to perform a convolution operation on the feature image, so as to obtain multiple convolution maps.
  • the acquired feature images may also be multiple, and multiple convolution maps are obtained after convolution operations on the multiple feature images, and these convolution maps may include new image feature data.
  • the new image feature data is derived from the acquired feature image. This is mainly for the difference between the image feature data after the convolution operation and the image feature data before the convolution operation.
  • Step S202 Split the convolution image set to obtain a first convolution image group and a second convolution image group;
  • the purpose of the step S202 is to divide the convolutional image set into at least two branches, so that the amount of calculation can be reduced in the subsequent processing.
  • the splitting process of step S202 may adopt a splitting method of one-to-two to split the convolutional image set into at least two parts, so that the first convolutional image combined with the second convolution can be obtained.
  • the splitting requirement can be set to be divided into two. Specifically, it can be split for half of the total number of channels of the convolutional image collection, that is, split into two parts from the middle of the convolutional image collection.
  • the number of splits can also be three parts, etc.
  • the split convolutional image set includes: n groups of convolutional image groups.
  • the splitting of the convolutional image set in this embodiment can be divided into two situations, and the details are as follows:
  • the convolution image set is split into a first convolution image combination and a second convolution image group with the same number of channels; that is, the first convolution image group Is 1,2,3,...,(1/2)k; the second convolution image group is Among them, k is the total number of convolutional images in the convolutional image collection.
  • the convolution image corresponding to the adjacent channel greater than the integer is taken as the last feature image of the first convolution image group
  • the first convolution image of the second convolution image group is the same as the first convolution image
  • the convolution image adjacent to the last convolution image of the convolution image group, and the convolution image that is adjacent and larger than the last convolution image channel is taken as the first convolution image of the second convolution image group. That is: the last convolution image of the first convolution image group is The first convolution image of the second convolution image group is
  • the convolutional image combination is mainly split into two parts by splitting into two, that is, the convolution image is divided into two parts evenly.
  • the number of channels according to the odd and even number that is, according to the order of the number of channels, the odd number of channels is divided into one group, and the number of even channels is divided into one group.
  • the splitting method is not limited to the above.
  • Step S203 Perform a convolution operation on the first convolution image group and the second convolution image group respectively to obtain the first subconvolution image group and the second subconvolution image group;
  • the purpose of the step S203 is to reduce the amount of calculation by performing a convolution operation on the first convolution image group and the second convolution image group respectively.
  • the same convolution kernel can be used for the convolution operation for the first convolution image group and the second convolution image group, for example: both 5 ⁇ 5 convolution kernels are used for the convolution operation, and then obtain A first subconvolution image group corresponding to the first convolution image group, and a second subconvolution image group corresponding to the second convolution image group.
  • convolution kernels can be used for the first convolution image group and the second convolution image group to perform convolution operations, for example, a 3 ⁇ 3 convolution kernel is used for the first convolution image group.
  • Convolution operation using a 5 ⁇ 5 convolution kernel to perform a convolution operation on the second convolution image group.
  • the size of the convolution kernel used for the first convolution image group and the second convolution image group is not limited to the above 3 ⁇ 3 and 5 ⁇ 5, and convolution kernels of other sizes may also be used, for example: 7 ⁇ 7 In this embodiment, a 5 ⁇ 5 convolution kernel is used.
  • the size of the convolution kernel can be preset or adjusted according to the image feature data amount of the first convolution image group and the second convolution image group. For example, if the preset convolution kernel size is 5 ⁇ 5. Then the size of the convolution kernel can be adjusted to 3 ⁇ 3 or 7 ⁇ 7 according to the image feature data of the first convolution image group. Similarly, when convolving the second convolution image group, The size of the convolution kernel can also be adjusted. In other words, when performing a convolution operation on any one of the first convolution image group and the second convolution image group, the size of the convolution kernel can be adjusted at any time, and more convolution operations have been achieved.
  • a plurality of convolutional images will be generated corresponding to the first convolution image group and the second convolution image group.
  • Subconvolution image The specific convolution process belongs to the prior art. It is roughly that the 5 ⁇ 5 convolution kernel is used as a filter to slide on each convolution image, and the corresponding position is multiplied and summed to obtain the convolution image group.
  • the sub-convolution image of each convolution image Since in this embodiment, the acquired feature image is split into at least two branches, and the convolution operation is performed on the two branches respectively, the calculation of the feature image can be dispersed into two, that is, the calculation of the feature image can be divided into two. % Feature images are convolved, which reduces the amount of calculation by 50% compared to the amount of calculation before splitting.
  • Step S204 After the convolution operation is performed on the first convolution image group and the second convolution image group, the first subconvolution image group and the second subconvolution image group that need to be obtained are restored to the structure before the split, so enter Step S204.
  • Step S204 performing channel shuffling on the channels of the first subconvolution image group and the second subconvolution image group in sequence to obtain shuffled feature images.
  • the purpose of the step S204 is to restore the sub-convolutional image group obtained after convolution on the convolutional image on the split branch road to the structure before splitting.
  • the channel shuffling can be understood as: the process of disrupting the original channel stacking sequence in the feature map generated by the neural network.
  • the shuffled feature image is the feature image with the channel sequence rearranged.
  • the specific implementation process of step S204 may include:
  • Step S204-1 splicing the first subconvolution image group and the second subconvolution image group to obtain a spliced feature image set
  • Step S204-2 Perform channel shuffling on the spliced feature image set to obtain the shuffled feature image.
  • the splicing in step S204-1 can be understood as merging, that is, merging the first subconvolution image group and the second subconvolution image group, so that the two form a subconvolution image set.
  • Specific splicing can include:
  • the first convolution map in the second subconvolution image group is placed after the last convolution map in the first subconvolution image group to obtain the mosaic feature image set.
  • the splicing of the first subconvolutional image group and the second subconvolutional image group can refer to the above-mentioned splitting process.
  • the bit and the first bit of the second subconvolution image group are spliced to form a subconvolution image group set.
  • the first subconvolution image group is K1, K2, K3, K4
  • the second subconvolution image group is P1, P2, P3, P4
  • it is K1, K2, K3, K4, P1, P2 , P3, P4.
  • step S204-2 The process can include:
  • the spliced feature image set of K1, K2, K3, K4, P1, P2, P3, P4 is shuffled. If the channel arrangement requirement is 1, After rearrangement, they are K1, P1, K2, P2, K3, P3, K4, P4.
  • the processing result for the acquired feature image can be obtained, that is, the shuffled feature image.
  • the shuffled feature image it may also include:
  • the output feature image is determined.
  • the image feature data of the feature image and the image feature data of the shuffled feature image may be added image by image feature data to determine the output feature image.
  • the image processing is split in this embodiment to form at least two branches, the calculation amount of the feature image processing is dispersed, and the first sub-convolutional image group and the second sub-convolution are performed before the final output of the feature image.
  • the product image group performs channel shuffling to shorten the processing process and reduce the loss of image feature data, so the accuracy of the final output feature image can be improved.
  • the image processing method provided by the embodiments of this application can be applied to pedestrian detection, pedestrian attitude estimation, vehicle detection, aircraft detection, ship detection, logistics vehicle detection, drone detection, safe driving estimation, flight attitude estimation, factories, aprons , Engineering sites, large-scale events, concerts, and other application scenarios such as safety work monitoring, so that in these application scenarios, the output image detection results can reduce the amount of detection calculations while ensuring the accuracy of the accuracy of the image detection results.
  • FIG. 3 is a schematic structural diagram of an embodiment of an image processing apparatus provided by the present application.
  • the device includes:
  • the first convolution unit 301 is configured to perform a convolution operation on the acquired feature images to obtain a convolution image set;
  • the purpose of the first convolution unit 301 is to perform a dimension-upgrading operation on the feature image.
  • the specific implementation process may be that the acquired characteristic image may be the characteristic image input through the input terminal of the neural network as the acquired characteristic image.
  • a convolution operation is performed on the feature image to obtain a plurality of convolution images after convolution, and the convolution images constitute a convolution image set.
  • the convolution operation may use a 1 ⁇ 1 convolution kernel to perform a convolution operation on the feature image, so as to obtain multiple convolution maps.
  • the acquired feature images may also be multiple, and multiple convolution maps are obtained after convolution operations on the multiple feature images, and these convolution maps may include new image feature data.
  • the splitting unit 302 is configured to split the set of convolutional images to obtain a first convolutional image group and a second convolutional image group;
  • the purpose of the splitting unit is to divide the convolution image set in the first convolution unit 301 into at least two branches, so that the amount of calculation can be reduced in the subsequent processing, that is, the convolution of the two branches respectively
  • the graph group performs convolution calculation, and then disperses the calculation amount.
  • the splitting process may adopt a splitting method of one-to-two splits to split the convolutional image set into at least two parts, so that the first convolutional image combined with the second convolutional image group can be obtained.
  • the splitting requirement can be set to be divided into two. Specifically, it can be split for half of the total number of channels of the convolutional image collection, that is, split into two parts from the middle of the convolutional image collection.
  • the number of splits can also be three parts, etc.
  • the split convolutional image set includes: n groups of convolutional image groups.
  • the splitting of the convolutional image set in this embodiment can be divided into two situations, and the details are as follows:
  • the convolution image set is split into a first convolution image combination and a second convolution image group with the same number of channels; that is, the first convolution image group Is 1,2,3,...,(1/2)k; the second convolution image group is Among them, k is the total number of convolutional images in the convolutional image collection.
  • the convolution image corresponding to the channel adjacent and larger than the integer is taken as the last feature image of the first convolution image group, and the first convolution image of the second convolution image group is the same as the first convolution image.
  • the convolution image adjacent to the last convolution image of the convolution image group, and the convolution image that is adjacent and larger than the last convolution image channel is used as the first convolution image of the second convolution image group. That is: the last convolution image of the first convolution image group is The first convolution image of the second convolution image group is
  • the convolutional image combination is mainly split into two parts by splitting into two, that is, the convolution image is divided into two parts evenly.
  • the odd and even division of the number of channels that is, according to the order of the number of channels
  • the odd number of channels is divided into one group
  • the number of even channels is divided into one group.
  • the splitting method is not limited to the above.
  • the second convolution unit 303 is configured to perform a convolution operation on the first convolution image group and the second convolution image group respectively to obtain the first subconvolution image group and the second subconvolution image group;
  • the purpose of the second convolution unit 303 is to reduce the amount of calculation by performing convolution operations on the first convolution image group and the second convolution image group respectively.
  • the same convolution kernel can be used for the convolution operation for the first convolution image group and the second convolution image group, for example: both 5 ⁇ 5 convolution kernels are used for the convolution operation, and then obtain A first subconvolution image group corresponding to the first convolution image group, and a second subconvolution image group corresponding to the second convolution image group.
  • convolution kernels can be used for the first convolution image group and the second convolution image group to perform convolution operations, for example, a 3 ⁇ 3 convolution kernel is used for the first convolution image group.
  • Convolution operation using a 5 ⁇ 5 convolution kernel to perform a convolution operation on the second convolution image group.
  • the size of the convolution kernel used for the first convolution image group and the second convolution image group is not limited to the above 3 ⁇ 3 and 5 ⁇ 5, and convolution kernels of other sizes may also be used, for example: 7 ⁇ 7 In this embodiment, a 5 ⁇ 5 convolution kernel is used.
  • the size of the convolution kernel can be preset or adjusted according to the image feature data amount of the first convolution image group and the second convolution image group. For example, if the preset convolution kernel size is 5 ⁇ 5. Then the size of the convolution kernel can be adjusted to 3 ⁇ 3 or 7 ⁇ 7 according to the image feature data of the first convolution image group. Similarly, when convolving the second convolution image group, The size of the convolution kernel can also be adjusted. In other words, when performing a convolution operation on any one of the first convolution image group and the second convolution image group, the size of the convolution kernel can be adjusted at any time, and more convolution operations have been achieved.
  • a plurality of convolutional images will be generated corresponding to the first convolution image group and the second convolution image group.
  • Subconvolution image The specific convolution process belongs to the prior art. It is roughly that the 5 ⁇ 5 convolution kernel is used as a filter to slide on each convolution image, and the corresponding position is multiplied and summed to obtain the convolution image group.
  • the sub-convolution image of each convolution image Since in this embodiment, the acquired feature image is split into at least two branches, and the convolution operation is performed on the two branches respectively, the calculation of the feature image can be dispersed into two, that is, the calculation of the feature image can be divided into two. % Feature images are convolved, which reduces the amount of calculation by 50% compared to the amount of calculation before splitting.
  • the channel shuffling unit 304 is configured to perform channel shuffling on the first subconvolution image group and the second subconvolution image group to obtain shuffled feature images.
  • the purpose of the channel shuffling unit 304 is to restore the sub-convolutional image group obtained after convolution on the convolutional image on the split branch road to the structure before splitting.
  • the specific implementation process can include:
  • the shuffling subunit is used to perform channel shuffling on the spliced feature image set obtained in the splicing subunit to obtain the shuffled feature image.
  • the splicing in the splicing subunit can be understood as merging, that is, the first subconvolution image group and the second subconvolution image group are merged, so that the two form a subconvolution image set.
  • Specific splicing can include:
  • the first convolution map in the second subconvolution image group is placed after the last convolution map in the first subconvolution image group to obtain the mosaic feature image set.
  • the splicing of the first subconvolutional image group and the second subconvolutional image group can refer to the above-mentioned splitting process.
  • the bit and the first bit of the second subconvolution image group are spliced to form a subconvolution image group set.
  • the first subconvolution image group is K1, K2, K3, K4
  • the second subconvolution image group is P1, P2, P3, P4
  • it is K1, K2, K3, K4, P1, P2 , P3, P4.
  • the specific implementation process of the shuffling subunit Can include:
  • the spliced feature image set of K1, K2, K3, K4, P1, P2, P3, P4 is shuffled. If the channel arrangement requirement is 1, After rearrangement, they are K1, P1, K2, P2, K3, P3, K4, P4.
  • the processing result for the acquired feature image can be obtained, that is, the shuffled feature image.
  • the shuffled feature image it may also include:
  • the output feature image is determined.
  • the image feature data of the feature image and the image feature data of the shuffled feature image may be added image by image feature data to determine the output feature image.
  • the image processing is split in this embodiment to form at least two branches, the calculation amount of the feature image processing is dispersed, and the first sub-convolutional image group and the second sub-convolution are performed before the final output of the feature image.
  • the product image group performs channel shuffling to shorten the processing process and reduce the loss of image feature data, thereby improving the accuracy of the final output feature image.
  • FIG. 4 is a flowchart of an embodiment of an image training method based on a residual network provided by the present application.
  • the training method includes:
  • Step S401 Based on the residual network model architecture, perform a convolution operation on the input feature image to obtain a convolution image set;
  • step S401 For the specific implementation process of step S401, reference may be made to step S201 in the above-mentioned image processing method embodiment provided in this application.
  • step S401 is the residual network model architecture, that is, the residual network.
  • FIG. 5 is a schematic structural diagram of a residual network in an embodiment of an image training method based on a residual network provided by the present application.
  • the residual network is a network composed of a series of basic residual modules with information jump connections, that is, every two layers add a shortcut (jump connection) to form a residual block, and multiple residual blocks are connected together It constitutes a residual network.
  • Step S402 Split the convolution image set to obtain a first convolution image group and a second convolution image group;
  • FIG. 6 is a schematic diagram of the training process in the embodiment of the image training method based on the residual network provided by the present application; the rightmost part of FIG. 6 is the first after splitting.
  • the specific splitting process of the first convolution image group and the second convolution image group reference may be made to step S202 in the above-mentioned embodiment of the image processing method provided in this application, which will not be repeated here.
  • the splitting in step S402 in this embodiment is for splitting inside the residual network, that is, splitting is performed on the internal branch of the residual network.
  • Step S403 performing a convolution operation on the first convolution image group and the second convolution image group respectively to obtain the first subconvolution image group and the second subconvolution image group;
  • step S403 For the specific implementation process of step S403, refer to FIG. 6. As shown in FIG. 6, the m ⁇ m convolution kernel is used to convolve the first convolution image group and the second convolution image group.
  • Step S203 in the embodiment of an image processing method provided by the application is not repeated here.
  • Step S404 Perform channel shuffling on the first subconvolution image group and the second subconvolution image group to obtain shuffled feature images
  • step S404 refers to FIG. 6, where the first subconvolution image group and the second subconvolution image group are interpolated with each other, and the specific channel shuffling process can refer to the above-mentioned image processing method provided in this application. Step S204 in the embodiment will not be repeated here.
  • Step S405 According to the acquired image feature data of the feature image and the image feature data of the shuffled feature image, determine the feature image after the feature image training.
  • step S405 the image feature data of the input feature image and the image feature data of the shuffled feature image can be added image by image feature data to determine the final output feature image.
  • this application also discloses a residual network-based image training method.
  • the embodiment of the image training device of the network please refer to FIG. 7. Since the device embodiment is basically similar to the method embodiment, the description is relatively simple. For related parts, please refer to the part of the description of the method embodiment.
  • the device embodiments described below are merely illustrative.
  • FIG. 7 is a schematic structural diagram of an embodiment of an image training device based on a residual network provided by the present application.
  • the device includes:
  • the first convolution unit 701 is configured to perform a convolution operation on the input feature image based on the residual network model architecture to obtain a convolution image set;
  • step S401 For the specific implementation process of the first convolution unit 701, refer to step S401 in the above-mentioned embodiment of the image training method based on residual network.
  • the splitting unit 702 is configured to split the set of convolutional images to obtain a first convolutional image group and a second convolutional image group;
  • step S402 for the specific implementation process of the splitting unit 702, reference may be made to step S402 in the foregoing embodiment of the image training method based on residual network.
  • the second convolution unit 703 is configured to perform a convolution operation on the first convolution image group and the second convolution image group respectively to obtain the first subconvolution image group and the second subconvolution image group;
  • step S403 for the specific implementation process of the second convolution unit 703, reference may be made to step S403 in the above-mentioned embodiment of the image training method based on residual network.
  • a channel shuffling unit 704 configured to perform channel shuffling on the first subconvolution image group and the second subconvolution image group to obtain shuffled feature images
  • step S404 for the specific implementation process of the channel shuffling unit 704, reference may be made to step S404 in the above-mentioned embodiment of the image training method based on residual network.
  • the determining unit 705 is configured to determine the feature image after the feature image training according to the acquired image feature data of the feature image and the image feature data of the shuffled feature image.
  • step S405 for the specific implementation process of the determining unit 705, reference may be made to step S405 in the foregoing embodiment of an image training method based on a residual network.
  • FIG. 8 is a flowchart of an embodiment of a neural network channel shuffling method provided by the present application.
  • the channel shuffling method includes:
  • Step S801 Obtain a set of convolutional images according to the convolution operation on the characteristic images input to the neural network;
  • step S801 For the specific implementation process of step S801, reference may be made to step S201 in the above-mentioned embodiment of an image processing method provided by the present application, which will not be repeated here.
  • Step S802 Split the convolution image set to obtain a first convolution image group and a second convolution image group;
  • step S802 For the specific implementation process of step S802, reference may be made to step S202 in the above-mentioned image processing method embodiment provided in this application, which will not be repeated here.
  • Step S803 Perform a convolution operation on the first convolution image group and the second convolution image group respectively to obtain the first subconvolution image group and the second subconvolution image group;
  • step S803 For the specific implementation process of step S803, reference may be made to step S203 in the above-mentioned embodiment of an image processing method provided in this application, which will not be repeated here.
  • Step S804 Perform channel shuffling on the first subconvolution image group and the second subconvolution image group.
  • step S804 For the specific implementation process of step S804, reference may be made to step S204 in the above-mentioned image processing method embodiment provided in this application, which will not be repeated here.
  • this application also provides a neural network channel shuffling device. As shown in FIG. 9, the device includes:
  • the first convolution unit 901 is configured to perform a convolution operation on the characteristic image input to the neural network to obtain a convolution image set;
  • the splitting unit 902 is configured to split the set of convolutional images to obtain a first convolutional image group and a second convolutional image group;
  • the second convolution unit 903 is configured to perform a convolution operation on the first convolution image group and the second convolution image group to obtain the first subconvolution image group and the second subconvolution image group;
  • the shuffling unit 904 is configured to perform channel shuffling on the first subconvolution image group and the second subconvolution image group.
  • this application also provides a neural network architecture, including:
  • the first convolution layer is used to perform a convolution operation on the input feature image to obtain a convolution image set
  • the second convolution layer is used to perform convolution operations on the first convolution image group and the second convolution image group after the split layer is split to obtain the first subconvolution image group and The second sub-convolution image group;
  • a shuffling layer configured to perform channel shuffling on the first subconvolution image group and the second subconvolution image group convolved by the second convolution layer to obtain a shuffled feature image
  • the calculation layer is used to calculate the feature image to be output according to the image feature data of the feature image input to the first convolutional layer and the image feature data of the feature image shuffled by the shuffle layer.
  • this application also provides a computer storage medium for storing data generated by a network platform, and a program corresponding to the data generated by the network platform for processing;
  • the program When the program is read and executed, it executes the steps of the image processing method as described above; or executes the steps of the image training method based on the residual network as described above; or executes the channel shuffling of the neural network as described above method.
  • this application also provides an electronic device, including:
  • the memory is used to store a program for processing the data generated by the network platform.
  • the program When the program is read and executed by the processor, it executes the steps of the image processing method as described above; or executes the residual network-based network as described above.
  • the computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • processors CPUs
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • the memory may include non-permanent memory in computer readable media, random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer readable media.
  • RAM random access memory
  • ROM read-only memory
  • flash RAM flash memory
  • Computer-readable media include permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology.
  • the information can be computer-readable instructions, data structures, program modules, or other data.
  • Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical storage, Magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices.
  • computer-readable media does not include non-transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.
  • this application can be provided as methods, systems or computer program products. Therefore, this application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
  • a computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Artificial Intelligence (AREA)
  • Biomedical Technology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Multimedia (AREA)
  • Image Analysis (AREA)

Abstract

Disclosed in the present application are an image processing method and apparatus, a residual network-based image training method and apparatus, a channel shuffling method and apparatus for a neural network, a neural network architecture, a computer storage medium and an electronic device. The image processing method comprises: performing a convolution operation on acquired feature images to obtain a convolution image set; splitting the convolution image set to obtain a first convolution image group and a second convolution image group; performing a convolution operation on the first convolution image group and the second convolution image group separately to obtain a first subconvolution image group and a second subconvolution image group; and performing channel shuffling on the first subconvolution image group and the second subconvolution image group to obtain shuffled feature images. Therefore, the amount of calculations during the image processing process is reduced, the loss of image feature data is reduced, and the accuracy of the finally outputted feature images is improved.

Description

一种图像处理,图像训练以通道混洗方法和装置A method and device for image processing, image training and channel shuffling
本申请要求2019年12月06日递交的申请号为201911242229.5、发明名称为“一种图像处理,图像训练以通道混洗方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed on December 6, 2019 with the application number 201911242229.5 and the title of the invention "a method and device for image processing, image training and channel shuffling", the entire content of which is incorporated by reference In this application.
技术领域Technical field
本申请涉及计算机应用技术领域,具体涉及一种图像处理方法和装置,基于残差网络的图像训练方法和装置,神经网络的通道混洗方法和装置,神经网络架构,以及计算机存储介质和电子设备。This application relates to the field of computer application technology, in particular to an image processing method and device, an image training method and device based on a residual network, a neural network channel shuffling method and device, a neural network architecture, and a computer storage medium and electronic equipment .
背景技术Background technique
随着人工智能的发展,神经网络被广泛的应用在交通、医学等领域。例如:图像识别,音频识别,人体姿态识别等。With the development of artificial intelligence, neural networks are widely used in transportation, medicine and other fields. For example: image recognition, audio recognition, human posture recognition, etc.
目前已有的神经网络,在对图像人体姿态检测的优化中,常见的就是通过加深网络方式或者利用迁移学习的方式完成网络精度的提升,从而提高识别的准确度。其中,对于加深网络是指增加网络的层数,网络的层数越多,意味着能够提取的特征层次就越丰富,并且,越深的网络提取的特征越抽象,越具有语义信息。所以,通常在选用神经网络时更倾向于使用更深层次的网络结构,以便取得更高层次的特征。但是在使用深层次的网络结构时存在梯度消失,梯度爆炸和网络退化等问题。In the existing neural networks, in the optimization of image human posture detection, it is common to improve the accuracy of the network by deepening the network or using transfer learning to improve the accuracy of recognition. Among them, deepening the network refers to increasing the number of layers of the network. The more layers of the network, the richer the feature levels that can be extracted, and the deeper the network, the more abstract the features and the more semantic information. Therefore, it is usually more inclined to use a deeper network structure when selecting a neural network in order to obtain higher-level features. However, when using a deep network structure, there are problems such as gradient disappearance, gradient explosion and network degradation.
基于现有深层网络存在的问题,可以采用残差网络结构解决了上述梯度消失,梯度爆炸和网络退化的问题。例如:现有技术中的轻量化网络(ShuffleNet)就是一种采用残差网络结构的轻量化神经网络,但是所述轻量化神经网络由于是在网络末端输出后进行通道混洗工作,从而导致计算量较大,另外由于该轻量化神经网络对中间通道涉及较多操作,输出数据的精度并不好。Based on the existing problems of the existing deep network, the residual network structure can be used to solve the above-mentioned problems of gradient disappearance, gradient explosion and network degradation. For example: ShuffleNet in the prior art is a lightweight neural network that adopts a residual network structure, but the lightweight neural network performs channel shuffling work after the end of the network is output, resulting in calculations The amount is large, and because the lightweight neural network involves more operations on the intermediate channel, the accuracy of the output data is not good.
发明内容Summary of the invention
本申请提供一种图像处理方法,以解决现有技术中处理图像过程中计算量大且精度差的问题。The present application provides an image processing method to solve the problem of large amount of calculation and poor accuracy in the process of processing an image in the prior art.
本申请提供一种图像处理方法,包括:This application provides an image processing method, including:
对获取的特征图像进行卷积操作,获得卷积图像集合;Perform a convolution operation on the acquired feature images to obtain a set of convolution images;
拆分所述卷积图像集合,获得第一卷积图像组和第二卷积图像组;Split the set of convolution images to obtain a first convolution image group and a second convolution image group;
分别对所述第一卷积图像组和第二卷积图像组进行卷积操作,获得所述第一子卷积图像组和第二子卷积图像组;Performing a convolution operation on the first convolution image group and the second convolution image group respectively to obtain the first subconvolution image group and the second subconvolution image group;
将所述第一子卷积图像组和第二子卷积图像组的通道顺序进行混洗,获得混洗后的特征图像。The channels of the first subconvolution image group and the second subconvolution image group are shuffled sequentially to obtain a shuffled feature image.
在一些实施例中,所述拆分所述卷积图像集合,获得第一卷积图像组和第二卷积图像组,包括:In some embodiments, the splitting the set of convolutional images to obtain a first convolutional image group and a second convolutional image group includes:
按照设定的拆分要求,基于所述卷积图像集合中的通道数量,对所述卷积图像集合进行拆分,获得所述第一卷积图像组和第二卷积图像组。According to the set splitting requirements, the convolutional image set is split based on the number of channels in the convolutional image set to obtain the first convolutional image group and the second convolutional image group.
在一些实施例中,所述按照设定的拆分要求,基于所述卷积图像集合中的通道数量,对所述卷积图像集合进行拆分,获得所述第一卷积图像组和第二卷积图像组,包括:In some embodiments, according to a set splitting requirement, the convolutional image set is split based on the number of channels in the convolutional image set to obtain the first convolutional image set and the first convolutional image set. Two convolution image group, including:
若所述通道数量为偶数,则按照通道排列顺序,将所述卷积图像集合拆分成通道数量相同的第一卷积图像组合和第二卷积图像组;If the number of channels is an even number, split the set of convolutional images into a first convolutional image group and a second convolutional image group with the same number of channels according to the order of channel arrangement;
若所述通道数量为奇数,则选取所述通道数量的一半并取整数;If the number of channels is an odd number, select half of the number of channels and take an integer;
按照通道排列顺序,将相邻且大于所述整数的通道对应的卷积图像作为第一卷积图像组的末尾卷积图像,将相邻且大于所述末尾卷积图像通道的卷积图像作为第二卷积图像组的首位卷积图像。According to the order of the channel arrangement, the convolution image corresponding to the adjacent channel greater than the integer is taken as the last convolution image of the first convolution image group, and the convolution image adjacent and greater than the last convolution image channel is taken as the convolution image The first convolution image of the second convolution image group.
在一些实施例中,所述分别对所述第一卷积图像组和第二卷积图像组卷积操作,获得所述第一子卷积图像组和第二子卷积图像组,包括:In some embodiments, the respectively convolution operation on the first convolution image group and the second convolution image group to obtain the first subconvolution image group and the second subconvolution image group includes:
对所述第一卷积图像组和所述第二卷积图像组分别采用预设的卷积核进行卷积操作,获得所述第一子卷积图像组和第二子卷积图像组。The first convolution image group and the second convolution image group are respectively used to perform a convolution operation with a preset convolution kernel to obtain the first subconvolution image group and the second subconvolution image group.
在一些实施例中,所述对所述第一卷积图像组和所述第二卷积图像组分别采用预设的卷积核进行卷积操作,获得所述第一子卷积图像组和第二子卷积图像组,包括:In some embodiments, the first convolution image group and the second convolution image group are respectively used to perform a convolution operation with a preset convolution kernel to obtain the first subconvolution image group and The second subconvolution image group includes:
对所述第一卷积图像组采用预设的第一卷积核进行卷积操作,获得所述第一子卷积图像组;Using a preset first convolution kernel to perform a convolution operation on the first convolution image group to obtain the first subconvolution image group;
对所述第二卷积图像组采用预设的第二卷积核进行卷积操作,获得所述第二子卷积图像组。Performing a convolution operation on the second convolution image group using a preset second convolution kernel to obtain the second subconvolution image group.
在一些实施例中,所述对所述第一子卷积图像组和第二子卷积图像组的通道顺序进行通道混洗,获得混洗后的特征图像,包括:In some embodiments, the performing channel shuffling sequentially on the channels of the first subconvolution image group and the second subconvolution image group to obtain the shuffled feature image includes:
对所述第一子卷积图像组和第二子卷积图像组进行拼接,获得拼接后的拼接特征图 像集合;Splicing the first sub-convolutional image group and the second sub-convolutional image group to obtain a spliced feature image set;
对所述拼接特征图像集合进行通道混洗,获得所述混洗后的特征图像。Channel shuffling is performed on the spliced feature image set to obtain the shuffled feature image.
在一些实施例中,所述对所述第一子卷积图像组和第二子卷积图像组进行拼接,获得拼接后的拼接特征图像集合,包括:In some embodiments, the splicing the first subconvolutional image group and the second subconvolutional image group to obtain a spliced feature image set includes:
按照通道排列顺序,将所述第二子卷积图像组中首位卷积图放到所述第一子卷积图像组中末尾卷积图之后,获得所述拼接特征图像集合。According to the channel arrangement order, the first convolution map in the second subconvolution image group is placed after the last convolution map in the first subconvolution image group to obtain the mosaic feature image set.
在一些实施例中,所述对所述拼接特征图像集合进行通道混洗,获得混洗后的特征图像,包括:In some embodiments, the performing channel shuffling on the mosaic feature image set to obtain the shuffled feature image includes:
按照设定的通道排列要求,对所述拼接特征图像集合重新排列,获得混洗后的特征图像。According to the set channel arrangement requirements, rearrange the spliced feature image set to obtain shuffled feature images.
在一些实施例中,还包括:In some embodiments, it further includes:
根据获取的特征图像的图像特征数据和混洗后的特征图像的图像特征数据,确定输出的特征图像。According to the acquired image feature data of the feature image and the image feature data of the shuffled feature image, the output feature image is determined.
在一些实施例中,所述根据获取的特征图像的图像特征数据和混洗后的特征图像的图像特征数据,确定输出的特征图像,包括:In some embodiments, the determining the output characteristic image according to the acquired image characteristic data of the characteristic image and the image characteristic data of the shuffled characteristic image includes:
将所述特征图像的图像特征数据和混洗后的特征图像的图像特征数据进行逐图像特征数据相加,确定输出的特征图像。The image feature data of the feature image and the image feature data of the shuffled feature image are added image by image feature data to determine the output feature image.
本申请还提供一种图像处理装置,包括:This application also provides an image processing device, including:
第一卷积单元,用于对获取的特征图像进行卷积操作,获得卷积图像集合;The first convolution unit is used to perform a convolution operation on the acquired feature images to obtain a convolution image set;
拆分单元,用于拆分所述卷积图像集合,获得第一卷积图像组和第二卷积图像组;A splitting unit, configured to split the set of convolutional images to obtain a first convolutional image group and a second convolutional image group;
第二卷积单元,用于分别对所述第一卷积图像组和第二卷积图像组进行卷积操作,获得所述第一子卷积图像组和第二子卷积图像组;A second convolution unit, configured to perform a convolution operation on the first convolution image group and the second convolution image group to obtain the first subconvolution image group and the second subconvolution image group;
通道混洗单元,用于对所述第一子卷积图像组和第二子卷积图像组的通道顺序进行通道混洗,获得混洗后的特征图像。The channel shuffling unit is configured to sequentially perform channel shuffling on the channels of the first subconvolution image group and the second subconvolution image group to obtain shuffled feature images.
本申请还提供一种基于残差网络的图像训练方法,包括:This application also provides an image training method based on residual network, including:
基于残差网络模型架构,对输入的特征图像进行卷积操作,获得卷积图像集合;Based on the residual network model architecture, perform convolution operations on the input feature images to obtain a set of convolution images;
拆分所述卷积图像集合,获得第一卷积图像组和第二卷积图像组;Split the set of convolution images to obtain a first convolution image group and a second convolution image group;
分别对所述第一卷积图像组和第二卷积图像组进行卷积操作,获得所述第一子卷积图像组和第二子卷积图像组;Performing a convolution operation on the first convolution image group and the second convolution image group respectively to obtain the first subconvolution image group and the second subconvolution image group;
对所述第一子卷积图像组和第二子卷积图像组的通道顺序进行通道混洗,获得混洗 后的特征图像;Performing channel shuffling on the channels of the first subconvolution image group and the second subconvolution image group in sequence to obtain shuffled feature images;
根据获取的特征图像的图像特征数据和混洗后的特征图像的图像特征数据,确定所述特征图像训练后的特征图像。According to the acquired image feature data of the feature image and the image feature data of the shuffled feature image, the feature image after the feature image training is determined.
本申请还提供一种基于残差网络的图像训练装置,包括:This application also provides an image training device based on residual network, including:
第一卷积单元,用于基于残差网络模型架构,对输入的特征图像进行卷积操作,获得卷积图像集合;The first convolution unit is used to perform a convolution operation on the input feature image based on the residual network model architecture to obtain a convolution image set;
拆分单元,用于拆分所述卷积图像集合,获得第一卷积图像组和第二卷积图像组;A splitting unit, configured to split the set of convolutional images to obtain a first convolutional image group and a second convolutional image group;
第二卷积单元,用于分别对所述第一卷积图像组和第二卷积图像组进行卷积操作,获得所述第一子卷积图像组和第二子卷积图像组;A second convolution unit, configured to perform a convolution operation on the first convolution image group and the second convolution image group to obtain the first subconvolution image group and the second subconvolution image group;
通道混洗单元,用于对所述第一子卷积图像组和第二子卷积图像组的通道顺序进行通道混洗,获得混洗后的特征图像;A channel shuffling unit, configured to sequentially perform channel shuffling on the channels of the first subconvolution image group and the second subconvolution image group to obtain a shuffled feature image;
确定单元,用于根据获取的特征图像的图像特征数据和混洗后的特征图像的图像特征数据,确定所述特征图像训练后的特征图像。The determining unit is configured to determine the characteristic image of the characteristic image after the training of the characteristic image according to the acquired image characteristic data of the characteristic image and the image characteristic data of the shuffled characteristic image.
本申请还提供一种神经网络的通道混洗方法,包括:This application also provides a channel shuffling method of neural network, including:
根据对输入到神经网络中的特征图像进行卷积操作,获得卷积图像集合;According to the convolution operation on the characteristic images input to the neural network, a convolution image set is obtained;
拆分所述卷积图像集合,获得第一卷积图像组和第二卷积图像组;Split the set of convolution images to obtain a first convolution image group and a second convolution image group;
分别对所述第一卷积图像组和第二卷积图像组进行卷积操作,获得所述第一子卷积图像组和第二子卷积图像组;Performing a convolution operation on the first convolution image group and the second convolution image group respectively to obtain the first subconvolution image group and the second subconvolution image group;
对所述第一子卷积图像组和第二子卷积图像组的通道顺序进行通道混洗。Channel shuffling is sequentially performed on the channels of the first subconvolution image group and the second subconvolution image group.
在一些实施例中,所述对所述第一子卷积图像组和第二子卷积图像组的通道顺序进行通道混洗,包括:In some embodiments, the performing channel shuffling sequentially on the channels of the first subconvolution image group and the second subconvolution image group includes:
对所述第一子卷积图像组和第二子卷积图像组进行拼接,获得拼接后的拼接特征图像集合;Splicing the first subconvolutional image group and the second subconvolutional image group to obtain a spliced feature image set;
对所述拼接特征图像集合进行通道混洗。Channel shuffling is performed on the spliced feature image set.
在一些实施例中,所述对对所述第一子卷积图像组和第二子卷积图像组进行拼接,获得拼接后的拼接特征图像集合,包括:In some embodiments, the splicing the first subconvolutional image group and the second subconvolutional image group to obtain the spliced feature image set includes:
按照通道排列顺序,将所述第二子卷积图像组中首位卷积图放到所述第一子卷积图像组中末尾卷积图之后,获得所述拼接特征图集合。According to the channel arrangement order, the first convolution map in the second subconvolution image group is placed after the last convolution map in the first subconvolution image group to obtain the spliced feature map set.
在一些实施例中,所述对所述拼接特征图像集合进行通道混洗,包括:In some embodiments, the performing channel shuffling on the mosaic feature image set includes:
按照设定的通道排列要求,对所述拼接特征图像集合重新排列。According to the set channel arrangement requirements, the splicing feature image set is rearranged.
本申请还提供一种神经网络的通道混洗装置,包括:This application also provides a neural network channel shuffling device, including:
第一卷积单元,用于根据对输入到神经网络中的特征图像进行卷积操作,获得卷积图像集合;The first convolution unit is configured to perform a convolution operation on the characteristic image input to the neural network to obtain a convolution image set;
拆分单元,用于拆分所述卷积图像集合,获得第一卷积图像组和第二卷积图像组;A splitting unit, configured to split the set of convolutional images to obtain a first convolutional image group and a second convolutional image group;
第二卷积单元,用于分别对所述第一卷积图像组和第二卷积图像组进行卷积操作,获得所述第一子卷积图像组和第二子卷积图像组;A second convolution unit, configured to perform a convolution operation on the first convolution image group and the second convolution image group to obtain the first subconvolution image group and the second subconvolution image group;
混洗单元,用于对所述第一子卷积图像组和第二子卷积图像组的通道顺序进行通道混洗。The shuffling unit is configured to sequentially perform channel shuffling on the channels of the first subconvolution image group and the second subconvolution image group.
本申请还提供一种神经网络架构,包括:This application also provides a neural network architecture, including:
第一卷积层,用于针对输入的特征图像进行卷积操作,获得卷积图像集合;The first convolution layer is used to perform a convolution operation on the input feature image to obtain a convolution image set;
拆分层,用于拆分所述第一卷积层卷积后的所述卷积图像集合,获得第一卷积图像组和第二卷积图像组;A split layer for splitting the set of convolution images convolved by the first convolution layer to obtain a first convolution image group and a second convolution image group;
第二卷积层,用于对所述拆分层拆分后的所述第一卷积图像组和第二卷积图像组分别进行卷积操作,获得所述第一子卷积图像组和第二子卷积图像组;The second convolution layer is used to perform convolution operations on the first convolution image group and the second convolution image group after the split layer is split to obtain the first subconvolution image group and The second sub-convolution image group;
混洗层,用于对所述第二卷积层卷积后的所述第一子卷积图像组和第二子卷积图像组的通道顺序进行通道混洗,获得混洗后的特征图像;The shuffling layer is used to perform channel shuffling on the channels of the first subconvolution image group and the second subconvolution image group convolved by the second convolution layer to obtain a shuffled feature image ;
计算层,用于根据输入到所述第一卷积层的特征图像的图像特征数据和混洗层混洗后的特征图像的图像特征数据,计算待输出的特征图像。The calculation layer is used to calculate the feature image to be output according to the image feature data of the feature image input to the first convolutional layer and the image feature data of the feature image shuffled by the shuffle layer.
本申请还提供一种计算机存储介质,用于存储网络平台产生数据,以及对应所述网络平台产生数据进行处理的程序;This application also provides a computer storage medium for storing data generated by a network platform and a program corresponding to the data generated by the network platform for processing;
所述程序在被读取执行时,执行如上所述的图像处理方法的步骤;或者执行如上所述的基于残差网络的图像训练方法的步骤;或者执行如上所述的神经网络的通道混洗方法。When the program is read and executed, it executes the steps of the image processing method as described above; or executes the steps of the image training method based on the residual network as described above; or executes the channel shuffling of the neural network as described above method.
本申请还一种电子设备,包括:This application also provides an electronic device, including:
处理器;processor;
存储器,用于存储对网络平台产生数据进行处理的程序,所述程序在被所述处理器读取执行时,执行如上所述的图像处理方法的步骤;或者执行如上所述的基于残差网络的图像训练方法的步骤;或者执行如上所述的神经网络的通道混洗方法。The memory is used to store a program for processing the data generated by the network platform. When the program is read and executed by the processor, it executes the steps of the image processing method as described above; or executes the residual network-based network as described above. The steps of the image training method; or the channel shuffling method of the neural network as described above.
与现有技术相比,本申请具有以下优点:Compared with the prior art, this application has the following advantages:
本申请提供的一种图像处理方法,通过对获取的特征图像进行卷积操作,获得卷积 图像集合;接着对所述卷积图像集合进行拆分,获得第一卷积图像组和第二卷积图像组;之后,分别对所述第一卷积图像组和第二卷积图像组进行卷积操作,获得所述第一子卷积图像组和第二子卷积图像组;最后,对所述第一子卷积图像组和第二子卷积图像组进行通道混洗,获得混洗后的特征图像。由于对卷积图像集合进行拆分处理,形成至少两个分支,即第一卷积图像组和第二卷积图像组,从而分散对特征图像处理的计算量,并且在最终输出特征图像前对第一子卷积图像组和第二子卷积图像组进行通道混洗,缩短处理过程从而减少图像特征数据的丢失,故能够提高最终输出特征图像的精度。An image processing method provided by the present application obtains a convolutional image set by performing a convolution operation on the acquired feature images; then splits the convolutional image set to obtain a first convolutional image group and a second convolution Convolution image group; afterwards, perform convolution operations on the first convolution image group and the second convolution image group to obtain the first subconvolution image group and the second subconvolution image group; finally, to The first sub-convolution image group and the second sub-convolution image group are channel shuffled to obtain shuffled feature images. Since the convolution image set is split, at least two branches are formed, namely the first convolution image group and the second convolution image group, so as to disperse the calculation amount of the feature image processing, and the final output of the feature image The first subconvolution image group and the second subconvolution image group perform channel shuffling, shorten the processing process and reduce the loss of image feature data, so the accuracy of the final output feature image can be improved.
附图说明Description of the drawings
图1是现有技术中轻量化网络的结构示意图;Figure 1 is a schematic diagram of the structure of a lightweight network in the prior art;
图2是本申请提供的一种图像处理方法实施例的流程图;Fig. 2 is a flowchart of an embodiment of an image processing method provided by the present application;
图3是本申请提供的一种图像处理装置实施例的结构示意图;FIG. 3 is a schematic structural diagram of an embodiment of an image processing device provided by the present application;
图4是本申请提供的一种基于残差网络的图像训练方法实施例的流程图;FIG. 4 is a flowchart of an embodiment of an image training method based on a residual network provided by the present application;
图5是本申请提供的一种基于残差网络的图像训练方法实施例中残差网络的结构示意图;FIG. 5 is a schematic structural diagram of a residual network in an embodiment of an image training method based on a residual network provided by the present application;
图6是本申请提供的一种基于残差网络的图像训练方法实施例中训练过程的示意图;FIG. 6 is a schematic diagram of a training process in an embodiment of an image training method based on a residual network provided by the present application;
图7是本申请提供的一种基于残差网络的图像训练装置实施例的结构示意图;FIG. 7 is a schematic structural diagram of an embodiment of an image training device based on a residual network provided by the present application;
图8是本申请提供的一种神经网络的通道混洗方法实施例的流程图;FIG. 8 is a flowchart of an embodiment of a channel shuffling method of a neural network provided by the present application;
图9是本申请提供的一种神经网络的通道混洗装置实施例的结构示意图。Fig. 9 is a schematic structural diagram of an embodiment of a neural network channel shuffling device provided by the present application.
具体实施方式Detailed ways
在下面的描述中阐述了很多具体细节以便于充分理解本申请。但是本申请能够以很多不同于在此描述的其它方式来实施,本领域技术人员可以在不违背本申请内涵的情况下做类似推广,因此本申请不受下面公开的具体实施的限制。In the following description, many specific details are set forth in order to fully understand this application. However, this application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar promotion without violating the connotation of this application. Therefore, this application is not limited by the specific implementation disclosed below.
本申请中使用的术语是仅仅出于对特定实施例描述的目的,而非旨在限制本申请。在本申请中和所附权利要求书中所使用的描述方式例如:“一种”、“第一”、和“第二”等,并非对数量上的限定或先后顺序上的限定,而是用来将同一类型的信息彼此区分。The terms used in this application are only for the purpose of describing specific embodiments, and are not intended to limit the application. The description methods used in this application and in the appended claims, such as "one", "first", and "second", etc., are not limited in quantity or sequence, but Used to distinguish the same type of information from each other.
为了能够更好的了解本申请提供的图像处理方法,先根据背景技术部分以及应用场景对本申请技术方案的产生背景进行说明。In order to better understand the image processing method provided by this application, the background of the technical solution of this application will be explained based on the background technology part and application scenarios.
根据上述背景技术中的描述可知,现有深层次的神经网络结构存在梯度消失,梯度爆炸和网络退化的问题,请结合图1理解梯度消失和梯度爆炸的问题。图1是现有技术中一种比较简单的深层网络示意图,该网络是一个四层的全连接网络,假设每一层网络激活后的输出为f i(x),其中i为第i层,x代表第i层的输入,也就是第i-1层的输出,f是激活函数,那么,得出f i+1=f(f i*w i+1+b i+1),记为:f i+1=f(f i*w i+1)。BP算法(BP算法是神经网络中基于梯度下降法的优化算法)基于梯度下降策略,以目标的负梯度方向对参数进行调整,参数更新为w=w+Δw,给定学习率α,得出
Figure PCTCN2020133972-appb-000001
如果要更新第二隐藏层的权值信息,根据链式求导法则,更新梯度信息为:
According to the description in the above background technology, the existing deep neural network structure has the problems of gradient disappearance, gradient explosion and network degradation. Please understand the problems of gradient disappearance and gradient explosion in conjunction with Figure 1. Figure 1 is a schematic diagram of a relatively simple deep network in the prior art. The network is a four-layer fully connected network. It is assumed that the output of each layer of the network after activation is f i (x), where i is the i-th layer, x represents the input of the i-th layer, that is, the output of the i-1th layer, and f is the activation function. Then, f i+1 = f(f i *w i+1 + b i+1 ), denoted as : F i+1 =f(f i *wi +1 ). BP algorithm (BP algorithm is an optimization algorithm based on gradient descent method in neural network) is based on gradient descent strategy, the parameters are adjusted in the negative gradient direction of the target, and the parameters are updated to w=w+Δw, given the learning rate α, obtain
Figure PCTCN2020133972-appb-000001
If you want to update the weight information of the second hidden layer, according to the chain derivation rule, the update gradient information is:
Figure PCTCN2020133972-appb-000002
Figure PCTCN2020133972-appb-000002
根据上述公式可以看出,
Figure PCTCN2020133972-appb-000003
即第二隐藏层的输入。因此,
Figure PCTCN2020133972-appb-000004
是对激活函数的求导,如果求导结果大于1,那么在网络层数增多的情况下,最终求出的梯度更新将以指数形式增加,即发生梯度爆炸,如果求导结果小于1,那么在网络层数增多的情况下,求出的梯度更新信息将会以指数形式衰减,即发生梯度消失。概括来说,所谓梯度消失指的是随着网络深度增加,参数的梯度范数指数式减小的现象。梯度很小,意味着参数的变化很缓慢,从而使得学习过程停滞,直到梯度变得足够大,而这通常需要指数量级的时间,从而导致在进行图像识别过程中耗时。
According to the above formula, it can be seen that
Figure PCTCN2020133972-appb-000003
That is, the input of the second hidden layer. therefore,
Figure PCTCN2020133972-appb-000004
It is the derivation of the activation function. If the derivation result is greater than 1, then when the number of network layers increases, the final gradient update will increase exponentially, that is, gradient explosion occurs. If the derivation result is less than 1, then When the number of network layers increases, the obtained gradient update information will decay exponentially, that is, the gradient disappears. In a nutshell, the so-called gradient disappearance refers to the phenomenon that the gradient norm of the parameter decreases exponentially as the network depth increases. The gradient is small, which means that the change of the parameters is very slow, which makes the learning process stagnate until the gradient becomes large enough, which usually takes an order of magnitude of time, which leads to time-consuming in the image recognition process.
对于网络退化的问题主要是指,随着网络深度的增加会出现大量冗余的层次,该些冗余的层次会造成输入与输出之间的差异,进而导致网络退化,从而导致对图像的识别处理精度或准确度降低。The problem of network degradation mainly means that as the network depth increases, a large number of redundant layers will appear. These redundant layers will cause the difference between input and output, which will lead to network degradation, which leads to image recognition. The processing precision or accuracy is reduced.
基于上述由于网络深度的增加而带来的弊端,现有技术提供一种轻量级的网络,该网络采用残差网络结构,从而避免梯度消失(爆炸)问题和网络退化问题。但是,该轻量级网络由于在网络末端输出后对数据进行通道混洗工作,从而导致计算量较大,并且该轻量级网络也仍然存在图像处理的精度差的问题。Based on the above-mentioned disadvantages caused by the increase in network depth, the prior art provides a lightweight network that adopts a residual network structure, thereby avoiding the problem of vanishing gradient (explosion) and network degradation. However, the lightweight network performs channel shuffling work on the data after the end of the network is output, resulting in a large amount of calculation, and the lightweight network still has the problem of poor image processing accuracy.
基于上述内容,本申请提供的一种图像处理方法,该方法能够降低计算量的同时提高图像处理的精度。Based on the foregoing content, the present application provides an image processing method, which can reduce the amount of calculation and improve the accuracy of image processing.
请参考图2所示,图2是本申请提供的一种图像处理方法实施例的流程图,该方法包括:Please refer to FIG. 2. FIG. 2 is a flowchart of an embodiment of an image processing method provided by the present application. The method includes:
步骤S201:对获取的特征图像进行卷积操作,获得卷积图像集合;Step S201: Perform a convolution operation on the acquired feature images to obtain a set of convolution images;
所述步骤S201的目的在于对特征图像进行升维操作。具体实现过程可以是获取的特 征图像可以是将通过神经网络的输入端输入的特征图像作为获取的特征图像。对所述特征图像进行卷积操作获得多个卷积后的卷积图像,该些卷积图像构成卷积图像集合。在本实施例中,该步骤S201中的卷积操作可以采用1×1的卷积核对特征图像进行卷积操作,从而获得多个卷积图。The purpose of the step S201 is to perform a dimension upgrade operation on the feature image. The specific implementation process may be that the acquired characteristic image may be the characteristic image input through the input terminal of the neural network as the acquired characteristic image. A convolution operation is performed on the feature image to obtain a plurality of convolution images after convolution, and the convolution images constitute a convolution image set. In this embodiment, the convolution operation in step S201 may use a 1×1 convolution kernel to perform a convolution operation on the feature image, so as to obtain multiple convolution maps.
其中,获取的特征图像也可以是多个,对多个特征图像卷积操作后获得多个卷积图,该些卷积图中可以包括新的图像特征数据。需要说明的是,新的图像特征数据来源于所述获取的特征图像。此处主要是针对卷积操作后的图像特征数据与卷积操作前的图像特征数据的区别而言。Wherein, the acquired feature images may also be multiple, and multiple convolution maps are obtained after convolution operations on the multiple feature images, and these convolution maps may include new image feature data. It should be noted that the new image feature data is derived from the acquired feature image. This is mainly for the difference between the image feature data after the convolution operation and the image feature data before the convolution operation.
步骤S202:拆分所述卷积图像集合,获得第一卷积图像组和第二卷积图像组;Step S202: Split the convolution image set to obtain a first convolution image group and a second convolution image group;
所述步骤S202的目的在于,将卷积图像集合分成至少两个支路,以便后续处理过程中能够降低计算量。The purpose of the step S202 is to divide the convolutional image set into at least two branches, so that the amount of calculation can be reduced in the subsequent processing.
在本实施例中,所述步骤S202的拆分过程可以采用一分为二的拆分方式,将卷积图像集合拆分成至少两部分,进而可以获得第一卷积图像组合第二卷积图像组。在本实施例中,拆分要求可以设定为一分为二,具体可以是针对卷积图像集合通道总数的一半进行拆分,即从卷积图像集合的中间分成两部分。当然,拆分数量还可以是三部分等。换言之,拆分后的卷积图像集合包括:n组卷积图像组。In this embodiment, the splitting process of step S202 may adopt a splitting method of one-to-two to split the convolutional image set into at least two parts, so that the first convolutional image combined with the second convolution can be obtained. Image group. In this embodiment, the splitting requirement can be set to be divided into two. Specifically, it can be split for half of the total number of channels of the convolutional image collection, that is, split into two parts from the middle of the convolutional image collection. Of course, the number of splits can also be three parts, etc. In other words, the split convolutional image set includes: n groups of convolutional image groups.
由于通道数量存在多种情况,例如:偶数和奇数,因此,在本实施例中对卷积图像集合的拆分可以分为两种情况进行,具体如下:Since there are many situations for the number of channels, for example, even and odd, the splitting of the convolutional image set in this embodiment can be divided into two situations, and the details are as follows:
若所述通道数量为偶数,则按照通道排列顺序,将所述卷积图像集合拆分成通道数量相同的第一卷积图像组合和第二卷积图像组;即:第一卷积图像组为1,2,3,…,(1/2)k;第二卷积图像组为
Figure PCTCN2020133972-appb-000005
其中,k为卷积图像集合中卷积图的总数。
If the number of channels is an even number, according to the channel arrangement order, the convolution image set is split into a first convolution image combination and a second convolution image group with the same number of channels; that is, the first convolution image group Is 1,2,3,...,(1/2)k; the second convolution image group is
Figure PCTCN2020133972-appb-000005
Among them, k is the total number of convolutional images in the convolutional image collection.
若所述通道数量为奇数,则选取所述通道数量的一半并取整数;If the number of channels is an odd number, select half of the number of channels and take an integer;
按照通道排列顺序,将相邻且大于所述整数的通道对应的卷积图像作为第一卷积图像组的末尾特征图像,第二卷积图像组的首位卷积图像为与所述第一卷积图像组的末尾卷积图像相邻的卷积图像,将相邻且大于所述末尾卷积图像通道的卷积图像作为第二卷积图像组的首位卷积图像。即:第一卷积图像组的末尾卷积图像为
Figure PCTCN2020133972-appb-000006
第二卷积图像组的首位卷积图像为
Figure PCTCN2020133972-appb-000007
According to the order of the channel arrangement, the convolution image corresponding to the adjacent channel greater than the integer is taken as the last feature image of the first convolution image group, and the first convolution image of the second convolution image group is the same as the first convolution image The convolution image adjacent to the last convolution image of the convolution image group, and the convolution image that is adjacent and larger than the last convolution image channel is taken as the first convolution image of the second convolution image group. That is: the last convolution image of the first convolution image group is
Figure PCTCN2020133972-appb-000006
The first convolution image of the second convolution image group is
Figure PCTCN2020133972-appb-000007
在本实施例中,主要采用一分为二的拆分方式对所述卷积图像结合进行拆分,即平均分为两部分。当然也可以按照通道数的奇偶分,即根据对通道数量的顺序排列,将通 道数为奇数的分为一组,通道数量为偶数的分为一组。当然也可以分为多组,拆分方式不限上述。In this embodiment, the convolutional image combination is mainly split into two parts by splitting into two, that is, the convolution image is divided into two parts evenly. Of course, it is also possible to divide the number of channels according to the odd and even number, that is, according to the order of the number of channels, the odd number of channels is divided into one group, and the number of even channels is divided into one group. Of course, it can also be divided into multiple groups, and the splitting method is not limited to the above.
基于上述对卷积图像集合拆分后,还需要对拆分后的第一卷积图像组合第二卷积图像组再次进行卷积操作,进而进入步骤S203。After splitting the convolution image set based on the foregoing, it is also necessary to perform the convolution operation again on the split first convolution image and the second convolution image group, and then proceed to step S203.
步骤S203:分别对所述第一卷积图像组和第二卷积图像组进行卷积操作,获得所述第一子卷积图像组和第二子卷积图像组;Step S203: Perform a convolution operation on the first convolution image group and the second convolution image group respectively to obtain the first subconvolution image group and the second subconvolution image group;
所述步骤S203的目的在于,通过分别对第一卷积图像组和第二卷积图像组进行卷积操作,从而降低计算量。The purpose of the step S203 is to reduce the amount of calculation by performing a convolution operation on the first convolution image group and the second convolution image group respectively.
在本实施例中,对第一卷积图像组和第二卷积图像组可以采用相同的卷积核进行卷积操作,例如:均采用5×5的卷积核进行卷积操作,进而得到对应于第一卷积图像组的第一子卷积图像组,以及对应所述第二卷积图像组的第二子卷积图像组。In this embodiment, the same convolution kernel can be used for the convolution operation for the first convolution image group and the second convolution image group, for example: both 5×5 convolution kernels are used for the convolution operation, and then obtain A first subconvolution image group corresponding to the first convolution image group, and a second subconvolution image group corresponding to the second convolution image group.
可以理解的是,对第一卷积图像组和第二卷积图像组可以采用不同的卷积核进行卷积操作,例如:对第一卷积图像组采用3×3的卷积核进行卷积操作,对第二卷积图像组采用5×5的卷积核进行卷积操作。It is understandable that different convolution kernels can be used for the first convolution image group and the second convolution image group to perform convolution operations, for example, a 3×3 convolution kernel is used for the first convolution image group. Convolution operation, using a 5×5 convolution kernel to perform a convolution operation on the second convolution image group.
上述对第一卷积图像组和第二卷积图像组所采用的卷积核的大小并不限于上述3×3和5×5,还可以采用其他大小的卷积核,例如:7×7,在本实施例中,采用5×5的卷积核。The size of the convolution kernel used for the first convolution image group and the second convolution image group is not limited to the above 3×3 and 5×5, and convolution kernels of other sizes may also be used, for example: 7×7 In this embodiment, a 5×5 convolution kernel is used.
所述卷积核的大小可以预先设定,也可以根据第一卷积图像组和第二卷积图像组的图像特征数据量进行调整,例如:如果预先设定的卷积核大小为5×5,那么可以根据第一卷积图像组的图像特征数据的情况,将卷积核大小调整为3×3或者7×7,同样地,对所述第二卷积图像组进行卷积时,卷积核的大小也可以进行调整。就是说,在对第一卷积图像组和第二卷积图像组中的任意一个卷积图像组进行卷积操作时,可以随时调整卷积核的大小,已达到更有的卷积操作。The size of the convolution kernel can be preset or adjusted according to the image feature data amount of the first convolution image group and the second convolution image group. For example, if the preset convolution kernel size is 5× 5. Then the size of the convolution kernel can be adjusted to 3×3 or 7×7 according to the image feature data of the first convolution image group. Similarly, when convolving the second convolution image group, The size of the convolution kernel can also be adjusted. In other words, when performing a convolution operation on any one of the first convolution image group and the second convolution image group, the size of the convolution kernel can be adjusted at any time, and more convolution operations have been achieved.
基于上述内容,在对第一卷积图像组和第二卷积图像组进行卷积操作后,会对应所述第一卷积图像组和第二卷积图像组分别生成多个卷积后的子卷积图像。具体卷积过程属于现有技术,大概为将5×5的卷积核作为滤波器在每个卷积图像上滑动,将对应位置进行相乘求和的计算,进而得到针对卷积图像组中每个卷积图像的子卷积图像。由于本实施例中,将获取的特征图像拆分成至少两条支路,并分别对两条支路进行卷积操作,进而能够将对特征图像的计算分散为两个,即对两个50%的特征图像进行卷积操作,从而使得计算量相比拆分前的计算量降低了50%。Based on the above content, after performing a convolution operation on the first convolution image group and the second convolution image group, a plurality of convolutional images will be generated corresponding to the first convolution image group and the second convolution image group. Subconvolution image. The specific convolution process belongs to the prior art. It is roughly that the 5×5 convolution kernel is used as a filter to slide on each convolution image, and the corresponding position is multiplied and summed to obtain the convolution image group. The sub-convolution image of each convolution image. Since in this embodiment, the acquired feature image is split into at least two branches, and the convolution operation is performed on the two branches respectively, the calculation of the feature image can be dispersed into two, that is, the calculation of the feature image can be divided into two. % Feature images are convolved, which reduces the amount of calculation by 50% compared to the amount of calculation before splitting.
在针对第一卷积图像组和第二卷积图像组进行卷积操作后,需要获得的第一子卷积图像组和第二子卷积图像组还原成拆分前的结构,因此,进入步骤S204。After the convolution operation is performed on the first convolution image group and the second convolution image group, the first subconvolution image group and the second subconvolution image group that need to be obtained are restored to the structure before the split, so enter Step S204.
步骤S204:对所述第一子卷积图像组和第二子卷积图像组的通道顺序进行通道混洗,获得混洗后的特征图像。Step S204: performing channel shuffling on the channels of the first subconvolution image group and the second subconvolution image group in sequence to obtain shuffled feature images.
所述步骤S204的目的在于,将针对拆分支路上的卷积图像进行卷积后获得的子卷积图像组还原成拆分前的结构。其中,所述通道混洗可以理解为:在神经网络生成的特征图中打乱原有的通道叠放顺序的过程。所述混洗后的特征图像即为通道顺序重新排列过的特征图像。所述步骤S204的具体实现过程可以包括:The purpose of the step S204 is to restore the sub-convolutional image group obtained after convolution on the convolutional image on the split branch road to the structure before splitting. Wherein, the channel shuffling can be understood as: the process of disrupting the original channel stacking sequence in the feature map generated by the neural network. The shuffled feature image is the feature image with the channel sequence rearranged. The specific implementation process of step S204 may include:
步骤S204-1:对所述第一子卷积图像组和第二子卷积图像组进行拼接,获得拼接后的拼接特征图像集合;Step S204-1: splicing the first subconvolution image group and the second subconvolution image group to obtain a spliced feature image set;
步骤S204-2:对所述拼接特征图像集合进行通道混洗,获得所述混洗后的特征图像。Step S204-2: Perform channel shuffling on the spliced feature image set to obtain the shuffled feature image.
其中,步骤S204-1中的拼接可以理解为合并,即将第一子卷积图像组和第二子卷积图像组进行合并,使二者形成子卷积图像集合。具体拼接可以包括:Wherein, the splicing in step S204-1 can be understood as merging, that is, merging the first subconvolution image group and the second subconvolution image group, so that the two form a subconvolution image set. Specific splicing can include:
按照通道排列顺序,将所述第二子卷积图像组中首位卷积图放到所述第一子卷积图像组中末尾卷积图之后,获得所述拼接特征图像集合。换言之,第一子卷积图像组和第二子卷积图像组的拼接可以参考上述拆分过程,即在一分为二的拆分方式下,拼接可以将第一子卷积图像组的末位和第二子卷积图像组的首位拼接,形成子卷积图像组集合。例如:第一子卷积图像组为K1,K2,K3,K4;第二子卷积图像组为P1,P2,P3,P4;那么,拼接之后为K1,K2,K3,K4,P1,P2,P3,P4。According to the order of the channel arrangement, the first convolution map in the second subconvolution image group is placed after the last convolution map in the first subconvolution image group to obtain the mosaic feature image set. In other words, the splicing of the first subconvolutional image group and the second subconvolutional image group can refer to the above-mentioned splitting process. The bit and the first bit of the second subconvolution image group are spliced to form a subconvolution image group set. For example: the first subconvolution image group is K1, K2, K3, K4; the second subconvolution image group is P1, P2, P3, P4; then, after stitching, it is K1, K2, K3, K4, P1, P2 , P3, P4.
为保证通道组之间的图像特征信息流通,提高图像特征信息表示能力,需要对所述步骤S204-1拼接后的拼接特征图像集合进行通道混洗,因此,所述步骤S204-2的具体实现过程可以包括:In order to ensure the flow of image feature information between channel groups and improve the ability to express image feature information, it is necessary to perform channel shuffling on the spliced feature image set after the step S204-1 is spliced. Therefore, the specific implementation of the step S204-2 The process can include:
按照设定的通道排列要求,对所述拼接特征图像集合重新排列,获得混洗后的特征图像。沿用上述在步骤S204-1中的举例,拼接之后为K1,K2,K3,K4,P1,P2,P3,P4的拼接特征图像集合进行混洗,如果通道排列要求为1,
Figure PCTCN2020133972-appb-000008
则重新排列后为K1,P1,K2,P2,K3,P3,K4,P4。
According to the set channel arrangement requirements, rearrange the spliced feature image set to obtain shuffled feature images. Following the above example in step S204-1, after splicing, the spliced feature image set of K1, K2, K3, K4, P1, P2, P3, P4 is shuffled. If the channel arrangement requirement is 1,
Figure PCTCN2020133972-appb-000008
After rearrangement, they are K1, P1, K2, P2, K3, P3, K4, P4.
基于上述内容可以获得针对获取的特征图像的处理结果,即:混洗后的特征图像,在获得混洗后的特征图像后,还可以包括:Based on the above content, the processing result for the acquired feature image can be obtained, that is, the shuffled feature image. After the shuffled feature image is obtained, it may also include:
根据获取的特征图像的图像特征数据和混洗后的特征图像的图像特征数据,确定输出的特征图像。具体地,可以将所述特征图像的图像特征数据和混洗后的特征图像的图 像特征数据进行逐图像特征数据相加,确定输出的特征图像。According to the acquired image feature data of the feature image and the image feature data of the shuffled feature image, the output feature image is determined. Specifically, the image feature data of the feature image and the image feature data of the shuffled feature image may be added image by image feature data to determine the output feature image.
由于本实施例中对图像的处理进行拆分处理,形成至少两个分支,从而分散对特征图像处理的计算量,并且在最终输出特征图像前对第一子卷积图像组和第二子卷积图像组进行通道混洗,缩短处理过程从而减少图像特征数据的丢失,故能够提高最终输出特征图像的精度。Since the image processing is split in this embodiment to form at least two branches, the calculation amount of the feature image processing is dispersed, and the first sub-convolutional image group and the second sub-convolution are performed before the final output of the feature image. The product image group performs channel shuffling to shorten the processing process and reduce the loss of image feature data, so the accuracy of the final output feature image can be improved.
本申请实施例提供的图像处理方法,可以应用于行人检测,行人姿态估计,车辆检测、飞机检测、船只检测、物流车检测、无人机检测,安全行驶估计、飞行姿态估计,工厂、机坪、工程场地、大型活动、演唱会等的安全工作监控等应用场景,使得在该些应用场景下,输出的图像检测结果在减少检测计算量的同时,能够保证图像检测结果精度的准确性。The image processing method provided by the embodiments of this application can be applied to pedestrian detection, pedestrian attitude estimation, vehicle detection, aircraft detection, ship detection, logistics vehicle detection, drone detection, safe driving estimation, flight attitude estimation, factories, aprons , Engineering sites, large-scale events, concerts, and other application scenarios such as safety work monitoring, so that in these application scenarios, the output image detection results can reduce the amount of detection calculations while ensuring the accuracy of the accuracy of the image detection results.
以上是对本申请提供的一种图像处理方法实施例的详细描述,与前述提供的一种图像处理方法实施例相对应,本申请还公开一种图像处理装置实施例,请参看图3,由于装置实施例基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。下述描述的装置实施例仅仅是示意性的。The above is a detailed description of an embodiment of an image processing method provided by this application. Corresponding to the embodiment of an image processing method provided above, this application also discloses an embodiment of an image processing device. Please refer to FIG. 3, because the device The embodiment is basically similar to the method embodiment, so the description is relatively simple, and the relevant part can refer to the part of the description of the method embodiment. The device embodiments described below are merely illustrative.
请参考图3所示,图3是本申请提供的一种图像处理装置实施例的结构示意图。该装置包括:Please refer to FIG. 3, which is a schematic structural diagram of an embodiment of an image processing apparatus provided by the present application. The device includes:
第一卷积单元301,用于对获取的特征图像进行卷积操作,获得卷积图像集合;The first convolution unit 301 is configured to perform a convolution operation on the acquired feature images to obtain a convolution image set;
所述第一卷积单元301的目的在于:对特征图像进行升维操作。具体实现过程可以是获取的特征图像可以是将通过神经网络的输入端输入的特征图像作为获取的特征图像。对所述特征图像进行卷积操作获得多个卷积后的卷积图像,该些卷积图像构成卷积图像集合。在本实施例中,卷积操作可以采用1×1的卷积核对特征图像进行卷积操作,从而获得多个卷积图。The purpose of the first convolution unit 301 is to perform a dimension-upgrading operation on the feature image. The specific implementation process may be that the acquired characteristic image may be the characteristic image input through the input terminal of the neural network as the acquired characteristic image. A convolution operation is performed on the feature image to obtain a plurality of convolution images after convolution, and the convolution images constitute a convolution image set. In this embodiment, the convolution operation may use a 1×1 convolution kernel to perform a convolution operation on the feature image, so as to obtain multiple convolution maps.
其中,获取的特征图像也可以是多个,对多个特征图像卷积操作后获得多个卷积图,该些卷积图中可以包括新的图像特征数据。Wherein, the acquired feature images may also be multiple, and multiple convolution maps are obtained after convolution operations on the multiple feature images, and these convolution maps may include new image feature data.
拆分单元302,用于拆分所述卷积图像集合,获得第一卷积图像组和第二卷积图像组;The splitting unit 302 is configured to split the set of convolutional images to obtain a first convolutional image group and a second convolutional image group;
所述拆分单元目的在于,将所述第一卷积单元301中的卷积图像集合分成至少两个支路,以便后续处理过程中能够降低计算量,即分别对两个支路的卷积图组进行卷积计算,进而分散计算量。The purpose of the splitting unit is to divide the convolution image set in the first convolution unit 301 into at least two branches, so that the amount of calculation can be reduced in the subsequent processing, that is, the convolution of the two branches respectively The graph group performs convolution calculation, and then disperses the calculation amount.
在本实施例中,拆分过程可以采用一分为二的拆分方式,将卷积图像集合拆分成至 少两部分,进而可以获得第一卷积图像组合第二卷积图像组。在本实施例中,拆分要求可以设定为一分为二,具体可以是针对卷积图像集合通道总数的一半进行拆分,即从卷积图像集合的中间分成两部分。当然,拆分数量还可以是三部分等。换言之,拆分后的卷积图像集合包括:n组卷积图像组。In this embodiment, the splitting process may adopt a splitting method of one-to-two splits to split the convolutional image set into at least two parts, so that the first convolutional image combined with the second convolutional image group can be obtained. In this embodiment, the splitting requirement can be set to be divided into two. Specifically, it can be split for half of the total number of channels of the convolutional image collection, that is, split into two parts from the middle of the convolutional image collection. Of course, the number of splits can also be three parts, etc. In other words, the split convolutional image set includes: n groups of convolutional image groups.
由于通道数量存在多种情况,例如:偶数和奇数,因此,在本实施例中对卷积图像集合的拆分可以分为两种情况进行,具体如下:Since there are many situations for the number of channels, for example, even and odd, the splitting of the convolutional image set in this embodiment can be divided into two situations, and the details are as follows:
若所述通道数量为偶数,则按照通道排列顺序,将所述卷积图像集合拆分成通道数量相同的第一卷积图像组合和第二卷积图像组;即:第一卷积图像组为1,2,3,…,(1/2)k;第二卷积图像组为
Figure PCTCN2020133972-appb-000009
其中,k为卷积图像集合中卷积图的总数。
If the number of channels is an even number, according to the channel arrangement order, the convolution image set is split into a first convolution image combination and a second convolution image group with the same number of channels; that is, the first convolution image group Is 1,2,3,...,(1/2)k; the second convolution image group is
Figure PCTCN2020133972-appb-000009
Among them, k is the total number of convolutional images in the convolutional image collection.
若所述通道数量为奇数,则选取所述通道数量的一半并取整数;If the number of channels is an odd number, select half of the number of channels and take an integer;
按照通道排列顺序,将相邻且大于所述整数的通道对应的卷积图像作为第一卷积图像组的末尾特征图像,第二卷积图像组的首位卷积图像为与所述第一卷积图像组的末尾卷积图像相邻的卷积图像,将相邻且大于所述末尾卷积图像通道的卷积图像作为第二卷积图像组的首位卷积图像。即:第一卷积图像组的末尾卷积图像为
Figure PCTCN2020133972-appb-000010
第二卷积图像组的首位卷积图像为
Figure PCTCN2020133972-appb-000011
According to the order of the channel arrangement, the convolution image corresponding to the channel adjacent and larger than the integer is taken as the last feature image of the first convolution image group, and the first convolution image of the second convolution image group is the same as the first convolution image. The convolution image adjacent to the last convolution image of the convolution image group, and the convolution image that is adjacent and larger than the last convolution image channel is used as the first convolution image of the second convolution image group. That is: the last convolution image of the first convolution image group is
Figure PCTCN2020133972-appb-000010
The first convolution image of the second convolution image group is
Figure PCTCN2020133972-appb-000011
在本实施例中,主要采用一分为二的拆分方式对所述卷积图像结合进行拆分,即平均分为两部分。当然也可以按照通道数的奇偶分,即根据对通道数量的顺序排列,将通道数为奇数的分为一组,通道数量为偶数的分为一组。当然也可以分为多组,拆分方式不限上述。In this embodiment, the convolutional image combination is mainly split into two parts by splitting into two, that is, the convolution image is divided into two parts evenly. Of course, according to the odd and even division of the number of channels, that is, according to the order of the number of channels, the odd number of channels is divided into one group, and the number of even channels is divided into one group. Of course, it can also be divided into multiple groups, and the splitting method is not limited to the above.
第二卷积单元303,用于分别对所述第一卷积图像组和第二卷积图像组进行卷积操作,获得所述第一子卷积图像组和第二子卷积图像组;The second convolution unit 303 is configured to perform a convolution operation on the first convolution image group and the second convolution image group respectively to obtain the first subconvolution image group and the second subconvolution image group;
所述第二卷积单元303的目的在于,通过分别对第一卷积图像组和第二卷积图像组进行卷积操作,从而降低计算量。The purpose of the second convolution unit 303 is to reduce the amount of calculation by performing convolution operations on the first convolution image group and the second convolution image group respectively.
在本实施例中,对第一卷积图像组和第二卷积图像组可以采用相同的卷积核进行卷积操作,例如:均采用5×5的卷积核进行卷积操作,进而得到对应于第一卷积图像组的第一子卷积图像组,以及对应所述第二卷积图像组的第二子卷积图像组。In this embodiment, the same convolution kernel can be used for the convolution operation for the first convolution image group and the second convolution image group, for example: both 5×5 convolution kernels are used for the convolution operation, and then obtain A first subconvolution image group corresponding to the first convolution image group, and a second subconvolution image group corresponding to the second convolution image group.
可以理解的是,对第一卷积图像组和第二卷积图像组可以采用不同的卷积核进行卷积操作,例如:对第一卷积图像组采用3×3的卷积核进行卷积操作,对第二卷积图像组采用5×5的卷积核进行卷积操作。It is understandable that different convolution kernels can be used for the first convolution image group and the second convolution image group to perform convolution operations, for example, a 3×3 convolution kernel is used for the first convolution image group. Convolution operation, using a 5×5 convolution kernel to perform a convolution operation on the second convolution image group.
上述对第一卷积图像组和第二卷积图像组所采用的卷积核的大小并不限于上述3×3和5×5,还可以采用其他大小的卷积核,例如:7×7,在本实施例中,采用5×5的卷积核。The size of the convolution kernel used for the first convolution image group and the second convolution image group is not limited to the above 3×3 and 5×5, and convolution kernels of other sizes may also be used, for example: 7×7 In this embodiment, a 5×5 convolution kernel is used.
所述卷积核的大小可以预先设定,也可以根据第一卷积图像组和第二卷积图像组的图像特征数据量进行调整,例如:如果预先设定的卷积核大小为5×5,那么可以根据第一卷积图像组的图像特征数据的情况,将卷积核大小调整为3×3或者7×7,同样地,对所述第二卷积图像组进行卷积时,卷积核的大小也可以进行调整。就是说,在对第一卷积图像组和第二卷积图像组中的任意一个卷积图像组进行卷积操作时,可以随时调整卷积核的大小,已达到更有的卷积操作。The size of the convolution kernel can be preset or adjusted according to the image feature data amount of the first convolution image group and the second convolution image group. For example, if the preset convolution kernel size is 5× 5. Then the size of the convolution kernel can be adjusted to 3×3 or 7×7 according to the image feature data of the first convolution image group. Similarly, when convolving the second convolution image group, The size of the convolution kernel can also be adjusted. In other words, when performing a convolution operation on any one of the first convolution image group and the second convolution image group, the size of the convolution kernel can be adjusted at any time, and more convolution operations have been achieved.
基于上述内容,在对第一卷积图像组和第二卷积图像组进行卷积操作后,会对应所述第一卷积图像组和第二卷积图像组分别生成多个卷积后的子卷积图像。具体卷积过程属于现有技术,大概为将5×5的卷积核作为滤波器在每个卷积图像上滑动,将对应位置进行相乘求和的计算,进而得到针对卷积图像组中每个卷积图像的子卷积图像。由于本实施例中,将获取的特征图像拆分成至少两条支路,并分别对两条支路进行卷积操作,进而能够将对特征图像的计算分散为两个,即对两个50%的特征图像进行卷积操作,从而使得计算量相比拆分前的计算量降低了50%。Based on the above content, after performing a convolution operation on the first convolution image group and the second convolution image group, a plurality of convolutional images will be generated corresponding to the first convolution image group and the second convolution image group. Subconvolution image. The specific convolution process belongs to the prior art. It is roughly that the 5×5 convolution kernel is used as a filter to slide on each convolution image, and the corresponding position is multiplied and summed to obtain the convolution image group. The sub-convolution image of each convolution image. Since in this embodiment, the acquired feature image is split into at least two branches, and the convolution operation is performed on the two branches respectively, the calculation of the feature image can be dispersed into two, that is, the calculation of the feature image can be divided into two. % Feature images are convolved, which reduces the amount of calculation by 50% compared to the amount of calculation before splitting.
通道混洗单元304,用于对所述第一子卷积图像组和第二子卷积图像组进行通道混洗,获得混洗后的特征图像。The channel shuffling unit 304 is configured to perform channel shuffling on the first subconvolution image group and the second subconvolution image group to obtain shuffled feature images.
所述通道混洗单元304的目的在于,将针对拆分支路上的卷积图像进行卷积后获得的子卷积图像组还原成拆分前的结构。具体实现过程可以包括:The purpose of the channel shuffling unit 304 is to restore the sub-convolutional image group obtained after convolution on the convolutional image on the split branch road to the structure before splitting. The specific implementation process can include:
拼接子单元,用于对所述第一子卷积图像组和第二子卷积图像组进行拼接,获得拼接后的拼接特征图像集合;A splicing subunit for splicing the first subconvolution image group and the second subconvolution image group to obtain a spliced feature image set after splicing;
混洗子单元,用于对所述拼接子单元中获得拼接特征图像集合进行通道混洗,获得所述混洗后的特征图像。The shuffling subunit is used to perform channel shuffling on the spliced feature image set obtained in the splicing subunit to obtain the shuffled feature image.
其中,所述拼接子单元中的拼接可以理解为合并,即将第一子卷积图像组和第二子卷积图像组进行合并,使二者形成子卷积图像集合。具体拼接可以包括:Wherein, the splicing in the splicing subunit can be understood as merging, that is, the first subconvolution image group and the second subconvolution image group are merged, so that the two form a subconvolution image set. Specific splicing can include:
按照通道排列顺序,将所述第二子卷积图像组中首位卷积图放到所述第一子卷积图像组中末尾卷积图之后,获得所述拼接特征图像集合。换言之,第一子卷积图像组和第二子卷积图像组的拼接可以参考上述拆分过程,即在一分为二的拆分方式下,拼接可以将第一子卷积图像组的末位和第二子卷积图像组的首位拼接,形成子卷积图像组集合。 例如:第一子卷积图像组为K1,K2,K3,K4;第二子卷积图像组为P1,P2,P3,P4;那么,拼接之后为K1,K2,K3,K4,P1,P2,P3,P4。According to the channel arrangement order, the first convolution map in the second subconvolution image group is placed after the last convolution map in the first subconvolution image group to obtain the mosaic feature image set. In other words, the splicing of the first subconvolutional image group and the second subconvolutional image group can refer to the above-mentioned splitting process. The bit and the first bit of the second subconvolution image group are spliced to form a subconvolution image group set. For example: the first subconvolution image group is K1, K2, K3, K4; the second subconvolution image group is P1, P2, P3, P4; then, after stitching, it is K1, K2, K3, K4, P1, P2 , P3, P4.
为保证通道组之间的图像特征信息流通,提高图像特征信息表示能力,需要对所述拼接子单元拼接后的拼接特征图像集合进行通道混洗,因此,所述混洗子单元的具体实现过程可以包括:In order to ensure the circulation of image feature information between channel groups and improve the ability to express image feature information, it is necessary to perform channel shuffling on the spliced feature image set after the splicing subunits are spliced. Therefore, the specific implementation process of the shuffling subunit Can include:
按照设定的通道排列要求,对所述拼接特征图像集合重新排列,获得混洗后的特征图像。沿用上述在所述拼接子单元中的举例,拼接之后为K1,K2,K3,K4,P1,P2,P3,P4的拼接特征图像集合进行混洗,如果通道排列要求为1,
Figure PCTCN2020133972-appb-000012
Figure PCTCN2020133972-appb-000013
则重新排列后为K1,P1,K2,P2,K3,P3,K4,P4。
According to the set channel arrangement requirements, rearrange the spliced feature image set to obtain shuffled feature images. Following the above example in the splicing subunit, after splicing, the spliced feature image set of K1, K2, K3, K4, P1, P2, P3, P4 is shuffled. If the channel arrangement requirement is 1,
Figure PCTCN2020133972-appb-000012
Figure PCTCN2020133972-appb-000013
After rearrangement, they are K1, P1, K2, P2, K3, P3, K4, P4.
基于上述内容可以获得针对获取的特征图像的处理结果,即:混洗后的特征图像,在获得混洗后的特征图像后,还可以包括:Based on the above content, the processing result for the acquired feature image can be obtained, that is, the shuffled feature image. After the shuffled feature image is obtained, it may also include:
根据获取的特征图像的图像特征数据和混洗后的特征图像的图像特征数据,确定输出的特征图像。具体地,可以将所述特征图像的图像特征数据和混洗后的特征图像的图像特征数据进行逐图像特征数据相加,确定输出的特征图像。According to the acquired image feature data of the feature image and the image feature data of the shuffled feature image, the output feature image is determined. Specifically, the image feature data of the feature image and the image feature data of the shuffled feature image may be added image by image feature data to determine the output feature image.
由于本实施例中对图像的处理进行拆分处理,形成至少两个分支,从而分散对特征图像处理的计算量,并且在最终输出特征图像前对第一子卷积图像组和第二子卷积图像组进行通道混洗,缩短处理过程进而减少图像特征数据的丢失,从而提高最终输出特征图像的精度。Since the image processing is split in this embodiment to form at least two branches, the calculation amount of the feature image processing is dispersed, and the first sub-convolutional image group and the second sub-convolution are performed before the final output of the feature image. The product image group performs channel shuffling to shorten the processing process and reduce the loss of image feature data, thereby improving the accuracy of the final output feature image.
基于上述内容,请参考图4所示,图4是本申请还提供一种基于残差网络的图像训练方法实施例的流程图,该训练方法包括:Based on the above content, please refer to FIG. 4. FIG. 4 is a flowchart of an embodiment of an image training method based on a residual network provided by the present application. The training method includes:
步骤S401:基于残差网络模型架构,对输入的特征图像进行卷积操作,获得卷积图像集合;Step S401: Based on the residual network model architecture, perform a convolution operation on the input feature image to obtain a convolution image set;
所述步骤S401的具体实现过程可以参考上述本申请提供的一种图像处理方法实施例中的步骤S201。For the specific implementation process of step S401, reference may be made to step S201 in the above-mentioned image processing method embodiment provided in this application.
对于步骤S401需要说明的是残差网络模型架构,即残差网络。请参考图5所示,图5是本申请提供的一种基于残差网络的图像训练方法实施例中残差网络的结构示意图。所述残差网络是一种带有信息跳跃连接的一系列基础残差模块组成的网络,即每两层增加一个捷径(跳跃连接),构成一个残差块,多个残差块连接在一起即构成一个残差网络。What needs to be explained for step S401 is the residual network model architecture, that is, the residual network. Please refer to FIG. 5, which is a schematic structural diagram of a residual network in an embodiment of an image training method based on a residual network provided by the present application. The residual network is a network composed of a series of basic residual modules with information jump connections, that is, every two layers add a shortcut (jump connection) to form a residual block, and multiple residual blocks are connected together It constitutes a residual network.
步骤S402:拆分所述卷积图像集合,获得第一卷积图像组和第二卷积图像组;Step S402: Split the convolution image set to obtain a first convolution image group and a second convolution image group;
对于步骤S402具体实现过程可以参考图6所示,图6是本申请提供的一种基于残差网络的图像训练方法实施例中训练过程的示意图;图6的最右侧为拆分后的第一卷积图像组和第二卷积图像组,具体拆分过程可以参考上述本申请提供的一种图像处理方法实施例中的步骤S202,此处不再赘述。For the specific implementation process of step S402, refer to FIG. 6. FIG. 6 is a schematic diagram of the training process in the embodiment of the image training method based on the residual network provided by the present application; the rightmost part of FIG. 6 is the first after splitting. For the specific splitting process of the first convolution image group and the second convolution image group, reference may be made to step S202 in the above-mentioned embodiment of the image processing method provided in this application, which will not be repeated here.
需要特别说明的是,在本实施例中步骤S402中的拆分是针对残差网络内部的拆分,即在残差网络内部的支路上进行了拆分。It should be particularly noted that the splitting in step S402 in this embodiment is for splitting inside the residual network, that is, splitting is performed on the internal branch of the residual network.
步骤S403:分别对所述第一卷积图像组和第二卷积图像组进行卷积操作,获得所述第一子卷积图像组和第二子卷积图像组;Step S403: performing a convolution operation on the first convolution image group and the second convolution image group respectively to obtain the first subconvolution image group and the second subconvolution image group;
对于步骤S403具体实现过程可以参考图6所示,如图6中采用m×m的卷积核对第一卷积图像组和第二卷积图像组进行卷积,具体卷积过程可以参考上述本申请提供的一种图像处理方法实施例中的步骤S203,此处不再赘述。For the specific implementation process of step S403, refer to FIG. 6. As shown in FIG. 6, the m×m convolution kernel is used to convolve the first convolution image group and the second convolution image group. For the specific convolution process, please refer to the above-mentioned book. Step S203 in the embodiment of an image processing method provided by the application is not repeated here.
步骤S404:对所述第一子卷积图像组和第二子卷积图像组进行通道混洗,获得混洗后的特征图像;Step S404: Perform channel shuffling on the first subconvolution image group and the second subconvolution image group to obtain shuffled feature images;
对于步骤S404具体实现过程可以参考图6所示,将第一子卷积图像组和第二子卷积图像组相互掺插,具体通道混洗过程可以参考上述本申请提供的一种图像处理方法实施例中的步骤S204,此处不再赘述。For the specific implementation process of step S404, refer to FIG. 6, where the first subconvolution image group and the second subconvolution image group are interpolated with each other, and the specific channel shuffling process can refer to the above-mentioned image processing method provided in this application. Step S204 in the embodiment will not be repeated here.
步骤S405:根据获取的特征图像的图像特征数据和混洗后的特征图像的图像特征数据,确定所述特征图像训练后的特征图像。Step S405: According to the acquired image feature data of the feature image and the image feature data of the shuffled feature image, determine the feature image after the feature image training.
所述步骤S405的具体实现过程,可以将输入的特征图像的图像特征数据和混洗后的特征图像的图像特征数据进行逐图像特征数据相加,确定出最终输出的特征图像。In the specific implementation process of step S405, the image feature data of the input feature image and the image feature data of the shuffled feature image can be added image by image feature data to determine the final output feature image.
以上是对本申请提供的一种基于残差网络的图像训练方法实施例的详细描述,与前述提供的一种基于残差网络的图像训练方法实施例相对应,本申请还公开一种基于残差网络的图像训练装置实施例,请参看图7,由于装置实施例基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。下述描述的装置实施例仅仅是示意性的。The above is a detailed description of the embodiment of the image training method based on the residual network provided by this application. Corresponding to the embodiment of the image training method based on the residual network provided above, this application also discloses a residual network-based image training method. For the embodiment of the image training device of the network, please refer to FIG. 7. Since the device embodiment is basically similar to the method embodiment, the description is relatively simple. For related parts, please refer to the part of the description of the method embodiment. The device embodiments described below are merely illustrative.
如图7所示,图7是本申请提供的一种基于残差网络的图像训练装置实施例的结构示意图。该装置包括:As shown in FIG. 7, FIG. 7 is a schematic structural diagram of an embodiment of an image training device based on a residual network provided by the present application. The device includes:
第一卷积单元701,用于基于残差网络模型架构,对输入的特征图像进行卷积操作,获得卷积图像集合;The first convolution unit 701 is configured to perform a convolution operation on the input feature image based on the residual network model architecture to obtain a convolution image set;
所述第一卷积单元701的具体实现过程可以参考上述一种基于残差网络的图像训练 方法实施例中的步骤S401。For the specific implementation process of the first convolution unit 701, refer to step S401 in the above-mentioned embodiment of the image training method based on residual network.
拆分单元702,用于拆分所述卷积图像集合,获得第一卷积图像组和第二卷积图像组;The splitting unit 702 is configured to split the set of convolutional images to obtain a first convolutional image group and a second convolutional image group;
所述拆分单元702的具体实现过程可以参考上述一种基于残差网络的图像训练方法实施例中的步骤S402。For the specific implementation process of the splitting unit 702, reference may be made to step S402 in the foregoing embodiment of the image training method based on residual network.
第二卷积单元703,用于分别对所述第一卷积图像组和第二卷积图像组进行卷积操作,获得所述第一子卷积图像组和第二子卷积图像组;The second convolution unit 703 is configured to perform a convolution operation on the first convolution image group and the second convolution image group respectively to obtain the first subconvolution image group and the second subconvolution image group;
所述第二卷积单元703的具体实现过程可以参考上述一种基于残差网络的图像训练方法实施例中的步骤S403。For the specific implementation process of the second convolution unit 703, reference may be made to step S403 in the above-mentioned embodiment of the image training method based on residual network.
通道混洗单元704,用于对所述第一子卷积图像组和第二子卷积图像组进行通道混洗,获得混洗后的特征图像;A channel shuffling unit 704, configured to perform channel shuffling on the first subconvolution image group and the second subconvolution image group to obtain shuffled feature images;
所述通道混洗单元704的具体实现过程可以参考上述一种基于残差网络的图像训练方法实施例中的步骤S404。For the specific implementation process of the channel shuffling unit 704, reference may be made to step S404 in the above-mentioned embodiment of the image training method based on residual network.
确定单元705,用于根据获取的特征图像的图像特征数据和混洗后的特征图像的图像特征数据,确定所述特征图像训练后的特征图像。The determining unit 705 is configured to determine the feature image after the feature image training according to the acquired image feature data of the feature image and the image feature data of the shuffled feature image.
所述确定单元705的具体实现过程可以参考上述一种基于残差网络的图像训练方法实施例中的步骤S405。For the specific implementation process of the determining unit 705, reference may be made to step S405 in the foregoing embodiment of an image training method based on a residual network.
基于上述,本申请还提供一种神经网络的通道混洗方法,具体请参考图8所示,图8是本申请提供的一种神经网络的通道混洗方法实施例的流程图。该通道混洗方法包括:Based on the above, the present application also provides a neural network channel shuffling method. For details, please refer to FIG. 8. FIG. 8 is a flowchart of an embodiment of a neural network channel shuffling method provided by the present application. The channel shuffling method includes:
步骤S801:根据对输入到神经网络中的特征图像进行卷积操作,获得卷积图像集合;Step S801: Obtain a set of convolutional images according to the convolution operation on the characteristic images input to the neural network;
所述步骤S801的具体实现过程可以参考上述本申请提供的一种图像处理方法实施例中的步骤S201,此处不再赘述。For the specific implementation process of step S801, reference may be made to step S201 in the above-mentioned embodiment of an image processing method provided by the present application, which will not be repeated here.
步骤S802:拆分所述卷积图像集合,获得第一卷积图像组和第二卷积图像组;Step S802: Split the convolution image set to obtain a first convolution image group and a second convolution image group;
所述步骤S802的具体实现过程可以参考上述本申请提供的一种图像处理方法实施例中的步骤S202,此处不再赘述。For the specific implementation process of step S802, reference may be made to step S202 in the above-mentioned image processing method embodiment provided in this application, which will not be repeated here.
步骤S803:分别对所述第一卷积图像组和第二卷积图像组进行卷积操作,获得所述第一子卷积图像组和第二子卷积图像组;Step S803: Perform a convolution operation on the first convolution image group and the second convolution image group respectively to obtain the first subconvolution image group and the second subconvolution image group;
所述步骤S803的具体实现过程可以参考上述本申请提供的一种图像处理方法实施例中的步骤S203,此处不再赘述。For the specific implementation process of step S803, reference may be made to step S203 in the above-mentioned embodiment of an image processing method provided in this application, which will not be repeated here.
步骤S804:对所述第一子卷积图像组和第二子卷积图像组进行通道混洗。Step S804: Perform channel shuffling on the first subconvolution image group and the second subconvolution image group.
所述步骤S804的具体实现过程可以参考上述本申请提供的一种图像处理方法实施例中的步骤S204,此处不再赘述。For the specific implementation process of step S804, reference may be made to step S204 in the above-mentioned image processing method embodiment provided in this application, which will not be repeated here.
同样地,本申请还提供一种神经网络的通道混洗装置,如图9所示,该装置包括:Similarly, this application also provides a neural network channel shuffling device. As shown in FIG. 9, the device includes:
第一卷积单元901,用于根据对输入到神经网络中的特征图像进行卷积操作,获得卷积图像集合;The first convolution unit 901 is configured to perform a convolution operation on the characteristic image input to the neural network to obtain a convolution image set;
拆分单元902,用于拆分所述卷积图像集合,获得第一卷积图像组和第二卷积图像组;The splitting unit 902 is configured to split the set of convolutional images to obtain a first convolutional image group and a second convolutional image group;
第二卷积单元903,用于分别对所述第一卷积图像组和第二卷积图像组进行卷积操作,获得所述第一子卷积图像组和第二子卷积图像组;The second convolution unit 903 is configured to perform a convolution operation on the first convolution image group and the second convolution image group to obtain the first subconvolution image group and the second subconvolution image group;
混洗单元904,用于对所述第一子卷积图像组和第二子卷积图像组进行通道混洗。The shuffling unit 904 is configured to perform channel shuffling on the first subconvolution image group and the second subconvolution image group.
本申请提供神经网络的通道混洗装置可以参考上述本申请提供的一种图像处理装置实施例中的描述,此处不再赘述。For the channel shuffling device of the neural network provided in this application, reference may be made to the description in the above-mentioned embodiment of the image processing device provided in this application, which will not be repeated here.
基于上述内容,本申请还提供一种神经网络架构,包括:Based on the above content, this application also provides a neural network architecture, including:
第一卷积层,用于针对输入的特征图像进行卷积操作,获得卷积图像集合;The first convolution layer is used to perform a convolution operation on the input feature image to obtain a convolution image set;
拆分层,用于拆分所述第一卷积层卷积后的所述卷积图像集合,获得第一卷积图像组和第二卷积图像组;A split layer for splitting the set of convolution images convolved by the first convolution layer to obtain a first convolution image group and a second convolution image group;
第二卷积层,用于对所述拆分层拆分后的所述第一卷积图像组和第二卷积图像组分别进行卷积操作,获得所述第一子卷积图像组和第二子卷积图像组;The second convolution layer is used to perform convolution operations on the first convolution image group and the second convolution image group after the split layer is split to obtain the first subconvolution image group and The second sub-convolution image group;
混洗层,用于对所述第二卷积层卷积后的所述第一子卷积图像组和第二子卷积图像组进行通道混洗,获得混洗后的特征图像;A shuffling layer, configured to perform channel shuffling on the first subconvolution image group and the second subconvolution image group convolved by the second convolution layer to obtain a shuffled feature image;
计算层,用于根据输入到所述第一卷积层的特征图像的图像特征数据和混洗层混洗后的特征图像的图像特征数据,计算待输出的特征图像。The calculation layer is used to calculate the feature image to be output according to the image feature data of the feature image input to the first convolutional layer and the image feature data of the feature image shuffled by the shuffle layer.
基于上述内容,本申请还提供一种计算机存储介质,用于存储网络平台产生数据,以及对应所述网络平台产生数据进行处理的程序;Based on the above content, this application also provides a computer storage medium for storing data generated by a network platform, and a program corresponding to the data generated by the network platform for processing;
所述程序在被读取执行时,执行如上所述的图像处理方法的步骤;或者执行如上所述的基于残差网络的图像训练方法的步骤;或者执行如上所述的神经网络的通道混洗方法。When the program is read and executed, it executes the steps of the image processing method as described above; or executes the steps of the image training method based on the residual network as described above; or executes the channel shuffling of the neural network as described above method.
基于上述内容,本申请还提供一种电子设备,包括:Based on the above content, this application also provides an electronic device, including:
处理器;processor;
存储器,用于存储对网络平台产生数据进行处理的程序,所述程序在被所述处理器 读取执行时,执行如上所述的图像处理方法的步骤;或者执行如上所述的基于残差网络的图像训练方法的步骤;或者执行如上所述的神经网络的通道混洗方法。The memory is used to store a program for processing the data generated by the network platform. When the program is read and executed by the processor, it executes the steps of the image processing method as described above; or executes the residual network-based network as described above. The steps of the image training method; or the channel shuffling method of the neural network as described above.
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, the computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。The memory may include non-permanent memory in computer readable media, random access memory (RAM) and/or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer readable media.
1、计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括非暂存电脑可读媒体(transitory media),如调制的数据信号和载波。1. Computer-readable media include permanent and non-permanent, removable and non-removable media, and information storage can be realized by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital versatile disc (DVD) or other optical storage, Magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media can be used to store information that can be accessed by computing devices. According to the definition in this article, computer-readable media does not include non-transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.
2、本领域技术人员应明白,本申请的实施例可提供为方法、系统或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。2. Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems or computer program products. Therefore, this application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, this application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
本申请虽然以较佳实施例公开如上,但其并不是用来限定本申请,任何本领域技术人员在不脱离本申请的精神和范围内,都可以做出可能的变动和修改,因此本申请的保护范围应当以本申请权利要求所界定的范围为准。Although this application is disclosed as above in preferred embodiments, it is not intended to limit this application. Any person skilled in the art can make possible changes and modifications without departing from the spirit and scope of this application. Therefore, this application The scope of protection shall be subject to the scope defined by the claims of this application.

Claims (21)

  1. 一种图像处理方法,其特征在于,包括:An image processing method, characterized in that it comprises:
    对获取的特征图像进行卷积操作,获得卷积图像集合;Perform a convolution operation on the acquired feature images to obtain a set of convolution images;
    拆分所述卷积图像集合,获得第一卷积图像组和第二卷积图像组;Split the set of convolution images to obtain a first convolution image group and a second convolution image group;
    分别对所述第一卷积图像组和第二卷积图像组进行卷积操作,获得第一子卷积图像组和第二子卷积图像组;Performing a convolution operation on the first convolution image group and the second convolution image group respectively to obtain a first subconvolution image group and a second subconvolution image group;
    将所述第一子卷积图像组和第二子卷积图像组的通道顺序进行通道混洗,获得混洗后的特征图像。The channels of the first subconvolution image group and the second subconvolution image group are sequentially shuffled to obtain a shuffled feature image.
  2. 根据权利要求1所述的图像处理方法,其特征在于,所述拆分所述卷积图像集合,获得第一卷积图像组和第二卷积图像组,包括:The image processing method according to claim 1, wherein the splitting the convolution image set to obtain a first convolution image group and a second convolution image group comprises:
    按照设定的拆分要求,基于所述卷积图像集合中的通道数量,对所述卷积图像集合进行拆分,获得所述第一卷积图像组和第二卷积图像组。According to the set splitting requirements, the convolutional image set is split based on the number of channels in the convolutional image set to obtain the first convolutional image group and the second convolutional image group.
  3. 根据权利要求2所述的图像处理方法,其特征在于,所述按照设定的拆分要求,基于所述卷积图像集合中的通道数量,对所述卷积图像集合进行拆分,获得所述第一卷积图像组和第二卷积图像组,包括:The image processing method according to claim 2, characterized in that, according to the set splitting requirements, the convolutional image set is split based on the number of channels in the convolutional image set to obtain all The first convolution image group and the second convolution image group include:
    若所述通道数量为偶数,则按照通道排列顺序,将所述卷积图像集合拆分成通道数量相同的第一卷积图像组合和第二卷积图像组;If the number of channels is an even number, split the set of convolutional images into a first convolutional image group and a second convolutional image group with the same number of channels according to the order of channel arrangement;
    若所述通道数量为奇数,则选取所述通道数量的一半并取整数;If the number of channels is an odd number, select half of the number of channels and take an integer;
    按照通道排列顺序,将相邻且大于所述整数的通道对应的卷积图像作为第一卷积图像组的末尾卷积图像,将相邻且大于所述末尾卷积图像通道的卷积图像作为第二卷积图像组的首位卷积图像。According to the order of the channel arrangement, the convolution image corresponding to the adjacent channel greater than the integer is taken as the last convolution image of the first convolution image group, and the convolution image adjacent and greater than the last convolution image channel is taken as the convolution image The first convolution image of the second convolution image group.
  4. 根据权利要求1所述的图像处理方法,其特征在于,所述分别对所述第一卷积图像组和第二卷积图像组卷积操作,获得所述第一子卷积图像组和第二子卷积图像组,包括:The image processing method according to claim 1, wherein the convolution operation is performed on the first convolution image group and the second convolution image group to obtain the first subconvolution image group and the second convolution image group. Two-subconvolution image group, including:
    对所述第一卷积图像组和所述第二卷积图像组分别采用预设的卷积核进行卷积操作,获得所述第一子卷积图像组和第二子卷积图像组。The first convolution image group and the second convolution image group are respectively used to perform a convolution operation with a preset convolution kernel to obtain the first subconvolution image group and the second subconvolution image group.
  5. 根据权利要求4所述的图像处理方法,其特征在于,所述对所述第一卷积图像组和所述第二卷积图像组分别采用预设的卷积核进行卷积操作,获得所述第一子卷积图像组和第二子卷积图像组,包括:The image processing method according to claim 4, wherein the first convolution image group and the second convolution image group are respectively used to perform a convolution operation with a preset convolution kernel to obtain the The first sub-convolution image group and the second sub-convolution image group include:
    对所述第一卷积图像组采用预设的第一卷积核进行卷积操作,获得所述第一子卷积 图像组;Using a preset first convolution kernel to perform a convolution operation on the first convolution image group to obtain the first subconvolution image group;
    对所述第二卷积图像组采用预设的第二卷积核进行卷积操作,获得所述第二子卷积图像组。Performing a convolution operation on the second convolution image group using a preset second convolution kernel to obtain the second subconvolution image group.
  6. 根据权利要求1所述的图像处理方法,其特征在于,所述对所述第一子卷积图像组和第二子卷积图像组的通道顺序进行通道混洗,获得混洗后的特征图像,包括:The image processing method according to claim 1, wherein the channel shuffling is performed sequentially on the channels of the first subconvolution image group and the second subconvolution image group to obtain a shuffled feature image ,include:
    对所述第一子卷积图像组和第二子卷积图像组进行拼接,获得拼接后的拼接特征图像集合;Splicing the first subconvolutional image group and the second subconvolutional image group to obtain a spliced feature image set;
    对所述拼接特征图像集合进行通道混洗,获得所述混洗后的特征图像。Channel shuffling is performed on the spliced feature image set to obtain the shuffled feature image.
  7. 根据权利要求6所述的图像处理方法,其特征在于,所述对所述第一子卷积图像组和第二子卷积图像组进行拼接,获得拼接后的拼接特征图像集合,包括:7. The image processing method according to claim 6, wherein the splicing the first sub-convolutional image group and the second sub-convolutional image group to obtain a spliced spliced feature image set comprises:
    按照通道排列顺序,将所述第二子卷积图像组中首位卷积图放到所述第一子卷积图像组中末尾卷积图之后,获得所述拼接特征图像集合。According to the channel arrangement order, the first convolution map in the second subconvolution image group is placed after the last convolution map in the first subconvolution image group to obtain the mosaic feature image set.
  8. 根据权利要求6或7任意一项所述的图像处理方法,其特征在于,所述对所述拼接特征图像集合进行通道混洗,获得混洗后的特征图像,包括:The image processing method according to any one of claims 6 or 7, wherein the performing channel shuffling on the spliced feature image set to obtain a shuffled feature image comprises:
    按照设定的通道排列要求,对所述拼接特征图像集合重新排列,获得混洗后的特征图像。According to the set channel arrangement requirements, rearrange the spliced feature image set to obtain shuffled feature images.
  9. 根据权利要求1所述的图像处理方法,其特征在于,还包括:The image processing method according to claim 1, further comprising:
    根据获取的特征图像的图像特征数据和混洗后的特征图像的图像特征数据,确定输出的特征图像。According to the acquired image feature data of the feature image and the image feature data of the shuffled feature image, the output feature image is determined.
  10. 根据权利要求9所述的图像处理方法,其特征在于,所述根据获取的特征图像的图像特征数据和混洗后的特征图像的图像特征数据,确定输出的特征图像,包括:The image processing method according to claim 9, wherein the determining the output characteristic image according to the acquired image characteristic data of the characteristic image and the image characteristic data of the shuffled characteristic image comprises:
    将所述特征图像的图像特征数据和混洗后的特征图像的图像特征数据进行逐图像特征数据相加,确定输出的特征图像。The image feature data of the feature image and the image feature data of the shuffled feature image are added image by image feature data to determine the output feature image.
  11. 一种图像处理装置,其特征在于,包括:An image processing device, characterized in that it comprises:
    第一卷积单元,用于对获取的特征图像进行卷积操作,获得卷积图像集合;The first convolution unit is used to perform a convolution operation on the acquired feature images to obtain a convolution image set;
    拆分单元,用于拆分所述卷积图像集合,获得第一卷积图像组和第二卷积图像组;A splitting unit, configured to split the set of convolutional images to obtain a first convolutional image group and a second convolutional image group;
    第二卷积单元,用于分别对所述第一卷积图像组和第二卷积图像组进行卷积操作,获得第一子卷积图像组和第二子卷积图像组;The second convolution unit is configured to perform a convolution operation on the first convolution image group and the second convolution image group to obtain the first subconvolution image group and the second subconvolution image group;
    通道混洗单元,用于对所述第一子卷积图像组和第二子卷积图像组的通道顺序进行通道混洗,获得混洗后的特征图像。The channel shuffling unit is configured to sequentially perform channel shuffling on the channels of the first subconvolution image group and the second subconvolution image group to obtain shuffled feature images.
  12. 一种基于残差网络的图像训练方法,其特征在于,包括:An image training method based on residual network, which is characterized in that it includes:
    基于残差网络模型架构,对输入的特征图像进行卷积操作,获得卷积图像集合;Based on the residual network model architecture, perform convolution operations on the input feature images to obtain a set of convolution images;
    拆分所述卷积图像集合,获得第一卷积图像组和第二卷积图像组;Split the set of convolution images to obtain a first convolution image group and a second convolution image group;
    分别对所述第一卷积图像组和第二卷积图像组进行卷积操作,获得第一子卷积图像组和第二子卷积图像组;Performing a convolution operation on the first convolution image group and the second convolution image group respectively to obtain a first subconvolution image group and a second subconvolution image group;
    对所述第一子卷积图像组和第二子卷积图像组的通道顺序进行通道混洗,获得混洗后的特征图像;Performing channel shuffling sequentially on the channels of the first subconvolution image group and the second subconvolution image group to obtain a shuffled feature image;
    根据获取的特征图像的图像特征数据和混洗后的特征图像的图像特征数据,确定所述特征图像训练后的特征图像。According to the acquired image feature data of the feature image and the image feature data of the shuffled feature image, the feature image after the feature image training is determined.
  13. 一种基于残差网络的图像训练装置,其特征在于,包括:An image training device based on residual network, which is characterized in that it comprises:
    第一卷积单元,用于基于残差网络模型架构,对输入的特征图像进行卷积操作,获得卷积图像集合;The first convolution unit is used to perform a convolution operation on the input feature image based on the residual network model architecture to obtain a convolution image set;
    拆分单元,用于拆分所述卷积图像集合,获得第一卷积图像组和第二卷积图像组;A splitting unit, configured to split the set of convolutional images to obtain a first convolutional image group and a second convolutional image group;
    第二卷积单元,用于分别对所述第一卷积图像组和第二卷积图像组进行卷积操作,获得第一子卷积图像组和第二子卷积图像组;The second convolution unit is configured to perform a convolution operation on the first convolution image group and the second convolution image group to obtain the first subconvolution image group and the second subconvolution image group;
    通道混洗单元,用于对所述第一子卷积图像组和第二子卷积图像组的通道顺序进行通道混洗,获得混洗后的特征图像;A channel shuffling unit, configured to sequentially perform channel shuffling on the channels of the first subconvolution image group and the second subconvolution image group to obtain a shuffled feature image;
    确定单元,用于根据获取的特征图像的图像特征数据和混洗后的特征图像的图像特征数据,确定所述特征图像训练后的特征图像。The determining unit is configured to determine the characteristic image of the characteristic image after the training of the characteristic image according to the acquired image characteristic data of the characteristic image and the image characteristic data of the shuffled characteristic image.
  14. 一种神经网络的通道混洗方法,其特征在于,包括:A channel shuffling method of neural network, which is characterized in that it comprises:
    根据对输入到神经网络中的特征图像进行卷积操作,获得卷积图像集合;According to the convolution operation on the characteristic images input to the neural network, a convolution image set is obtained;
    拆分所述卷积图像集合,获得第一卷积图像组和第二卷积图像组;Split the set of convolution images to obtain a first convolution image group and a second convolution image group;
    分别对所述第一卷积图像组和第二卷积图像组进行卷积操作,获得第一子卷积图像组和第二子卷积图像组;Performing a convolution operation on the first convolution image group and the second convolution image group respectively to obtain a first subconvolution image group and a second subconvolution image group;
    对所述第一子卷积图像组和第二子卷积图像组的通道顺序进行通道混洗。Channel shuffling is sequentially performed on the channels of the first subconvolution image group and the second subconvolution image group.
  15. 根据权利要求14所述的神经网络的通道混洗方法,其特征在于,所述对所述第一子卷积图像组和第二子卷积图像组的通道顺序进行通道混洗,包括:The method for channel shuffling of neural networks according to claim 14, wherein said sequentially performing channel shuffling on the channels of the first subconvolution image group and the second subconvolution image group comprises:
    对所述第一子卷积图像组和第二子卷积图像组进行拼接,获得拼接后的拼接特征图像集合;Splicing the first subconvolutional image group and the second subconvolutional image group to obtain a spliced feature image set;
    对所述拼接特征图像集合进行通道混洗。Channel shuffling is performed on the spliced feature image set.
  16. 根据权利要求15所述的神经网络的通道混洗方法,其特征在于,所述对所述第一子卷积图像组和第二子卷积图像组进行拼接,获得拼接后的拼接特征图像集合,包括:The neural network channel shuffling method according to claim 15, wherein the first subconvolution image group and the second subconvolution image group are spliced to obtain a spliced feature image set after splicing ,include:
    按照通道排列顺序,将所述第二子卷积图像组中首位卷积图放到所述第一子卷积图像组中末尾卷积图之后,获得所述拼接特征图集合。According to the channel arrangement order, the first convolution map in the second subconvolution image group is placed after the last convolution map in the first subconvolution image group to obtain the spliced feature map set.
  17. 根据权利要求15或16任意一项所述的神经网络的通道混洗方法,其特征在于,所述对所述拼接特征图像集合进行通道混洗,包括:The channel shuffling method for neural networks according to any one of claims 15 or 16, wherein said performing channel shuffling on the set of spliced feature images comprises:
    按照设定的通道排列要求,对所述拼接特征图像集合重新排列。According to the set channel arrangement requirements, the splicing feature image set is rearranged.
  18. 一种神经网络的通道混洗装置,其特征在于,包括:A neural network channel shuffling device, which is characterized in that it comprises:
    第一卷积单元,用于根据对输入到神经网络中的特征图像进行卷积操作,获得卷积图像集合;The first convolution unit is configured to perform a convolution operation on the characteristic image input to the neural network to obtain a convolution image set;
    拆分单元,用于拆分所述卷积图像集合,获得第一卷积图像组和第二卷积图像组;A splitting unit, configured to split the set of convolutional images to obtain a first convolutional image group and a second convolutional image group;
    第二卷积单元,用于分别对所述第一卷积图像组和第二卷积图像组进行卷积操作,获得第一子卷积图像组和第二子卷积图像组;The second convolution unit is configured to perform a convolution operation on the first convolution image group and the second convolution image group to obtain the first subconvolution image group and the second subconvolution image group;
    混洗单元,用于对所述第一子卷积图像组和第二子卷积图像组的通道顺序进行通道混洗。The shuffling unit is configured to sequentially perform channel shuffling on the channels of the first subconvolution image group and the second subconvolution image group.
  19. 一种神经网络架构,其特征在于,包括:A neural network architecture is characterized in that it includes:
    第一卷积层,用于针对输入的特征图像进行卷积操作,获得卷积图像集合;The first convolution layer is used to perform a convolution operation on the input feature image to obtain a convolution image set;
    拆分层,用于拆分所述第一卷积层卷积后的所述卷积图像集合,获得第一卷积图像组和第二卷积图像组;A split layer for splitting the set of convolution images convolved by the first convolution layer to obtain a first convolution image group and a second convolution image group;
    第二卷积层,用于对所述拆分层拆分后的所述第一卷积图像组和第二卷积图像组分别进行卷积操作,获得第一子卷积图像组和第二子卷积图像组;The second convolution layer is used to perform convolution operations on the first convolution image group and the second convolution image group after the split layer is split to obtain the first subconvolution image group and the second convolution image group. Sub-convolution image group;
    混洗层,用于对所述第二卷积层卷积后的所述第一子卷积图像组和第二子卷积图像组的通道顺序进行通道混洗,获得混洗后的特征图像;The shuffling layer is used to perform channel shuffling on the channels of the first subconvolution image group and the second subconvolution image group convolved by the second convolution layer to obtain a shuffled feature image ;
    计算层,用于根据输入到所述第一卷积层的特征图像的图像特征数据和混洗层混洗后的特征图像的图像特征数据,计算待输出的特征图像。The calculation layer is used to calculate the feature image to be output according to the image feature data of the feature image input to the first convolutional layer and the image feature data of the feature image shuffled by the shuffle layer.
  20. 一种计算机存储介质,用于存储网络平台产生数据,以及对应所述网络平台产生数据进行处理的程序;A computer storage medium for storing data generated by a network platform and a program corresponding to the data generated by the network platform for processing;
    所述程序在被读取执行时,执行如权利要求1至10任意一项所述的图像处理方法的步骤;或者执行如权利要求12所述的基于残差网络的图像训练方法的步骤;或者执行如权利要求14所述的通道混洗方法。When the program is read and executed, it executes the steps of the image processing method according to any one of claims 1 to 10; or executes the steps of the image training method based on residual network according to claim 12; or The channel shuffling method according to claim 14 is implemented.
  21. 一种电子设备,包括:An electronic device including:
    处理器;processor;
    存储器,用于存储对网络平台产生数据进行处理的程序,所述程序在被所述处理器读取执行时,执行如权利要求1至10任意一项所述的图像处理方法的步骤;或者执行如权利要求12所述的基于残差网络的图像训练方法的步骤;或者执行如权利要求14所述的通道混洗方法。The memory is used to store a program for processing data generated by the network platform, and when the program is read and executed by the processor, it executes the steps of the image processing method according to any one of claims 1 to 10; or The steps of the image training method based on the residual network according to claim 12; or the channel shuffling method according to claim 14 is executed.
PCT/CN2020/133972 2019-12-06 2020-12-04 Methods and apparatuses for image processing, image training and channel shuffling WO2021110147A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911242229.5 2019-12-06
CN201911242229.5A CN112927174B (en) 2019-12-06 2019-12-06 Image processing, image training channel shuffling method and device

Publications (1)

Publication Number Publication Date
WO2021110147A1 true WO2021110147A1 (en) 2021-06-10

Family

ID=76161551

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/133972 WO2021110147A1 (en) 2019-12-06 2020-12-04 Methods and apparatuses for image processing, image training and channel shuffling

Country Status (2)

Country Link
CN (1) CN112927174B (en)
WO (1) WO2021110147A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113393368A (en) * 2021-06-11 2021-09-14 安谋科技(中国)有限公司 Image processing method, medium, and electronic device based on neural network model
CN113743582A (en) * 2021-08-06 2021-12-03 北京邮电大学 Novel channel shuffling method and device based on stack shuffling
CN115223018A (en) * 2022-06-08 2022-10-21 东北石油大学 Cooperative detection method and device for disguised object, electronic device and storage medium

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115348432B (en) * 2022-08-15 2024-05-07 上海壁仞科技股份有限公司 Data processing method and device, image processing method, electronic equipment and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109145970A (en) * 2018-08-06 2019-01-04 北京市商汤科技开发有限公司 Question and answer treating method and apparatus, electronic equipment and storage medium based on image
CN110009565A (en) * 2019-04-04 2019-07-12 武汉大学 A kind of super-resolution image reconstruction method based on lightweight network
CN110084274A (en) * 2019-03-29 2019-08-02 南京邮电大学 Realtime graphic semantic segmentation method and system, readable storage medium storing program for executing and terminal
US20190294929A1 (en) * 2018-03-20 2019-09-26 The Regents Of The University Of Michigan Automatic Filter Pruning Technique For Convolutional Neural Networks
CN110309876A (en) * 2019-06-28 2019-10-08 腾讯科技(深圳)有限公司 Object detection method, device, computer readable storage medium and computer equipment

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
AU2017338783B2 (en) * 2016-10-04 2022-02-10 Magic Leap, Inc. Efficient data layouts for convolutional neural networks
CN109492514A (en) * 2018-08-28 2019-03-19 初速度(苏州)科技有限公司 A kind of method and system in one camera acquisition human eye sight direction
CN109409342A (en) * 2018-12-11 2019-03-01 北京万里红科技股份有限公司 A kind of living iris detection method based on light weight convolutional neural networks

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190294929A1 (en) * 2018-03-20 2019-09-26 The Regents Of The University Of Michigan Automatic Filter Pruning Technique For Convolutional Neural Networks
CN109145970A (en) * 2018-08-06 2019-01-04 北京市商汤科技开发有限公司 Question and answer treating method and apparatus, electronic equipment and storage medium based on image
CN110084274A (en) * 2019-03-29 2019-08-02 南京邮电大学 Realtime graphic semantic segmentation method and system, readable storage medium storing program for executing and terminal
CN110009565A (en) * 2019-04-04 2019-07-12 武汉大学 A kind of super-resolution image reconstruction method based on lightweight network
CN110309876A (en) * 2019-06-28 2019-10-08 腾讯科技(深圳)有限公司 Object detection method, device, computer readable storage medium and computer equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
ZHANG XIANGYU, ZHOU XINYU, LIN MENGXIAO, SUN JIAN: "ShuffleNet: An Extremely Efficient Convolutional Neural Network for Mobile Devices", EYE IN-PAINTING WITH EXEMPLAR GENERATIVE ADVERSARIAL NETWORKS, 1 June 2018 (2018-06-01) - 23 June 2018 (2018-06-23), pages 6848 - 6856, XP055818489, ISBN: 978-1-5386-6420-9, DOI: 10.1109/CVPR.2018.00716 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113393368A (en) * 2021-06-11 2021-09-14 安谋科技(中国)有限公司 Image processing method, medium, and electronic device based on neural network model
CN113393368B (en) * 2021-06-11 2023-08-18 安谋科技(中国)有限公司 Image processing method, medium and electronic equipment based on neural network model
CN113743582A (en) * 2021-08-06 2021-12-03 北京邮电大学 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
CN115223018A (en) * 2022-06-08 2022-10-21 东北石油大学 Cooperative detection method and device for disguised object, electronic device and storage medium

Also Published As

Publication number Publication date
CN112927174A (en) 2021-06-08
CN112927174B (en) 2024-05-03

Similar Documents

Publication Publication Date Title
WO2021110147A1 (en) Methods and apparatuses for image processing, image training and channel shuffling
US10977001B2 (en) Asymmetric quantization of multiple-and-accumulate operations in deep learning processing
CN110309837B (en) Data processing method and image processing method based on convolutional neural network characteristic diagram
EP3349153B1 (en) Convolutional neural network (cnn) processing method and apparatus
US11568258B2 (en) Operation method
US20190377985A1 (en) Image classification neural networks
US11847569B2 (en) Training and application method of a multi-layer neural network model, apparatus and storage medium
US20180260710A1 (en) Calculating device and method for a sparsely connected artificial neural network
US20190303757A1 (en) Weight skipping deep learning accelerator
US20190340510A1 (en) Sparsifying neural network models
CN107103285B (en) Face depth prediction method based on convolutional neural network
US20190244100A1 (en) Cascaded computing for convolutional neural networks
CA3030428A1 (en) Superpixel methods for convolutional neural networks
KR20210036715A (en) Neural processing apparatus and method for processing pooling of neural network thereof
CN107967516A (en) A kind of acceleration of neutral net based on trace norm constraint and compression method
US11775832B2 (en) Device and method for artificial neural network operation
US20200389182A1 (en) Data conversion method and apparatus
WO2022134465A1 (en) Sparse data processing method for accelerating operation of re-configurable processor, and device
CN110533161B (en) Feature map processing method based on hierarchical group convolution neural network
KR20200072308A (en) Method and apparatus for performing convolution operations in neural networks
CN116128019A (en) Parallel training method and device for transducer model
US20180357546A1 (en) Optimizing tree-based convolutional neural networks
CN112990046B (en) Differential information acquisition method, related device and computer program product
CN112712461B (en) Image deconvolution processing method and device and terminal equipment
US20240135677A1 (en) Method, system and storage media for training a graphics processing neural network with a patch-based approach

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20895717

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20895717

Country of ref document: EP

Kind code of ref document: A1