WO2020173115A1 - 网络模块和分配方法及装置、电子设备和存储介质 - Google Patents

网络模块和分配方法及装置、电子设备和存储介质 Download PDF

Info

Publication number
WO2020173115A1
WO2020173115A1 PCT/CN2019/114460 CN2019114460W WO2020173115A1 WO 2020173115 A1 WO2020173115 A1 WO 2020173115A1 CN 2019114460 W CN2019114460 W CN 2019114460W WO 2020173115 A1 WO2020173115 A1 WO 2020173115A1
Authority
WO
WIPO (PCT)
Prior art keywords
neurons
layer
network
image processing
processing model
Prior art date
Application number
PCT/CN2019/114460
Other languages
English (en)
French (fr)
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 深圳市商汤科技有限公司
Priority to JP2020527741A priority Critical patent/JP7096888B2/ja
Priority to KR1020207015036A priority patent/KR20200106027A/ko
Priority to SG11202004552VA priority patent/SG11202004552VA/en
Priority to US16/888,931 priority patent/US11443438B2/en
Publication of WO2020173115A1 publication Critical patent/WO2020173115A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/20Analysis of motion
    • G06T7/246Analysis of motion using feature-based methods, e.g. the tracking of corners or segments
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/06Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons
    • G06N3/063Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons using electronic means
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • 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
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/082Learning methods modifying the architecture, e.g. adding, deleting or silencing nodes or connections
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/30Determination of transform parameters for the alignment of images, i.e. image registration
    • G06T7/35Determination of transform parameters for the alignment of images, i.e. image registration using statistical methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]

Definitions

  • the present disclosure relates to the field of computer vision technology, and in particular to a network module, a distribution method and device, electronic equipment, and storage medium.
  • Computer vision is an important part of artificial intelligence, and image classification is the basis of computer vision. Therefore, a good classification network can be used as a backbone network to perform tasks such as support, segmentation, and tracking. In recent years, feature aggregation has become a very effective visual recognition network design method.
  • the present disclosure proposes a network module, a distribution method and device, electronic equipment, and storage medium.
  • a network module including:
  • the first network layer, the second network layer and the third network layer that are cascaded in sequence;
  • the first network layer is used to process the input image to obtain a first feature map
  • the second network layer includes a plurality of parallel branches
  • Each branch includes the first sampling layer
  • the first sampling layer is used to down-sample the first feature map to obtain a second feature map
  • the third network layer is used to merge the feature map data output by each branch.
  • the first sampling layer is a pooling layer.
  • the pooling layer is the maximum pooling layer.
  • each branch further includes a first convolutional layer and a second sampling layer that are sequentially cascaded with the first sampling layer;
  • the first convolution layer is used to perform a convolution operation on the second feature map to obtain a third feature map
  • the second sampling layer is used to restore the scale of the third feature map to the scale of the first feature map.
  • the second network layer further includes an original scale branch;
  • the original scale branch includes a second convolutional layer;
  • the second convolutional layer is configured to perform a convolution operation on the first feature map, and input the feature map data obtained through the convolution operation to the third network layer;
  • the third network layer is also used to merge the feature map data output by the multiple parallel branches in the second network layer with the feature map data output by each of the original scale branches.
  • an allocation method which is used to allocate the passed neuron to each feature map when there are multiple feature maps in an image processing model, and the image processing model includes At least one of the aforementioned network modules; the method includes:
  • multiple convolutional layers are at the same depth of the image processing model.
  • Each convolutional layer is used to process the feature maps of different scales
  • the first result contains multiple neurons
  • the scale of the feature map corresponding to each neuron is calculated to obtain the distribution relationship
  • the location attribute represents the convolutional layer to which each neuron belongs
  • the assignment relationship represents the correspondence between each feature map and the neurons passed by the feature map
  • the passed neurons are allocated to each of the feature maps.
  • the method before screening the neurons according to the importance of the neurons in the multiple convolutional layers in the image processing model, the method further includes:
  • the scale parameter represents the importance of neurons in the convolutional layer in each branch of the network module.
  • the filtering the neurons according to the importance of the neurons in the multiple convolutional layers in the image processing model to obtain the first result includes:
  • the first sequence represents an arrangement order of neurons in the multiple convolutional layers
  • the required neurons are sequentially extracted from the first sequence to obtain the first result.
  • the method further includes:
  • an allocating device which is used to allocate the passed neuron to each of the feature maps when there are multiple feature maps in the image processing model, and the image processing model includes At least one of the aforementioned network modules; the device includes:
  • the screening module is used to screen the neurons according to the importance of the neurons in the multiple convolutional layers in the image processing model to obtain the first result;
  • multiple convolutional layers are at the same depth of the image processing model.
  • Each convolutional layer is used to process the feature maps of different scales
  • the first result contains multiple neurons
  • a statistics module configured to count the scale of the feature map corresponding to each neuron according to the location attribute of each neuron in the first result to obtain the distribution relationship
  • the location attribute represents the convolutional layer to which each neuron belongs
  • the assignment relationship represents the correspondence between each feature map and the neurons passed by the feature map
  • the allocation module is used to allocate the passed neuron to each of the feature maps according to the allocation relationship.
  • it also includes:
  • the model building module is used to determine the number of branches in each network module before the screening module screens the neurons according to the importance of the neurons in the multiple convolutional layers in the image processing model, and The preset number of the network modules constructs the image processing model;
  • the first training module is used to train the image processing model to obtain the scale parameter of the batchnorm layer in the image processing model
  • the scale parameter represents the importance of neurons in the convolutional layer in each branch of the network module.
  • the screening module includes:
  • a sorting sub-module configured to sort the neurons of the multiple convolutional layers according to the scale parameter of the batchnorm layer obtained by pre-training the image processing model to obtain the first sequence
  • the first sequence represents an arrangement order of neurons in the multiple convolutional layers
  • the neuron number determining sub-module is used to determine the number of neurons to be used for processing multiple feature maps according to a preset calculation amount
  • the neuron extraction sub-module is configured to sequentially extract the required neurons from the first sequence according to the determined number of the neurons to be used, to obtain the first result.
  • it also includes:
  • the network structure determination module is configured to determine the first network structure of the image processing model according to the assignment relationship after the assignment module assigns the passed neurons to each of the feature maps according to the assignment relationship ;
  • the second training module is used to train the image processing model of the first network structure.
  • an electronic device including:
  • a memory for storing processor executable instructions
  • the processor is configured to execute any of the aforementioned methods.
  • a computer-readable storage medium having computer program instructions stored thereon, and when the computer program instructions are executed by a processor, the foregoing allocation method is implemented.
  • a computer program including computer readable code, when the computer readable code runs in an electronic device, the processor in the electronic device executes the above distribution method .
  • a plurality of parallel branches are built in the second network layer in the network module, and the first sampling layer in each branch compares the first feature output by the first network layer.
  • the graphs are down-sampled so that each different first sampling layer constructs second feature maps with different scales, so as to achieve the purpose of directly constructing multiple feature maps with different scales in the network module.
  • Fig. 1 shows a schematic structural diagram of a network module according to an embodiment of the present disclosure
  • Fig. 2 shows a schematic structural diagram of a network module according to another embodiment of the present disclosure
  • Fig. 3 shows a schematic structural diagram of a network module according to another embodiment of the present disclosure
  • Figure 4 shows a flow chart of a distribution method according to an embodiment of the present disclosure
  • Fig. 5 shows a block diagram of a distribution device according to an embodiment of the present disclosure
  • Figure 6 shows a block diagram of an electronic device according to an embodiment of the present disclosure
  • FIG. 7 shows a block diagram of an electronic device according to an embodiment of the present disclosure.
  • Fig. 1 shows a schematic structural diagram of a network module according to an embodiment of the present disclosure.
  • the network module of the embodiment of the present disclosure includes a first network layer, a second network layer, and a third network layer that are sequentially cascaded.
  • the first network layer is used to process the input image to obtain the first feature map.
  • the second network layer includes multiple parallel branches, and each branch includes a first sampling layer.
  • the first sampling layer is used to down-sample the first feature map to obtain the second feature map.
  • the scales of the second feature maps obtained by the first sampling layer in different branches are different.
  • the third network layer is used to merge the feature map data output by each branch, so that the network layer located at the lower level of the third network layer can continue to perform image processing operations.
  • the third network layer may be a concatenate layer.
  • multiple parallel branches are built in the second network layer in the network module, and the first sampling layer in each branch down-samples the first feature map output by the first network layer , So that different first sampling layers construct second feature maps with different scales, so as to achieve the purpose of directly constructing multiple feature maps with different scales in the network module.
  • the network module of the embodiment of the present disclosure can directly pass through the first sampling layer in each branch.
  • Constructing feature maps of different scales that is, constructing feature maps of various scales through down-sampling operations, makes it possible to construct feature maps of various scales according to the actual situation by using the network module of the embodiment of the present disclosure. Therefore, this effectively improves the diversity of feature maps, and can also make the scale variation range of the obtained feature maps larger and more diverse.
  • the multi-branch setting also brings more diverse receptive fields, so that the network module can effectively improve the accuracy of classification and detection when applied to classification and detection tasks.
  • the number of branches set in the second network layer of the above-mentioned network module can be specifically set according to actual conditions.
  • the number of branches can be two, three, five, ten, etc.
  • the number of branches in the second network layer can be determined according to its specific calculation amount. Therefore, the number of branches is not limited here.
  • the scale of the feature map mentioned in the embodiment of the present disclosure can be the physical size of the feature map, or the size of the effective part of the image (for example, although the physical size of the image The size is the same, but the pixel values of some pixels of the image have been processed by but not limited to zeroing, etc., except for these processed pixels, the other pixel components are equivalent to the effective part, and the size of the effective part is smaller than the physical size of the image Small), but not limited to this.
  • the first sampling layer may be a pooling layer, or may be another network layer capable of performing various operations (such as zooming in, zooming out, etc.) on the image.
  • the first sampling layer only needs to be able to process the first feature map so that the second feature map obtained after processing can have different scales. This effectively improves the structural flexibility of the network module of the embodiment of the present disclosure, thereby making it easier to construct the network module.
  • Fig. 2 shows a schematic structural diagram of a network module according to another embodiment of the present disclosure.
  • the pooling layer may be a maximum pooling layer (max pool). That is, the first sampling layer is implemented by the maximum pooling layer.
  • the first network layer may be a convolutional layer, and the convolution kernel of the convolutional layer may have a size of 1*1 (ie, a 1*1 convolutional layer).
  • the first network layer for example: 1*1 convolutional layer
  • the corresponding first feature map is obtained.
  • the first feature map has the first scale.
  • the first sampling layer (such as the maximum pooling layer) of each branch in the second network layer down-samples the first feature map with the first scale (that is, the first feature map from the maximum pooling layer) Perform maximum pooling processing) to obtain second feature maps with different scales, thereby achieving the purpose of directly constructing feature maps with different scales in the network module.
  • the maximum pooling layer As the first sampling layer to downsample the first feature map, since the maximum pooling can effectively reduce the size of the feature map, it corresponds to the subsequent image processing operations in the small-scale branch (such as: convolution operation). ) Will consume less computation, which effectively reduces the computation in each branch and reduces power consumption.
  • each branch further includes a first convolutional layer and a second sampling layer that are sequentially cascaded with the first sampling layer.
  • the first convolution layer is used to perform a convolution operation on the second feature map to obtain the third feature map.
  • the first convolutional layer may be a convolutional layer with different sizes of convolution kernels (for example: 3*3 convolutional layer, 3*3conv).
  • the size of the convolution kernel of the first convolution layer in each branch may be the same or different.
  • the second sampling layer is used to restore the scale of the third feature map to the scale of the first feature map. It should be pointed out that the second sampling layer may be an upsample layer.
  • the first convolution layer After down-sampling the first feature map at each first sampling layer to obtain the second feature map with different scales, the first convolution layer performs convolution operation on the second feature map with different scales. , In order to realize the convolution processing of the feature map.
  • the scale of the second feature map obtained is changed compared with that of the first feature map, and in each branch, the first convolutional layer
  • the scale of the third feature map obtained by convolving the second feature map and the scale of the second feature map may also change. Therefore, in order to perform other image processing smoothly, the second sampling is also required.
  • the layer performs an up-sampling operation on the third feature map, so that the scale of the third feature map is restored to the original scale (ie, the scale of the first feature map).
  • the network module of the embodiment of the present disclosure realizes the construction of feature maps of different scales through up-sampling and down-sampling operations, so that multi-scale features can be extracted effectively and efficiently.
  • Fig. 3 shows a schematic structural diagram of a network module according to another embodiment of the present disclosure.
  • the second network layer may also include original scale branches.
  • the original scale branch and the above multiple parallel branches are in parallel relationship, and the original scale branch does not change the scale of the first feature map.
  • the original scale branch includes a second convolutional layer, and the second convolutional layer is used to perform a convolution operation on the first feature map, and input the feature map data obtained through the convolution operation into the third network layer,
  • the feature data obtained by convolution has the same scale as the first feature map.
  • the second convolutional layer may be a 3*3 convolutional layer (ie, 3*3conv).
  • the third network layer is also used to merge the feature map data output by multiple parallel branches in the second network layer with the feature map data output by the original scale branches.
  • the second convolution layer in the original scale branch directly performs convolution operation on the first feature map.
  • the processing of the first feature map of the original scale is guaranteed, which also improves the completeness and accuracy of processed image data, and avoids the lack of some features in the first feature map.
  • the network module of the embodiment of the present disclosure can be used as the smallest basic unit (may be referred to as a block for short) in the neural network structure. That is, it is possible to construct a network structure having different depths by repeatedly stacking any of the above-mentioned network blocks. Among them, the constructed network structure can be a convolutional neural network.
  • a distribution method is also provided.
  • the allocation method of the present disclosure is used to allocate the passed neuron to each feature map when there are multiple feature maps in the image processing model. Among them, each feature map has a different scale.
  • the image processing model may be a convolutional neural network model.
  • Fig. 4 shows a flowchart of a distribution method according to an embodiment of the present disclosure.
  • the distribution method of the present disclosure includes:
  • step S100 the neurons are screened according to the importance of the neurons in the multiple convolutional layers in the image processing model to obtain a first result.
  • the multiple convolutional layers are at the same depth of the image processing model (that is, multiple convolutional layers are located at the same layer of the image processing model), and each convolutional layer is used to process different Scale feature map.
  • the first result contains multiple neurons.
  • Step S200 According to the position attribute of each neuron in the first result, the scale of the feature map corresponding to each neuron is counted to obtain the distribution relationship.
  • the location attribute represents the convolutional layer to which each neuron belongs. In other words, the location attribute determines which convolutional layer the neuron belongs to.
  • the distribution relationship represents the correspondence between each feature map and the neurons passed by the feature map. That is, the distribution relationship can determine which neurons should be used for processing and calculation of each feature map.
  • Step S300 according to the assignment relationship, assign the passed neuron to each feature map.
  • the above-disclosed allocation method filters neurons according to the importance of neurons in multiple convolutional layers in the image processing model, and then according to the position of each neuron in the first result of the screening, To determine the scale of the feature map corresponding to each neuron (that is, to determine the feature map to be processed by each neuron), so as to obtain the corresponding distribution relationship. Finally, according to the determined distribution relationship, the distribution between each feature map and the neurons it passes through is performed, so as to achieve the purpose of assigning neurons to each feature map based on the importance of the neurons.
  • This allocation method is data-driven, and the allocation relationship determined for different data sets is different. Compared with the method set by human experience in the related technology, the allocation method of the embodiment of the present disclosure makes the final allocation of each feature map The neurons are more precise.
  • the distribution method provided in the embodiments of the present disclosure can be executed by any suitable device with data processing capabilities, including but not limited to: terminal devices and servers.
  • it may also be executed by the processor, for example, the processor executes any of the allocation methods mentioned in the embodiments of the present disclosure by calling corresponding instructions stored in the memory. I won't repeat it below.
  • the processor may be a general-purpose processor or an artificial intelligence processor.
  • the image processing model can be the first type of network structure.
  • the first type of network structure is a network structure that introduces multi-scale feature maps by adding residuals between feature maps of different depths to combine shallow feature maps and deep feature maps.
  • the image processing model can also be a second type of network structure.
  • the second type of network structure is a network structure that uses different convolution kernels at the same depth to introduce multi-scale feature maps.
  • the image processing model can also be a third type of network structure.
  • the third type of network structure is; a network structure including any of the aforementioned network modules (ie, a network structure with a certain depth constructed by repeatedly stacking network modules).
  • the image processing model may include any of the aforementioned network modules.
  • the number of network modules is at least one.
  • the image processing model is trained to obtain the scale parameter of the batchnorm layer in the image processing model.
  • the batchnorm layer is used for normalization, and the scale parameter represents the importance of neurons in the convolutional layer in each branch of the network module.
  • the allocation method of the embodiment of the present disclosure can be applied to an image processing model including any of the network modules described above.
  • the multiple convolutional layers may be the first convolutional layer in each branch of the second network layer in the network module and the second convolutional layer in the original scale branch.
  • multiple convolutional layers at the same depth in the image processing model can be the network module, and the second network layer in each branch A convolutional layer, and/or the second convolutional layer in the original proportional branch in the second network layer.
  • the number of network modules is at least one.
  • the allocation of neurons is based on the multiple convolutional layers (such as the first convolutional layer and the second convolutional layer) in each network module (block) Distribution by neurons.
  • multiple network modules can be stacked in sequence to construct an image processing model. That is, multiple network modules can be set in series, and a corresponding network layer can be set between every two adjacent network modules according to actual needs. There is no specific limitation here.
  • the neuron allocation process of multiple convolutional layers in 20 blocks can be performed simultaneously or sequentially. There is no limitation here.
  • filtering neurons according to the importance of neurons in multiple convolutional layers in the image processing model to obtain the first result may include:
  • the neurons of the multiple convolutional layers are sorted to obtain the first sequence.
  • the first sequence represents the arrangement order of neurons in multiple convolutional layers.
  • the number of neurons to be used for processing multiple feature maps is determined.
  • the required neurons are sequentially extracted from the first sequence to obtain the first result.
  • the scale parameter of the batchnorm layer learned by the pre-training of the image processing model is used as the criterion, and the neurons in multiple convolutional layers (here can be all neurons in multiple convolutional layers) are sorted ( Wherein, the arrangement order can be arranged in order from high to low) to obtain the corresponding first sequence.
  • the number of neurons (number of neurons to be used) required to process multiple feature maps is determined according to the preset calculation amount (ie, the amount of calculation actually required), and according to the determined number of neurons to be used, the first In a sequence, the required neurons are extracted in sequence according to the order of the neurons. Among them, the number of extracted neurons required is consistent with the number of neurons to be used.
  • multiple neurons are allocated competitively and adaptively, which effectively improves the accuracy of neuron allocation, and also Effectively improve the rationality of neuron allocation.
  • any of the above-mentioned allocation method embodiments when assigning the passed neurons to each feature map according to the assignment relationship, it may include: retaining the required neurons and deleting the undesired neurons. The operation of the neuron is required.
  • the allocation relationship determine the first network structure of the image processing model, and train the image processing model of the first network structure to achieve the purpose of optimizing the image processing model, so that the final image processing model is used in classification and detection tasks Can have higher accuracy.
  • the following takes the image processing model including a network module, and the network module is the network structure shown in FIG. 3 as an example, for a clearer and detailed description.
  • the second network layer of the network module shown in FIG. 3 includes an original scale branch and two branches (the first branch and the second branch). Among them, the original proportional branch, the first branch and the second branch are all set in parallel.
  • the original scale branch contains a 3*3 convolutional layer (that is, the second convolutional layer, 3*3conv), and the first branch and the second branch respectively include the first sampling layer (maximum pooling Layer, max pool), the first convolutional layer (3*3conv) and the second sampling layer (upsample).
  • the image processing model it is mainly to assign neurons of two first convolutional layers and one second convolutional layer in the network modules it contains.
  • the number of neurons in the second convolutional layer in the original proportional branch is 10 (respectively neuron 1, neuron 2, neuron 3...neuron 10), and the number of neurons in the first branch
  • the number of neurons in the first convolutional layer is also 10 (respectively neuron 11, neuron 12, neuron 13...neuron 20), and the number of neurons in the first convolutional layer in the second branch
  • the number can also be 10 (respectively neuron 21, neuron 22, neuron 23...neuron 30).
  • the number of branches of the second network layer is three (original scale branch, first branch and second branch)
  • the number of feature maps constructed by it is also three.
  • the scale of the feature map in the original scale branch is the original scale
  • the scale of the feature map constructed in the first branch is the first scale
  • the scale of the feature map constructed in the second branch is the second scale.
  • the 30 neurons are sorted according to the scale parameter to obtain a neuron sequence (ie, the first sequence).
  • the obtained first sequence is: neuron 1, neuron 2, neuron 3, neuron 4,..., neuron 28, neuron 29, neuron 30.
  • the preset calculation amount it is determined that the number of neurons (that is, the number of neurons to be used) required for the image processing model in this embodiment to process the feature maps of the above three different scales is 15. Therefore, according to the determined number of neurons to be used, the required neurons (respectively: neuron 1, neuron 2, neuron 3, neuron Element 4,..., neuron 14, neuron 15), so as to get the first result.
  • the scale of the feature map corresponding to each neuron is counted to obtain the distribution relationship. That is, according to the respective positions of neuron 1, neuron 2, neuron 3, neuron 4,..., neuron 14, neuron 15, the scale of the feature map corresponding to each neuron is determined. In other words, determine which branch each neuron belongs to according to its location attribute. Among them, it can be determined that neuron 1 to neuron 10 belong to the original scale branch, the scale of the feature map corresponding to these 10 neurons is the original scale, and neuron 10 to neuron 15 belong to the first branch, and these 5 neurons The scale of the corresponding feature map is the first scale. Therefore, the corresponding distribution relationship (that is, the scale of the feature map corresponding to each of neuron 1 to neuron 15) can be obtained.
  • the neurons passed by each feature map can be assigned according to the assignment relationship. That is, neuron 1 to neuron 15 are retained, and the second branch including neuron 20 to neuron 30 is deleted. That is, the second branch of the feature map of the second scale is discarded.
  • the allocation of neurons in the network module in this embodiment can be completed.
  • the allocation method of the embodiment of the present disclosure allocates neurons to each feature map with different scales according to the importance of neurons in multiple convolutional layers at the same depth in the image processing model, so that multiple Neurons can be allocated competitively and adaptively, thereby effectively improving the accuracy and rationality of the allocation results, and also optimizing the network structure of the image processing model, so that the optimized image processing model can be retrained and applied For classification and detection tasks, it can effectively improve the accuracy of classification and detection.
  • the writing order of the steps does not mean a strict execution order but constitutes any limitation on the implementation process.
  • the specific execution order of each step should be based on its function and possibility.
  • the inner logic is determined.
  • the present disclosure also provides distribution devices, electronic equipment, computer-readable storage media, and programs. All of the above can be used to implement any distribution method provided in the present disclosure. The corresponding technical solutions and descriptions and the corresponding records in the method section are not provided. Repeat it again.
  • FIG. 5 shows a block diagram of an allocating device 100 according to an embodiment of the present disclosure.
  • the allocating device 100 is configured to allocate each of the feature maps when there are multiple feature maps in the image processing model.
  • the screening module 110 is configured to screen the neurons according to the importance of the neurons in the multiple convolutional layers in the image processing model to obtain a first result
  • multiple convolutional layers are at the same depth of the image processing model.
  • Each convolutional layer is used to process the feature maps of different scales
  • the first result contains multiple neurons
  • the statistics module 120 is configured to count the scale of the feature map corresponding to each neuron according to the location attribute of each neuron in the first result to obtain the distribution relationship;
  • the location attribute represents the convolutional layer to which each neuron belongs
  • the assignment relationship represents the correspondence between each feature map and the neurons passed by the feature map
  • the allocation module 130 is configured to allocate the passed neuron to each of the feature maps according to the allocation relationship.
  • it also includes:
  • the model building module is used to determine the number of branches in each network module before the screening module screens the neurons according to the importance of the neurons in the multiple convolutional layers in the image processing model, and The preset number of the network modules constructs the image processing model;
  • the first training module is used to train the image processing model to obtain the scale parameter of the batchnorm layer in the image processing model
  • the scale parameter represents the importance of neurons in the convolutional layer in each branch of the network module.
  • the screening module 110 includes:
  • a sorting sub-module configured to sort the neurons of the multiple convolutional layers according to the scale parameter of the batchnorm layer obtained by pre-training the image processing model to obtain the first sequence
  • the first sequence represents an arrangement order of neurons in the multiple convolutional layers
  • the neuron number determining sub-module is used to determine the number of neurons to be used for processing multiple feature maps according to a preset calculation amount
  • the neuron extraction sub-module is configured to sequentially extract the required neurons from the first sequence according to the determined number of the neurons to be used, to obtain the first result.
  • it also includes:
  • the network structure determination module is configured to determine the first network structure of the image processing model according to the assignment relationship after the assignment module assigns the passed neurons to each of the feature maps according to the assignment relationship ;
  • the second training module is used to train the image processing model of the first network structure.
  • the functions or modules contained in the device provided in the embodiments of the present disclosure can be used to execute the methods described in the above method embodiments.
  • the functions or modules contained in the device provided in the embodiments of the present disclosure can be used to execute the methods described in the above method embodiments.
  • brevity, here No longer refer to the description of the above method embodiments.
  • the embodiment of the present disclosure also proposes a computer-readable storage medium on which computer program instructions are stored, and when the computer program instructions are executed by a processor, any of the foregoing allocation methods is implemented.
  • the computer-readable storage medium may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium.
  • An embodiment of the present disclosure also provides an electronic device, including: a processor; a memory for storing executable instructions of the processor; wherein the processor is configured to execute any of the foregoing allocation methods.
  • the embodiment of the present disclosure also proposes a computer program, the computer program includes computer readable code, and when the computer readable code runs in an electronic device, a processor in the electronic device executes the above method.
  • the electronic device can be provided as a terminal, server or other form of device.
  • Fig. 6 is a block diagram showing an electronic device 800 according to an exemplary embodiment.
  • the electronic device 800 may be a mobile phone, a computer, a digital broadcasting terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, and other terminals.
  • the electronic device 800 may include one or more of the following components: a processing component 802, a memory 804, a power supply component 806, a multimedia component 808, an audio component 810, an input/output (I/O) interface 812, and a sensor component 814 , And communication component 816.
  • the processing component 802 generally controls the overall operations of the electronic device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations.
  • the processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the foregoing method.
  • the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components.
  • the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
  • the memory 804 is configured to store various types of data to support operations in the electronic device 800. Examples of these data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, pictures, videos, etc.
  • the memory 804 can be implemented by any type of volatile or nonvolatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Magnetic Memory, Flash Memory, Magnetic Disk or Optical Disk.
  • SRAM static random access memory
  • EEPROM electrically erasable programmable read-only memory
  • EPROM erasable Programmable Read Only Memory
  • PROM Programmable Read Only Memory
  • ROM Read Only Memory
  • Magnetic Memory Flash Memory
  • Magnetic Disk Magnetic Disk or Optical Disk.
  • the power supply component 806 provides power for various components of the electronic device 800.
  • the power supply component 806 may include a power management system, one or more power supplies, and other components associated with the generation, management, and distribution of power for the electronic device 800.
  • the multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user.
  • the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user.
  • the touch panel includes one or more touch sensors to sense touch, sliding, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure related to the touch or slide operation.
  • the multimedia component 808 includes a front camera and/or a rear camera. When the electronic device 800 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera can receive external multimedia data. Each front camera and rear camera can be a fixed optical lens system or have focal length and optical zoom capabilities.
  • the audio component 810 is configured to output and/or input audio signals.
  • the audio component 810 includes a microphone (MIC).
  • the microphone is configured to receive external audio signals.
  • the received audio signal may be further stored in the memory 804 or transmitted via the communication component 816.
  • the audio component 810 further includes a speaker for outputting audio signals.
  • the I/O interface 812 provides an interface between the processing component 802 and a peripheral interface module.
  • the peripheral interface module may be a keyboard, a click wheel, a button, and the like. These buttons may include but are not limited to: home button, volume button, start button, and lock button.
  • the sensor component 814 includes one or more sensors for providing the electronic device 800 with various aspects of state evaluation.
  • the sensor component 814 can detect the on/off status of the electronic device 800 and the relative positioning of the components.
  • the component is the display and the keypad of the electronic device 800.
  • the sensor component 814 can also detect the electronic device 800 or the electronic device 800.
  • the position of the component changes, the presence or absence of contact between the user and the electronic device 800, the orientation or acceleration/deceleration of the electronic device 800, and the temperature change of the electronic device 800.
  • the sensor component 814 may include a proximity sensor configured to detect the presence of nearby objects when there is no physical contact.
  • the sensor component 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications.
  • the sensor component 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.
  • the communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices.
  • the electronic device 800 can access a wireless network based on a communication standard, such as WiFi, 2G, or 3G, or a combination thereof.
  • the communication component 816 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel.
  • the communication component 816 further includes a near field communication (NFC) module to facilitate short-range communication.
  • the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
  • RFID radio frequency identification
  • IrDA infrared data association
  • UWB ultra-wideband
  • Bluetooth Bluetooth
  • the electronic device 800 can be implemented by one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field A programmable gate array (FPGA), controller, microcontroller, microprocessor, or other electronic components are implemented to implement the above methods.
  • ASIC application specific integrated circuits
  • DSP digital signal processors
  • DSPD digital signal processing devices
  • PLD programmable logic devices
  • FPGA field A programmable gate array
  • controller microcontroller, microprocessor, or other electronic components are implemented to implement the above methods.
  • a non-volatile computer-readable storage medium such as the memory 804 including computer program instructions, which can be executed by the processor 820 of the electronic device 800 to complete the foregoing method.
  • Fig. 7 is a block diagram showing an electronic device 1900 according to an exemplary embodiment.
  • the electronic device 1900 may be provided as a server.
  • the electronic device 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions executable by the processing component 1922, such as application programs.
  • the application program stored in the memory 1932 may include one or more modules each corresponding to a set of instructions.
  • the processing component 1922 is configured to execute instructions to perform the above-described methods.
  • the electronic device 1900 may also include a power supply component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input output (I/O) interface 1958 .
  • the electronic device 1900 can operate based on an operating system stored in the memory 1932, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM or the like.
  • a non-volatile computer-readable storage medium such as the memory 1932 including computer program instructions, which can be executed by the processing component 1922 of the electronic device 1900 to complete the foregoing method.
  • the present disclosure may be a system, method, and/or computer program product.
  • the computer program product may include a computer-readable storage medium loaded with computer-readable program instructions for enabling a processor to implement various aspects of the present disclosure.
  • the computer-readable storage medium may be a tangible device that can hold and store instructions used by the instruction execution device.
  • the computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing.
  • Computer-readable storage media include: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM) Or flash memory), static random access memory (SRAM), portable compact disk read-only memory (CD-ROM), digital versatile disk (DVD), memory stick, floppy disk, mechanical encoding device, such as a printer with instructions stored thereon
  • RAM random access memory
  • ROM read-only memory
  • EPROM erasable programmable read-only memory
  • flash memory flash memory
  • SRAM static random access memory
  • CD-ROM compact disk read-only memory
  • DVD digital versatile disk
  • memory stick floppy disk
  • mechanical encoding device such as a printer with instructions stored thereon
  • the computer-readable storage medium used here is not interpreted as a transient signal itself, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (for example, light pulses through fiber optic cables), or through wires Transmission of electrical signals.
  • the computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to various computing/processing devices, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and/or a wireless network.
  • the network may include copper transmission cables, optical fiber transmission, wireless transmission, routers, firewalls, switches, gateway computers, and/or edge servers.
  • the network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network, and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing/processing device .
  • the computer program instructions used to perform the operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, status setting data, or in one or more programming languages.
  • Source code or object code written in any combination, the programming language includes object-oriented programming languages such as Smalltalk, C++, etc., and conventional procedural programming languages such as "C" language or similar programming languages.
  • Computer-readable program instructions can be executed entirely on the user's computer, partly on the user's computer, executed as a stand-alone software package, partly on the user's computer and partly executed on a remote computer, or entirely on the remote computer or server carried out.
  • the remote computer can be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (for example, using an Internet service provider to access the Internet connection).
  • LAN local area network
  • WAN wide area network
  • an electronic circuit such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), can be customized by using the status information of the computer-readable program instructions.
  • the computer-readable program instructions are executed to realize various aspects of the present disclosure.
  • These computer-readable program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine such that when these instructions are executed by the processor of the computer or other programmable data processing device , A device that implements the functions/actions specified in one or more blocks in the flowchart and/or block diagram is produced. It is also possible to store these computer-readable program instructions in a computer-readable storage medium. These instructions make computers, programmable data processing apparatuses, and/or other devices work in a specific manner, so that the computer-readable medium storing instructions includes An article of manufacture, which includes instructions for implementing various aspects of the functions/actions specified in one or more blocks in the flowchart and/or block diagram.
  • each block in the flowchart or block diagram may represent a module, program segment, or part of an instruction, and the module, program segment, or part of an instruction contains one or more functions for implementing the specified logical function.
  • Executable instructions may also occur in a different order from the order marked in the drawings. For example, two consecutive blocks can actually be executed in parallel, or they can sometimes be executed in the reverse order, depending on the functions involved.
  • each block in the block diagram and/or flowchart, and the combination of the blocks in the block diagram and/or flowchart can be implemented by a dedicated hardware-based system that performs the specified functions or actions Or it can be realized by a combination of dedicated hardware and computer instructions.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Artificial Intelligence (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Health & Medical Sciences (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Mathematical Physics (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Multimedia (AREA)
  • Probability & Statistics with Applications (AREA)
  • Neurology (AREA)
  • Image Analysis (AREA)

Abstract

本公开涉及一种网络模块和分配方法及装置、电子设备和存储介质,其中,网络模块包括依次级联的第一网络层、第二网络层和第三网络层;其中,第一网络层,用于对输入的图像进行处理,得到第一特征图;第二网络层包括多个并行的分支;每个分支包括第一采样层;第一采样层,用于对第一特征图进行下采样,得到第二特征图;其中,不同分支中的第一采样层得到的第二特征图的尺度不同;第三网络层,用于将每个分支输出的特征图数据合并。本公开实施例可达到在网络模块中直接构建多个不同尺度的特征图的目的。

Description

网络模块和分配方法及装置、电子设备和存储介质
本申请要求在2019年2月25日提交中国专利局、申请号为201910139007.4、发明名称为“网络模块和分配方法及装置、电子设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本公开涉及计算机视觉技术领域,尤其涉及一种网络模块和分配方法及装置、电子设备和存储介质。
背景技术
计算机视觉是人工智能的重要组成部分,而图片分类则是计算机视觉的基础,因此,一个好的分类网络可以作为主干网络来执行支持、分割、追踪等任务。近年来,特征聚合已经成为一种非常有效的视觉识别网络的设计方法。
发明内容
本公开提出了一种网络模块和分配方法及装置、电子设备和存储介质。
根据本公开的一方面,提供了一种网络模块,包括:
依次级联的第一网络层、第二网络层和第三网络层;
其中,所述第一网络层,用于对输入的图像进行处理,得到第一特征图;
所述第二网络层包括多个并行的分支;
每个分支包括第一采样层;
所述第一采样层,用于对所述第一特征图进行下采样,得到第二特征图;
其中,不同所述分支中的所述第一采样层得到的所述第二特征图的尺度不同;
所述第三网络层,用于将每个所述分支输出的特征图数据合并。
在一种可能的实现方式中,所述第一采样层为池化层。
在一种可能的实现方式中,所述池化层为最大池化层。
在一种可能的实现方式中,每个分支还包括与所述第一采样层依次级联的第一卷积层和第二采样层;
所述第一卷积层,用于对所述第二特征图进行卷积操作,得到第三特征图;
所述第二采样层,用于将所述第三特征图的尺度恢复为所述第一特征图的尺度。
在一种可能的实现方式中,所述第二网络层还包括原比例分支;所述原比例分支包括第二卷积层;
所述第二卷积层,用于对所述第一特征图进行卷积操作,并将经过卷积操作得到的特征图数据输入至所述第三网络层;
所述第三网络层,还用于将所述第二网络层中所述多个并行的分支输出的特征图数 据和每个所述原比例分支输出的特征图数据合并。
根据本公开的一方面,还提供了一种分配方法,用于在图像处理模型中存在多张特征图时,对每张所述特征图分配所通过的神经元,所述图像处理模型中包括至少一个前面任意所述的网络模块;所述方法包括:
根据所述图像处理模型中多个卷积层的神经元的重要性,对所述神经元进行筛选,得到第一结果;
其中,多个卷积层处于所述图像处理模型的同一深度,且
每个卷积层分别用于处理不同尺度的所述特征图;
所述第一结果中包含有多个神经元;
根据所述第一结果中每个神经元的位置属性,统计每个所述神经元所对应的所述特征图的尺度,得到分配关系;
其中,所述位置属性表征每一个神经元所属的卷积层;
所述分配关系,表征每张所述特征图与所述特征图所通过的神经元之间的对应关系;
根据所述分配关系,对每张所述特征图分配所通过的神经元。
在一种可能的实现方式中,在根据所述图像处理模型中多个卷积层的神经元的重要性,对所述神经元进行筛选之前,还包括:
确定各个网络模块中的分支数量,并根据预设的所述网络模块的个数构建所述图像处理模型;
对所述图像处理模型进行训练,得到所述图像处理模型中batchnorm层的scale参数;
其中,所述scale参数表征所述网络模块中各个分支中的卷积层的神经元的重要性。
在一种可能的实现方式中,所述根据所述图像处理模型中多个卷积层的神经元的重要性,对所述神经元进行筛选,得到第一结果,包括:
根据对所述图像处理模型进行预先训练得到的batchnorm层的scale参数,对多个所述卷积层的神经元进行排序,得到第一序列;
其中,所述第一序列表征多个所述卷积层中的神经元的排列顺序;
根据预设计算量,确定用于处理多张所述特征图的待用神经元数量;
根据确定的所述待用神经元数量,由所述第一序列中依次提取出所需神经元,得到所述第一结果。
在一种可能的实现方式中,在根据所述分配关系,对每张所述特征图分配所通过的神经元后,还包括:
根据所述分配关系,确定所述图像处理模型的第一网络结构;
对所述第一网络结构的图像处理模型进行训练。
根据本公开的一方面,还提供了一种分配装置,用于在图像处理模型中存在多张特征图时,对每张所述特征图分配所通过的神经元,所述图像处理模型中包括至少一个前面任一所述的网络模块;所述装置包括:
筛选模块,用于根据所述图像处理模型中多个卷积层的神经元的重要性,对所述神 经元进行筛选,得到第一结果;
其中,多个卷积层处于所述图像处理模型的同一深度,且
每个卷积层分别用于处理不同尺度的所述特征图;
所述第一结果中包含有多个神经元;
统计模块,用于根据所述第一结果中每个神经元的位置属性,统计每个所述神经元所对应的所述特征图的尺度,得到分配关系;
其中,所述位置属性表征每一个神经元所属的卷积层;
所述分配关系,表征每张所述特征图与所述特征图所通过的神经元之间的对应关系;
分配模块,用于根据所述分配关系,对每张所述特征图分配所通过的神经元。
在一种可能的实现方式中,还包括:
模型构建模块,用于在所述筛选模块根据所述图像处理模型中多个卷积层的神经元的重要性,对所述神经元进行筛选之前,确定各个网络模块中的分支数量,并根据预设的所述网络模块的个数构建所述图像处理模型;
第一训练模块,用于对所述图像处理模型进行训练,得到所述图像处理模型中batchnorm层的scale参数;
其中,所述scale参数表征所述网络模块中各个分支中的卷积层的神经元的重要性。
在一种可能的实现方式中,所述筛选模块包括:
排序子模块,用于根据对所述图像处理模型进行预先训练得到的batchnorm层的scale参数,对多个所述卷积层的神经元进行排序,得到第一序列;
其中,所述第一序列表征多个所述卷积层中的神经元的排列顺序;
神经元数量确定子模块,用于根据预设计算量,确定用于处理多张所述特征图的待用神经元数量;
神经元提取子模块,用于根据确定的所述待用神经元数量,由所述第一序列中依次提取出所需神经元,得到所述第一结果。
在一种可能的实现方式中,还包括:
网络结构确定模块,用于在所述分配模块根据所述分配关系,对每张所述特征图分配所通过的神经元后,根据所述分配关系,确定所述图像处理模型的第一网络结构;
第二训练模块,用于对所述第一网络结构的图像处理模型进行训练。
根据本公开的一方面,还提供了一种电子设备,包括:
处理器;
用于存储处理器可执行指令的存储器;
其中,所述处理器被配置为:执行前面任一所述的方法。
根据本公开的一方面,提供了一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述分配方法。
根据本公开的一方面,提供了一种计算机程序,所述计算机程序包括计算机可读代码,当所述计算机可读代码在电子设备中运行时,所述电子设备中的处理器执行上述分 配方法。
在本公开实施例中,通过设置上述网络模块,在网络模块中的第二网络层中搭建多个并行的分支,由各个分支中的第一采样层对由第一网络层输出的第一特征图进行下采样,以使各个不同的第一采样层构建具有不同尺度的第二特征图,从而达到在网络模块中直接构建多个不同尺度的特征图的目的。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,而非限制本公开。
根据下面参考附图对示例性实施例的详细说明,本公开的其它特征及方面将变得清楚。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,这些附图示出了符合本公开的实施例,并与说明书一起用于说明本公开的技术方案。
图1示出根据本公开实施例的网络模块的结构示意图;
图2示出根据本公开另一实施例的网络模块的结构示意图;
图3示出根据本公开又一实施例的网络模块的结构示意图;
图4示出根据本公开实施例的分配方法的流程图;
图5示出根据本公开实施例的分配装置的框图;
图6示出根据本公开实施例的电子设备的框图;
图7示出根据本公开实施例的电子设备的框图。
具体实施方式
以下将参考附图详细说明本公开的各种示例性实施例、特征和方面。附图中相同的附图标记表示功能相同或相似的元件。尽管在附图中示出了实施例的各种方面,但是除非特别指出,不必按比例绘制附图。
在这里专用的词“示例性”意为“用作例子、实施例或说明性”。这里作为“示例性”所说明的任何实施例不必解释为优于或好于其它实施例。
本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中术语“至少一种”表示多种中的任意一种或多种中的至少两种的任意组合,例如,包括A、B、C中的至少一种,可以表示包括从A、B和C构成的集合中选择的任意一个或多个元素。
另外,为了更好地说明本公开,在下文的具体实施方式中给出了众多的具体细节。本领域技术人员应当理解,没有某些具体细节,本公开同样可以实施。在一些实例中,对于本领域技术人员熟知的方法、手段、元件和电路未作详细描述,以便于凸显本公开的主旨。
图1示出了根据本公开实施例的网络模块的结构示意图。
参阅图1,本公开实施例的网络模块包括依次级联的第一网络层、第二网络层和第三网络层。其中,第一网络层,用于对输入的图像进行处理,得到第一特征图。第二网络层包括多个并行的分支,每个分支均包括有第一采样层。第一采样层,用于对第一特征图进行下采样,得到第二特征图。其中,不同分支中的第一采样层得到的第二特征图的尺度不同。第三网络层,则用于将每个分支输出的特征图数据合并,以便于位于第三网络层下一级的网络层能够继续进行图像处理操作。此处,需要指出的是,第三网络层可以为拼接(concatenate)层。
由此,通过设置上述网络模块,在网络模块中的第二网络层中搭建多个并行的分支,由各个分支中的第一采样层对由第一网络层输出的第一特征图进行下采样,以使各个不同的第一采样层构建具有不同尺度的第二特征图,从而达到在网络模块中直接构建多个不同尺度的特征图的目的。
相较于相关技术中,通过连接不同深度的特征图和在网络的同一深度运用不同的卷积核这两种方式,本公开实施例的网络模块,能够通过各个分支中的第一采样层直接进行不同尺度的特征图的构建,即,通过下采样操作来构造各种尺度的特征图,这就使得采用本公开实施例的网络模块,可以根据实际情况构建各种不同尺度的特征图。因此,这也就有效的提高了特征图的多样性,并且还能够使得所获得的特征图的尺度变化范围更大更多样。同时,多分支的设置还带来了更多样的感受野,使得网络模块在应用于分类和检测任务时能够有效提升分类和检测的精度。
其中,需要说明的是,在上述网络模块的第二网络层中所设置的分支的数量可以根据实际情况进行具体设置。如:分支数量可以为两个、三个或者是五个、十个等。也就是说,本公开实施例的网络模块中,第二网络层中的分支数量可以根据其具体的计算量来进行确定。因此,此处不对分支的数量进行限定。
另外,还需要说明的是,在本公开实施例中所提及的特征图的尺度,可以为特征图的物理尺寸大小,还可以为图像的有效部分的尺寸大小(例如,虽然图像的物理大小尺寸相同,但该图像的部分像素的像素值已经采用但不限于置零等方式处理,除了这些处理后的像素的其他像素组成的部分相当于有效部分,有效部分的尺寸相对图像的物理尺寸较小)等,但不限于此。
在一种可能的实现方式中,第一采样层可以为池化层,还可以为其他能够对图像进行各种操作(如:放大、缩小等)的网络层。也就是说,第一采样层只要能够对第一特征图进行处理,使得处理后得到的第二特征图能够具有不同的尺度即可。这也就有效的提高了本公开实施例的网络模块在结构上的灵活性,从而更加便于构建网络模块。
图2示出了根据本公开另一实施例的网络模块的结构示意图。
参阅图2,在一种可能的实现方式中,在第一采样层为池化层时,池化层可以为最大 池化层(max pool)。即,第一采样层通过最大池化层来实现。其中,第一网络层可以为卷积层,卷积层的卷积核可以为1*1大小(即,1*1卷积层)。由此,由第一网络层(如:1*1卷积层)对输入的图像进行处理后,得到相应的第一特征图。此时,第一特征图具有第一尺度。然后,再由第二网络层中各个分支的第一采样层(如:最大池化层)对具有第一尺度的第一特征图进行下采样(即,由最大池化层对第一特征图进行最大值池化处理),得到具有不同尺度的第二特征图,从而实现了直接在网络模块中构建具有不同尺度的特征图的目的。
通过采用最大池化层作为第一采样层对第一特征图进行下采样,由于最大池化能够有效减小特征图尺寸,从而对应小尺度的分支中后续的图像处理操作(如:卷积操作)会耗费更少的计算量,这也就有效减小了各个分支中的计算量,降低了功耗。
在一种可能的实现方式中,每个分支还包括与第一采样层依次级联的第一卷积层和第二采样层。其中,第一卷积层,用于对第二特征图进行卷积操作,得到第三特征图。此处,需要指出的是,第一卷积层可以为具有不同大小卷积核的卷积层(如:3*3卷积层,3*3conv)。并且,各个分支中的第一卷积层的卷积核大小可以相同,也可以不同。第二采样层,则用于将第三特征图的尺度恢复为第一特征图的尺度。需要指出的是,第二采样层可以为上采样(upsample)层。
也就是说,在每个第一采样层对第一特征图进行下采样,获得具有不同尺度的第二特征图后,再通过第一卷积层对不同尺度的第二特征图进行卷积操作,以实现对特征图的卷积处理。
同时,由于第一采样层对第一特征图的下采样操作,使得获得的第二特征图相较于第一特征图的尺度有所变化,而在每个分支中,通过第一卷积层对第二特征图进行卷积操作得到的第三特征图的尺度与第二特征图的尺度也有可能会发生变化,因此为了后续能够顺利的执行图像的其他处理,此时还需要由第二采样层对第三特征图进行上采样操作,使得第三特征图的尺度恢复为原始尺度(即,第一特征图的尺度)。
由此,本公开实施例的网络模块通过上采样和下采样操作实现了不同尺度的特征图的构建,从而可以有效且高效的提取多尺度特征。
图3示出了根据本公开又一实施例的网络模块的结构示意图。
参阅图3,本公开实施例的网络模块,第二网络层还可以包括原比例分支。其中,原比例分支与上文中的多个并行的分支之间是并行关系,原比例分支不改变第一特征图的尺度。其中,原比例分支中包括有第二卷积层,第二卷积层用于对第一特征图进行卷积操作,并将经过卷积操作得到的特征图数据输入至第三网络层中,卷积得到的特征数据与第一特征图尺度相同。此处,需要说明的是,第二卷积层可以为3*3卷积层(即,3*3conv)。对应的,第三网络层,还用于将第二网络层中多个并行的分支输出的特征图数据和原比例分支输出的特征图数据合并。
即,通过在第二网络层中设置原比例分支,由原比例分支中的第二卷积层直接对第一特征图进行卷积操作,在有效增加特征图的尺度的基础上,还进一步的保障了对原始尺度的第一特征图的处理,这也就提升了处理图像数据的完整性和准确性,避免了第一特征图中的部分特征的缺失。
另外,还需要指出的是,本公开实施例的网络模块可以作为神经网络结构中的最小基本单元(可以简称为:block)。即,可以通过重复堆叠上述任一种网络模块(block)来构建具有不同深度的网络结构。其中,所构建的网络结构可以为卷积神经网络。
根据本公开的另一方面,还提供了一种分配方法。本公开的分配方法用于在图像处理模型中存在多张特征图时,对每张特征图分配其所通过的神经元。其中,每张特征图具有不同的尺度。图像处理模型可以为卷积神经网络模型。
图4示出根据本公开实施例的分配方法的流程图。参阅图4,本公开的分配方法包括:
步骤S100,根据图像处理模型中多个卷积层的神经元的重要性,对神经元进行筛选,得到第一结果。其中,需要指出的是,此处的多个卷积层处于图像处理模型的同一深度(即,多个卷积层位于图像处理模型的同一层),并且每个卷积层分别用于处理不同尺度的特征图。同时,第一结果中包含有多个神经元。
步骤S200,根据第一结果中每个神经元的位置属性,统计每个神经元所对应的特征图的尺度,得到分配关系。其中,位置属性表征每个神经元所属的卷积层。也就是说,通过位置属性确定神经元是属于哪一个卷积层的。分配关系,则表征了每张特征图与该特征图所通过的神经元之间的对应关系。即,通过分配关系可以确定每张特征图应该通过哪些神经元进行处理计算。
步骤S300,根据分配关系,对每张特征图分配所通过的神经元。
由此,上述公开的分配方法,通过根据图像处理模型中多个卷积层的神经元的重要性,对神经元进行筛选,进而再根据筛选得到的第一结果中每个神经元的位置,来确定每个神经元所对应的特征图的尺度(即,确定每个神经元所要处理的特征图),从而得到对应的分配关系。最后,再根据所确定的分配关系进行每张特征图与其所通过的神经元之间的分配,实现了基于神经元重要性来对每张特征图进行神经元的分配的目的。这种分配方式是数据驱动的,针对不同的数据集所确定的分配关系不同,相较于相关技术中人为经验设置的方式,本公开实施例的分配方法,使得最终对每张特征图所分配的神经元更加精确。
其中,需要指出的是,本公开实施例提供的分配方法可以由任意适当的具有数据处理能力的设备执行,包括但不限于:终端设备和服务器等。或者,还可以由处理器执行,如处理器通过调用存储器存储的相应指令来执行本公开施例提及的任一种分配方法。下文不再赘述。其中,处理器可以为通用处理器,还可以为人工智能处理器。
另外,还需要指出的是,本公开实施例的分配方法中,图像处理模型中应当存在多 张具有不同尺度的特征图。也就是说,图像处理模型可以为第一类型网络结构。第一类型网络结构为:通过在不同深度的特征图之间加入残差来结合浅层特征图和深层特征图的方式引入多尺度的特征图的网络结构。图像处理模型还可以为第二类型网络结构。第二类型网络结构为在同一个深度运用不同的卷积核来引入多尺度的特征图的网络结构。图像处理模型还可以为第三类型网络结构。第三类型网络结构为;包括前面任一所述的网络模块(block)的网络结构(即,通过重复堆叠网络模块构建的具有一定深度的网络结构)。
在一种可能的实现方式中,图像处理模型中可以包括前面任一所述的网络模块。其中,网络模块的个数至少为一个。
由此,在根据图像处理模型中多个卷积层的神经元的重要性,对神经元进行筛选之前,还可以包括:
确定各个网络模块中的分支数量,从而根据所确定的网络模块中的分支数量构建网络模块。再根据预先设置的网络模块的个数构建图像处理模型。其中,各个网络模型中的分支数量可以根据实际情况中所需要的计算量进行确定。
对图像处理模型进行训练,得到图像处理模型中batchnorm层的scale参数。其中,batchnorm层用于归一化处理,scale参数表征网络模块中各个分支中的卷积层的神经元的重要性。
即,本公开实施例的分配方法可以应用于包含有如上任一所述的网络模块的图像处理模型中。当图像处理模型中包含有网络模块时,多个卷积层可以为网络模块中第二网络层的各个分支中的第一卷积层以及原比例分支中的第二卷积层。
也就是说,在图像处理模型中包含有前面任一所述的网络模块时,图像处理模型中处于同一深度的多个卷积层可以为网络模块中,第二网络层中各个分支中的第一卷积层,和/或第二网络层中原比例分支中的第二卷积层。
此处,还需要指出的是,由于图像处理模型中包含前面任一所述的网络模块时,网络模块的个数至少为一个。在网络模块的个数为多个时,对神经元的分配则是基于每一个网络模块(block)中的多个卷积层(如:第一卷积层和第二卷积层)中的神经元进行的分配。还应当指出的是,在网络模块的个数为多个时,可以对多个网络模块依次堆叠来构建图像处理模型。即,可以对多个网络模块进行串联形式的设置,并且每相邻两个网络模块之间还可以根据实际情况需要设置相应的网络层。此处不进行具体限定。
如:在图像处理模型中包含有20个网络模块时(即,对20个block进行堆叠所构建的具有一定深度的网络结构),可以分别为20个block中的第二网络层的各个分支中的第一卷积层和原比例分支中的第二卷积层的神经元进行筛选分配。其中,20个block中的多个卷积层的神经元分配过程可以同时进行,也可以顺序进行。此处不进行限定。
在一种可能的实现方式中,根据图像处理模型中多个卷积层的神经元的重要性,对 神经元进行筛选,得到第一结果,可以包括:
根据对图像处理模型进行预先训练得到的batchnorm层的scale参数,对多个卷积层的神经元进行排序,得到第一序列。其中,第一序列表征多个卷积层中的神经元的排列顺序。
根据预设计算量,确定用于处理多张特征图的待用神经元数量。
根据确定的待用神经元数量,由第一序列中依次提取出所需神经元,得到第一结果。
即,以图像处理模型进行预先训练学习到的batchnorm层的scale参数作为评判标准,对多个卷积层中的神经元(此处可以为多个卷积层中的所有神经元)进行排序(其中,排列顺序可以为由高到低依次进行排列),得到相应的第一序列。同时,还根据预设计算量(即,实际所需要的计算量)确定处理多张特征图所需要的神经元数量(待用神经元数量),并根据确定的待用神经元数量,由第一序列中按照神经元的排列顺序依次提取出所需神经元。其中,所提取出的所需神经元的数量与待用神经元数量相一致。
由此,通过根据学习到的scale参数对多个卷积层的神经元进行选择,使得多个神经元被竞争性地和自适应地分配,有效地提高了神经元分配的精确性,并且还有效提高了神经元分配的合理性。
另外,还需要说明的是,在上述任一种分配方法的实施例中,在根据分配关系,对每张特征图分配所通过的神经元时,可以包括:保留所需神经元,删掉不需要的神经元的操作。
作为一种可能的实现方式,在根据分配关系对每张特征图分配所通过的神经元后,还可以包括:
根据分配关系,确定图像处理模型的第一网络结构,并对第一网络结构的图像处理模型进行训练,以达到优化图像处理模型的目的,使得最终所得到的图像处理模型在分类和检测任务中能够具有更高的精度。
为了更清楚的说明本公开实施例的分配方法的过程,以下以图像处理模型中包含有一个网络模块,且该网络模块为图3所示的网络结构为例,进行更加清楚详细的说明。
参阅图3,图3所示的网络模块的第二网络层包括有一个原比例分支和两个分支(第一分支和第二分之)。其中,原比例分支、第一分支和第二分之均为并行设置。原比例分支中包含有一个3*3卷积层(即,第二卷积层,3*3conv),第一分支和第二分支则分别包括有依次级联的第一采样层(最大池化层,max pool)、第一卷积层(3*3conv)和第二采样层(upsample)。对该图像处理模型进行神经元的分配时,主要是对其所包含的网络模块中的两个第一卷积层和一个第二卷积层的神经元进行分配。
其中,可以认为:原比例分支中的第二卷积层中的神经元个数为10个(分别为神经元1、神经元2、神经元3……神经元10),第一分支中的第一卷积层的神经元的个数也为 10个(分别为神经元11、神经元12、神经元13……神经元20),第二分支中的第一卷积层的神经元的个数同样也可以为10个(分别为神经元21、神经元22、神经元23……神经元30)。
同时,由于第二网络层的分支数量为三个(原比例分支、第一分支和第二分支),因此其所构建的特征图的数量也为三张。原比例分支中的特征图的尺度为原始尺度,第一分支中构建的特征图的尺度为第一尺度,第二分支中构建的特征图的尺度为第二尺度。
通过对该图像处理模型进行训练学习到batchnorm层的scale参数后,根据scale参数对这30个神经元进行排序,得到一个神经元序列(即,第一序列)。其中,所得到的第一序列为:神经元1、神经元2、神经元3、神经元4、……、神经元28、神经元29、神经元30。
再根据预设计算量,确定本实施例中的图像处理模型处理上述三种不同尺度的特征图所需要的神经元数量(即,待用神经元数量)为15个。因此,此时即可根据确定的待用神经元数量,由第一序列中按照神经元的排列顺序依次提取出所需神经元(分别为:神经元1、神经元2、神经元3、神经元4、……、神经元14、神经元15),从而得到第一结果。
根据第一结果中每个神经元的位置属性,统计每个神经元所对应的特征图的尺度,得到分配关系。即,分别根据神经元1、神经元2、神经元3、神经元4、……、神经元14、神经元15各自的位置,确定每个神经元所对应的特征图的尺度。也就是说,根据每个神经元的位置属性确定其属于哪个分支。其中,可以确定,神经元1至神经元10属于原比例分支,这10个神经元所对应的特征图的尺度为原始尺度,神经元10至神经元15属于第一分支,这5个神经元所对应的特征图的尺度则为第一尺度。因此,可以得到相应的分配关系(即,神经元1至神经元15各自分别所对应的特征图的尺度)。
待确定分配关系后,即可根据分配关系对每张特征图所通过的神经元进行分配。即,保留神经元1至神经元15,并删除包含有神经元20至神经元30的第二分支。也就是说,将构建第二尺度的特征图的第二分支丢弃。由此,即可完成对该实施例中的网络模块中的神经元的分配。
综述,本公开实施例的分配方法,通过根据图像处理模型中处于同一深度的多个卷积层的神经元的重要性,对每张具有不同尺度的特征图进行神经元的分配,使得多个神经元能够被竞争性地和自适应地分配,从而有效提高了分配结果的精确度和合理性,同时还优化了图像处理模型的网络结构,使得对优化后的图像处理模型进行再训练并应用于分类和检测任务时,能够有效提高分类和检测的精度。
可以理解,本公开提及的上述各个方法实施例,在不违背原理逻辑的情况下,均可以彼此相互结合形成结合后的实施例,限于篇幅,本公开不再赘述。
本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的撰写顺序并不意味着严格的执行顺序而对实施过程构成任何限定,各步骤的具体执行顺序应当以其功能和可能的内在逻辑确定。
此外,本公开还提供了分配装置、电子设备、计算机可读存储介质、程序,上述均可用来实现本公开提供的任一种分配方法,相应技术方案和描述和参见方法部分的相应记载,不再赘述。
图5示出根据本公开实施例的分配装置100的框图,如图5所示,所述分配装置100,用于在图像处理模型中存在多张特征图时,对每张所述特征图分配所通过的神经元,所述图像处理模型中包括至少一个前面任一所述的网络模块;所述装置100包括:
筛选模块110,用于根据所述图像处理模型中多个卷积层的神经元的重要性,对所述神经元进行筛选,得到第一结果;
其中,多个卷积层处于所述图像处理模型的同一深度,且
每个卷积层分别用于处理不同尺度的所述特征图;
所述第一结果中包含有多个神经元;
统计模块120,用于根据所述第一结果中每个神经元的位置属性,统计每个所述神经元所对应的所述特征图的尺度,得到分配关系;
其中,所述位置属性表征每一个神经元所属的卷积层;
所述分配关系,表征每张所述特征图与所述特征图所通过的神经元之间的对应关系;
分配模块130,用于根据所述分配关系,对每张所述特征图分配所通过的神经元。
在一种可能的实现方式中,还包括:
模型构建模块,用于在所述筛选模块根据所述图像处理模型中多个卷积层的神经元的重要性,对所述神经元进行筛选之前,确定各个网络模块中的分支数量,并根据预设的所述网络模块的个数构建所述图像处理模型;
第一训练模块,用于对所述图像处理模型进行训练,得到所述图像处理模型中batchnorm层的scale参数;
其中,所述scale参数表征所述网络模块中各个分支中的卷积层的神经元的重要性。
在一种可能的实现方式中,所述筛选模块110包括:
排序子模块,用于根据对所述图像处理模型进行预先训练得到的batchnorm层的scale参数,对多个所述卷积层的神经元进行排序,得到第一序列;
其中,所述第一序列表征多个所述卷积层中的神经元的排列顺序;
神经元数量确定子模块,用于根据预设计算量,确定用于处理多张所述特征图的待用神经元数量;
神经元提取子模块,用于根据确定的所述待用神经元数量,由所述第一序列中依次提取出所需神经元,得到所述第一结果。
在一种可能的实现方式中,还包括:
网络结构确定模块,用于在所述分配模块根据所述分配关系,对每张所述特征图分配所通过的神经元后,根据所述分配关系,确定所述图像处理模型的第一网络结构;
第二训练模块,用于对所述第一网络结构的图像处理模型进行训练。
在一些实施例中,本公开实施例提供的装置具有的功能或包含的模块可以用于执行 上文方法实施例描述的方法,其具体实现可以参照上文方法实施例的描述,为了简洁,这里不再赘述
本公开实施例还提出一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述任一分配方法。计算机可读存储介质可以是非易失性计算机可读存储介质或易失性计算机可读存储介质。
本公开实施例还提出一种电子设备,包括:处理器;用于存储处理器可执行指令的存储器;其中,所述处理器被配置为执行前面任一所述的分配方法。
本公开实施例还提出一种计算机程序,所述计算机程序包括计算机可读代码,当所述计算机可读代码在电子设备中运行时,所述电子设备中的处理器执行上述方法。
电子设备可以被提供为终端、服务器或其它形态的设备。
图6是根据一示例性实施例示出的一种电子设备800的框图。例如,电子设备800可以是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等终端。
参照图6,电子设备800可以包括以下一个或多个组件:处理组件802,存储器804,电源组件806,多媒体组件808,音频组件810,输入/输出(I/O)的接口812,传感器组件814,以及通信组件816。
处理组件802通常控制电子设备800的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件802可以包括一个或多个处理器820来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件802可以包括一个或多个模块,便于处理组件802和其他组件之间的交互。例如,处理组件802可以包括多媒体模块,以方便多媒体组件808和处理组件802之间的交互。
存储器804被配置为存储各种类型的数据以支持在电子设备800的操作。这些数据的示例包括用于在电子设备800上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器804可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。
电源组件806为电子设备800的各种组件提供电力。电源组件806可以包括电源管理系统,一个或多个电源,及其他与为电子设备800生成、管理和分配电力相关联的组件。
多媒体组件808包括在所述电子设备800和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件808包括一个前置摄像头和/或后置摄像头。当电子设备800处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒 体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。
音频组件810被配置为输出和/或输入音频信号。例如,音频组件810包括一个麦克风(MIC),当电子设备800处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器804或经由通信组件816发送。在一些实施例中,音频组件810还包括一个扬声器,用于输出音频信号。
I/O接口812为处理组件802和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。
传感器组件814包括一个或多个传感器,用于为电子设备800提供各个方面的状态评估。例如,传感器组件814可以检测到电子设备800的打开/关闭状态,组件的相对定位,例如所述组件为电子设备800的显示器和小键盘,传感器组件814还可以检测电子设备800或电子设备800一个组件的位置改变,用户与电子设备800接触的存在或不存在,电子设备800方位或加速/减速和电子设备800的温度变化。传感器组件814可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件814还可以包括光传感器,如CMOS或CCD图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件814还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。
通信组件816被配置为便于电子设备800和其他设备之间有线或无线方式的通信。电子设备800可以接入基于通信标准的无线网络,如WiFi,2G或3G,或它们的组合。在一个示例性实施例中,通信组件816经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件816还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。
在示例性实施例中,电子设备800可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述方法。
在示例性实施例中,还提供了一种非易失性计算机可读存储介质,例如包括计算机程序指令的存储器804,上述计算机程序指令可由电子设备800的处理器820执行以完成上述方法。
图7是根据一示例性实施例示出的一种电子设备1900的框图。例如,电子设备1900可以被提供为一服务器。参照图7,电子设备1900包括处理组件1922,其进一步包括一个或多个处理器,以及由存储器1932所代表的存储器资源,用于存储可由处理组件1922的执行的指令,例如应用程序。存储器1932中存储的应用程序可以包括一个或一个以上的每 一个对应于一组指令的模块。此外,处理组件1922被配置为执行指令,以执行上述方法。
电子设备1900还可以包括一个电源组件1926被配置为执行电子设备1900的电源管理,一个有线或无线网络接口1950被配置为将电子设备1900连接到网络,和一个输入输出(I/O)接口1958。电子设备1900可以操作基于存储在存储器1932的操作系统,例如Windows ServerTM,Mac OS XTM,UnixTM,LinuxTM,FreeBSDTM或类似。
在示例性实施例中,还提供了一种非易失性计算机可读存储介质,例如包括计算机程序指令的存储器1932,上述计算机程序指令可由电子设备1900的处理组件1922执行以完成上述方法。
本公开可以是系统、方法和/或计算机程序产品。计算机程序产品可以包括计算机可读存储介质,其上载有用于使处理器实现本公开的各个方面的计算机可读程序指令。
计算机可读存储介质可以是可以保持和存储由指令执行设备使用的指令的有形设备。计算机可读存储介质例如可以是――但不限于――电存储设备、磁存储设备、光存储设备、电磁存储设备、半导体存储设备或者上述的任意合适的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、静态随机存取存储器(SRAM)、便携式压缩盘只读存储器(CD-ROM)、数字多功能盘(DVD)、记忆棒、软盘、机械编码设备、例如其上存储有指令的打孔卡或凹槽内凸起结构、以及上述的任意合适的组合。这里所使用的计算机可读存储介质不被解释为瞬时信号本身,诸如无线电波或者其他自由传播的电磁波、通过波导或其他传输媒介传播的电磁波(例如,通过光纤电缆的光脉冲)、或者通过电线传输的电信号。
这里所描述的计算机可读程序指令可以从计算机可读存储介质下载到各个计算/处理设备,或者通过网络、例如因特网、局域网、广域网和/或无线网下载到外部计算机或外部存储设备。网络可以包括铜传输电缆、光纤传输、无线传输、路由器、防火墙、交换机、网关计算机和/或边缘服务器。每个计算/处理设备中的网络适配卡或者网络接口从网络接收计算机可读程序指令,并转发该计算机可读程序指令,以供存储在各个计算/处理设备中的计算机可读存储介质中。
用于执行本公开操作的计算机程序指令可以是汇编指令、指令集架构(ISA)指令、机器指令、机器相关指令、微代码、固件指令、状态设置数据、或者以一种或多种编程语言的任意组合编写的源代码或目标代码,所述编程语言包括面向对象的编程语言—诸如Smalltalk、C++等,以及常规的过程式编程语言—诸如“C”语言或类似的编程语言。计算机可读程序指令可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络—包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。在一些实施例中,通过利用计算机可读程序指令的状态信息来个性化定制电子电路,例如可编程逻辑电路、现场可 编程门阵列(FPGA)或可编程逻辑阵列(PLA),该电子电路可以执行计算机可读程序指令,从而实现本公开的各个方面。
这里参照根据本公开实施例的方法、装置(系统)和计算机程序产品的流程图和/或框图描述了本公开的各个方面。应当理解,流程图和/或框图的每个方框以及流程图和/或框图中各方框的组合,都可以由计算机可读程序指令实现。
这些计算机可读程序指令可以提供给通用计算机、专用计算机或其它可编程数据处理装置的处理器,从而生产出一种机器,使得这些指令在通过计算机或其它可编程数据处理装置的处理器执行时,产生了实现流程图和/或框图中的一个或多个方框中规定的功能/动作的装置。也可以把这些计算机可读程序指令存储在计算机可读存储介质中,这些指令使得计算机、可编程数据处理装置和/或其他设备以特定方式工作,从而,存储有指令的计算机可读介质则包括一个制造品,其包括实现流程图和/或框图中的一个或多个方框中规定的功能/动作的各个方面的指令。
也可以把计算机可读程序指令加载到计算机、其它可编程数据处理装置、或其它设备上,使得在计算机、其它可编程数据处理装置或其它设备上执行一系列操作步骤,以产生计算机实现的过程,从而使得在计算机、其它可编程数据处理装置、或其它设备上执行的指令实现流程图和/或框图中的一个或多个方框中规定的功能/动作。
附图中的流程图和框图显示了根据本公开的多个实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或指令的一部分,所述模块、程序段或指令的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
在不违背逻辑的情况下,本公开不同实施例之间可以相互结合,不同实施例描述有所侧重,为侧重描述的部分可以参见其他实施例的记载。
以上已经描述了本公开的各实施例,上述说明是示例性的,并非穷尽性的,并且也不限于所披露的各实施例。在不偏离所说明的各实施例的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。本文中所用术语的选择,旨在最好地解释各实施例的原理、实际应用或对市场中的技术的改进,或者使本技术领域的其它普通技术人员能理解本文披露的各实施例。

Claims (16)

  1. 一种网络模块,其特征在于,包括:
    依次级联的第一网络层、第二网络层和第三网络层;
    其中,所述第一网络层,用于对输入的图像进行处理,得到第一特征图;
    所述第二网络层包括多个并行的分支;
    每个分支包括第一采样层;
    所述第一采样层,用于对所述第一特征图进行下采样,得到第二特征图;
    其中,不同所述分支中的所述第一采样层得到的所述第二特征图的尺度不同;
    所述第三网络层,用于将每个所述分支输出的特征图数据合并。
  2. 根据权利要求1所述的网络模块,其特征在于,所述第一采样层为池化层。
  3. 根据权利要求2所述的网络模块,其特征在于,所述池化层为最大池化层。
  4. 根据权利要求1所述的网络模块,其特征在于,每个分支还包括与所述第一采样层依次级联的第一卷积层和第二采样层;
    所述第一卷积层,用于对所述第二特征图进行卷积操作,得到第三特征图;
    所述第二采样层,用于将所述第三特征图的尺度恢复为所述第一特征图的尺度。
  5. 根据权利要求1至4任意一项所述的网络模块,其特征在于,所述第二网络层还包括原比例分支;所述原比例分支包括第二卷积层;
    所述第二卷积层,用于对所述第一特征图进行卷积操作,并将经过卷积操作得到的特征图数据输入至所述第三网络层;
    所述第三网络层,还用于将所述第二网络层中所述多个并行的分支输出的特征图数据和每个所述原比例分支输出的特征图数据合并。
  6. 一种分配方法,其特征在于,用于在图像处理模型中存在多张特征图时,对每张所述特征图分配所通过的神经元,所述图像处理模型中包括至少一个权利要求1至5任意一项所述的网络模块;所述方法包括:
    根据所述图像处理模型中多个卷积层的神经元的重要性,对所述神经元进行筛选,得到第一结果;
    其中,多个卷积层处于所述图像处理模型的同一深度,且
    每个卷积层分别用于处理不同尺度的所述特征图;
    所述第一结果中包含有多个神经元;
    根据所述第一结果中每个神经元的位置属性,统计每个所述神经元所对应的所述特征图的尺度,得到分配关系;
    其中,所述位置属性表征每一个神经元所属的卷积层;
    所述分配关系,表征每张所述特征图与所述特征图所通过的神经元之间的对应关系;
    根据所述分配关系,对每张所述特征图分配所通过的神经元。
  7. 根据权利要求6所述的方法,其特征在于,在根据所述图像处理模型中多个卷积层的神经元的重要性,对所述神经元进行筛选之前,还包括:
    确定各个网络模块中的分支数量,并根据预设的所述网络模块的个数构建所述图像 处理模型;
    对所述图像处理模型进行训练,得到所述图像处理模型中batchnorm层的scale参数;
    其中,所述scale参数表征所述网络模块中各个分支中的卷积层的神经元的重要性。
  8. 根据权利要求6或7所述的方法,其特征在于,所述根据所述图像处理模型中多个卷积层的神经元的重要性,对所述神经元进行筛选,得到第一结果,包括:
    根据对所述图像处理模型进行预先训练得到的batchnorm层的scale参数,对多个所述卷积层的神经元进行排序,得到第一序列;
    其中,所述第一序列表征多个所述卷积层中的神经元的排列顺序;
    根据预设计算量,确定用于处理多张所述特征图的待用神经元数量;
    根据确定的所述待用神经元数量,由所述第一序列中依次提取出所需神经元,得到所述第一结果。
  9. 根据权利要求8所述的方法,其特征在于,在根据所述分配关系,对每张所述特征图分配所通过的神经元后,还包括:
    根据所述分配关系,确定所述图像处理模型的第一网络结构;
    对所述第一网络结构的图像处理模型进行训练。
  10. 一种分配装置,其特征在于,用于在图像处理模型中存在多张特征图时,对每张所述特征图分配所通过的神经元,所述图像处理模型中包括至少一个权利要求1至5任意一项所述的网络模块;所述装置包括:
    筛选模块,用于根据所述图像处理模型中多个卷积层的神经元的重要性,对所述神经元进行筛选,得到第一结果;
    其中,多个卷积层处于所述图像处理模型的同一深度,且
    每个卷积层分别用于处理不同尺度的所述特征图;
    所述第一结果中包含有多个神经元;
    统计模块,用于根据所述第一结果中每个神经元的位置属性,统计每个所述神经元所对应的所述特征图的尺度,得到分配关系;
    其中,所述位置属性表征每一个神经元所属的卷积层;
    所述分配关系,表征每张所述特征图与所述特征图所通过的神经元之间的对应关系;
    分配模块,用于根据所述分配关系,对每张所述特征图分配所通过的神经元。
  11. 根据权利要求10所述的装置,其特征在于,还包括:
    模型构建模块,用于在所述筛选模块根据所述图像处理模型中多个卷积层的神经元的重要性,对所述神经元进行筛选之前,确定各个网络模块中的分支数量,并根据预设的所述网络模块的个数构建所述图像处理模型;
    第一训练模块,用于对所述图像处理模型进行训练,得到所述图像处理模型中batchnorm层的scale参数;
    其中,所述scale参数表征所述网络模块中各个分支中的卷积层的神经元的重要性。
  12. 根据权利要求10或11所述的装置,其特征在于,所述筛选模块包括:
    排序子模块,用于根据对所述图像处理模型进行预先训练得到的batchnorm层的scale参数,对多个所述卷积层的神经元进行排序,得到第一序列;
    其中,所述第一序列表征多个所述卷积层中的神经元的排列顺序;
    神经元数量确定子模块,用于根据预设计算量,确定用于处理多张所述特征图的待用神经元数量;
    神经元提取子模块,用于根据确定的所述待用神经元数量,由所述第一序列中依次提取出所需神经元,得到所述第一结果。
  13. 根据权利要求12所述的装置,其特征在于,还包括:
    网络结构确定模块,用于在所述分配模块根据所述分配关系,对每张所述特征图分配所通过的神经元后,根据所述分配关系,确定所述图像处理模型的第一网络结构;
    第二训练模块,用于对所述第一网络结构的图像处理模型进行训练。
  14. 一种电子设备,其特征在于,包括:
    处理器;
    用于存储处理器可执行指令的存储器;
    其中,所述处理器被配置为:执行权利要求6至9中任意一项所述的方法。
  15. 一种计算机可读存储介质,其上存储有计算机程序指令,其特征在于,所述计算机程序指令被处理器执行时实现权利要求6至9中任意一项所述的方法。
  16. 一种计算机程序,其特征在于,所述计算机程序包括计算机可读代码,当所述计算机可读代码在电子设备中运行时,所述电子设备中的处理器执行用于实现权利要求6至9中的任意一项所述的方法。
PCT/CN2019/114460 2019-02-25 2019-10-30 网络模块和分配方法及装置、电子设备和存储介质 WO2020173115A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
JP2020527741A JP7096888B2 (ja) 2019-02-25 2019-10-30 ネットワークモジュール、割り当て方法及び装置、電子機器並びに記憶媒体
KR1020207015036A KR20200106027A (ko) 2019-02-25 2019-10-30 네트워크 모듈 및 분배 방법 및 장치, 전자 기기 및 저장 매체
SG11202004552VA SG11202004552VA (en) 2019-02-25 2019-10-30 Network module and distribution method and apparatus, electronic device, and storage medium
US16/888,931 US11443438B2 (en) 2019-02-25 2020-06-01 Network module and distribution method and apparatus, electronic device, and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910139007.4 2019-02-25
CN201910139007.4A CN109902738B (zh) 2019-02-25 2019-02-25 网络模块和分配方法及装置、电子设备和存储介质

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/888,931 Continuation US11443438B2 (en) 2019-02-25 2020-06-01 Network module and distribution method and apparatus, electronic device, and storage medium

Publications (1)

Publication Number Publication Date
WO2020173115A1 true WO2020173115A1 (zh) 2020-09-03

Family

ID=66945573

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/114460 WO2020173115A1 (zh) 2019-02-25 2019-10-30 网络模块和分配方法及装置、电子设备和存储介质

Country Status (7)

Country Link
US (1) US11443438B2 (zh)
JP (1) JP7096888B2 (zh)
KR (1) KR20200106027A (zh)
CN (2) CN113592004A (zh)
SG (1) SG11202004552VA (zh)
TW (1) TWI766228B (zh)
WO (1) WO2020173115A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112633402A (zh) * 2020-12-30 2021-04-09 南京大学 一种实现动态计算的高精度高比例的分类模型及分类方法
CN113327203A (zh) * 2021-05-28 2021-08-31 北京百度网讯科技有限公司 图像处理网络模型、方法、设备和介质

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113592004A (zh) 2019-02-25 2021-11-02 深圳市商汤科技有限公司 分配方法及装置、电子设备和存储介质
CN110826696B (zh) * 2019-10-30 2023-06-27 北京百度网讯科技有限公司 超网络的搜索空间构建方法、装置以及电子设备
CN112418394B (zh) * 2020-11-04 2022-05-13 武汉大学 一种电磁波频率预测方法及装置
CN113240084B (zh) * 2021-05-11 2024-02-02 北京搜狗科技发展有限公司 一种数据处理方法、装置、电子设备及可读介质
CN113569913B (zh) * 2021-06-29 2023-04-25 西北大学 基于分层选择性Adaboost-DNNs的图像分类模型建立、分类方法及系统

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102156881A (zh) * 2011-04-13 2011-08-17 上海海事大学 基于多尺度图像相位信息的海难搜救目标检测方法
CN108154192A (zh) * 2018-01-12 2018-06-12 西安电子科技大学 基于多尺度卷积与特征融合的高分辨sar地物分类方法
CN108830185A (zh) * 2018-05-28 2018-11-16 四川瞳知科技有限公司 基于多任务联合学习的行为识别及定位方法
CN109902738A (zh) * 2019-02-25 2019-06-18 深圳市商汤科技有限公司 网络模块和分配方法及装置、电子设备和存储介质

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103200242B (zh) * 2013-03-20 2016-04-06 成都康赛信息技术有限公司 基于物联网构建跨层面数据分析枢纽的方法
CN107871136A (zh) * 2017-03-22 2018-04-03 中山大学 基于稀疏性随机池化的卷积神经网络的图像识别方法
CN109300166B (zh) * 2017-07-25 2023-04-25 同方威视技术股份有限公司 重建ct图像的方法和设备以及存储介质
CN108229497B (zh) * 2017-07-28 2021-01-05 北京市商汤科技开发有限公司 图像处理方法、装置、存储介质、计算机程序和电子设备
US10679351B2 (en) * 2017-08-18 2020-06-09 Samsung Electronics Co., Ltd. System and method for semantic segmentation of images
US10043113B1 (en) * 2017-10-04 2018-08-07 StradVision, Inc. Method and device for generating feature maps by using feature upsampling networks
CN107766292B (zh) * 2017-10-30 2020-12-29 中国科学院计算技术研究所 一种神经网络处理方法及处理系统
CN108416307B (zh) * 2018-03-13 2020-08-14 北京理工大学 一种航拍图像路面裂缝检测方法、装置及设备
CN109376667B (zh) * 2018-10-29 2021-10-01 北京旷视科技有限公司 目标检测方法、装置及电子设备

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102156881A (zh) * 2011-04-13 2011-08-17 上海海事大学 基于多尺度图像相位信息的海难搜救目标检测方法
CN108154192A (zh) * 2018-01-12 2018-06-12 西安电子科技大学 基于多尺度卷积与特征融合的高分辨sar地物分类方法
CN108830185A (zh) * 2018-05-28 2018-11-16 四川瞳知科技有限公司 基于多任务联合学习的行为识别及定位方法
CN109902738A (zh) * 2019-02-25 2019-06-18 深圳市商汤科技有限公司 网络模块和分配方法及装置、电子设备和存储介质

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112633402A (zh) * 2020-12-30 2021-04-09 南京大学 一种实现动态计算的高精度高比例的分类模型及分类方法
CN112633402B (zh) * 2020-12-30 2024-05-03 南京大学 一种实现动态计算的高精度高比例的分类模型及分类方法
CN113327203A (zh) * 2021-05-28 2021-08-31 北京百度网讯科技有限公司 图像处理网络模型、方法、设备和介质

Also Published As

Publication number Publication date
US11443438B2 (en) 2022-09-13
US20200294249A1 (en) 2020-09-17
CN113592004A (zh) 2021-11-02
CN109902738B (zh) 2021-07-20
CN109902738A (zh) 2019-06-18
KR20200106027A (ko) 2020-09-10
TW202032499A (zh) 2020-09-01
JP2021517282A (ja) 2021-07-15
SG11202004552VA (en) 2020-10-29
TWI766228B (zh) 2022-06-01
JP7096888B2 (ja) 2022-07-06

Similar Documents

Publication Publication Date Title
WO2020173115A1 (zh) 网络模块和分配方法及装置、电子设备和存储介质
CN109829433B (zh) 人脸图像识别方法、装置、电子设备及存储介质
TWI732338B (zh) 文本序列的識別方法、電子設備和電腦可讀存儲介質
TWI717865B (zh) 影像處理方法及裝置、電子設備、電腦可讀取的記錄媒體和電腦程式產品
TWI773945B (zh) 錨點確定方法、電子設備和儲存介質
WO2021208667A1 (zh) 图像处理方法及装置、电子设备和存储介质
WO2021035812A1 (zh) 一种图像处理方法及装置、电子设备和存储介质
TWI738172B (zh) 影片處理方法及裝置、電子設備、儲存媒體和電腦程式
CN108960283B (zh) 分类任务增量处理方法及装置、电子设备和存储介质
CN109145970B (zh) 基于图像的问答处理方法和装置、电子设备及存储介质
CN110458218B (zh) 图像分类方法及装置、分类网络训练方法及装置
CN109165738B (zh) 神经网络模型的优化方法及装置、电子设备和存储介质
CN110659690B (zh) 神经网络的构建方法及装置、电子设备和存储介质
CN111414963B (zh) 图像处理方法、装置、设备和存储介质
CN111581488A (zh) 一种数据处理方法及装置、电子设备和存储介质
CN110533105B (zh) 一种目标检测方法及装置、电子设备和存储介质
CN105335684B (zh) 人脸检测方法及装置
WO2020186702A1 (zh) 图像生成方法及装置、电子设备和存储介质
CN111242303A (zh) 网络训练方法及装置、图像处理方法及装置
CN111435422B (zh) 动作识别方法、控制方法及装置、电子设备和存储介质
CN111259967A (zh) 图像分类及神经网络训练方法、装置、设备及存储介质
TW202036476A (zh) 圖像處理方法及裝置、電子設備和儲存介質
CN110633715B (zh) 图像处理方法、网络训练方法及装置、和电子设备
CN109447258B (zh) 神经网络模型的优化方法及装置、电子设备和存储介质
CN111507131B (zh) 活体检测方法及装置、电子设备和存储介质

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2020527741

Country of ref document: JP

Kind code of ref document: A

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

Ref document number: 19917371

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 28/01/2022)

122 Ep: pct application non-entry in european phase

Ref document number: 19917371

Country of ref document: EP

Kind code of ref document: A1