CN113191480A - Pooling method and device for neural network - Google Patents

Pooling method and device for neural network Download PDF

Info

Publication number
CN113191480A
CN113191480A CN202010039300.6A CN202010039300A CN113191480A CN 113191480 A CN113191480 A CN 113191480A CN 202010039300 A CN202010039300 A CN 202010039300A CN 113191480 A CN113191480 A CN 113191480A
Authority
CN
China
Prior art keywords
elements
mean value
determining
matrix
pooling
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010039300.6A
Other languages
Chinese (zh)
Inventor
范坤
陈迈越
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Horizon Robotics Technology Research and Development Co Ltd
Original Assignee
Beijing Horizon Robotics Technology Research and Development Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Horizon Robotics Technology Research and Development Co Ltd filed Critical Beijing Horizon Robotics Technology Research and Development Co Ltd
Priority to CN202010039300.6A priority Critical patent/CN113191480A/en
Publication of CN113191480A publication Critical patent/CN113191480A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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

Landscapes

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

Abstract

Disclosed are a pooling method, apparatus, computer-readable storage medium and electronic device for a neural network, the method comprising: inputting the image into a convolution layer of a neural network to obtain a characteristic diagram; acquiring matrix elements of the characteristic diagram under a preset data window according to a preset pooling step length; determining a first mean value set of the matrix elements according to noise elements in the matrix elements; and determining the pooling output value of the matrix element according to the first mean value set of the matrix element. According to the technical scheme, the noise element in the data window is considered, so that the possibility that the noise element is introduced in the pooling process is reduced, the accuracy of the pooled output value is improved, and the precision of the neural network is improved.

Description

Pooling method and device for neural network
Technical Field
The present application relates to the field of deep learning technologies, and more particularly, to a pooling method and apparatus for a neural network.
Background
The neural network is one of the perception models with high development level in the field of artificial intelligence, and becomes a research hotspot in academia and industry due to the wide application and excellent performance. Neural networks model the neural connections of the human brain, bringing about a breakthrough for large-scale data (e.g., image, video or audio) processing tasks. The calculation process of the neural network can be generally divided into the steps of convolution, activation, pooling and the like, wherein each hierarchy feature map of the neural network generally needs to be subjected to pooling operation so as to reduce the size of the feature map and further reduce the calculation amount.
Currently, feature maps are pooled primarily by maximal pooling.
However, maximum pooling is insensitive to outliers, e.g., for 4 elements within the data window: 1, 2, 1, 255, in which case the maximum pooling would replace 4 elements in the data window with a maximum value of 255, but in this case 255 would likely be a white noise point, and replacing the elements in the data window with 255 would introduce the white noise point, thereby reducing the accuracy of the neural network.
Disclosure of Invention
The present application is proposed to solve the above-mentioned technical problems. Embodiments of the present application provide a pooling method, apparatus, computer-readable storage medium, and electronic device for a neural network, which reduce the possibility of introducing noise elements into a pooling process by considering the noise elements within a data window, thereby improving the accuracy of pooled output values and further improving the accuracy of the neural network.
According to an aspect of the present application, there is provided a pooling method for a neural network, comprising:
inputting the image into a convolution layer of a neural network to obtain a characteristic diagram;
acquiring matrix elements of the characteristic diagram under a preset data window according to a preset pooling step length;
determining a first mean value set of the matrix elements according to noise elements in the matrix elements;
and determining the pooling output value of the matrix element according to the first mean value set of the matrix element.
According to a second aspect of the present application, there is provided a pooling device for a neural network, comprising:
the characteristic extraction module is used for inputting the image into the convolution layer of the neural network to obtain a characteristic diagram;
the acquisition module is used for acquiring matrix elements of the characteristic diagram under a preset data window according to a preset pooling step length;
the calculation module is used for determining a first mean value set of the matrix elements according to the noise elements in the matrix elements;
and the output module is used for determining the pooling output value of the matrix element according to the first mean value set of the matrix element.
According to a third aspect of the present application, a computer-readable storage medium is provided, the storage medium storing a computer program for performing the above-mentioned pooling method for neural networks.
According to a fourth aspect of the present application, there is provided an electronic apparatus comprising:
a processor;
a memory for storing the processor-executable instructions;
the processor is used for reading the executable instructions from the memory and executing the instructions to realize the pooling method for the neural network.
Compared with the prior art, the pooling method and device for the neural network, the computer-readable storage medium and the electronic device provided by the application at least have the following beneficial effects:
the present embodiment improves the accuracy of the pooled output values and thus the accuracy of the neural network by considering noise elements within the data window to reduce the likelihood that the pooling process introduces noise elements.
Drawings
The above and other objects, features and advantages of the present application will become more apparent by describing in more detail embodiments of the present application with reference to the attached drawings. The accompanying drawings are included to provide a further understanding of the embodiments of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the principles of the application. In the drawings, like reference numbers generally represent like parts or steps.
Fig. 1 is a schematic diagram of an application scenario to which one or more embodiments of the present application are applicable.
Fig. 2 is a schematic flow chart diagram of a pooling method for a neural network provided by an exemplary embodiment of the present application.
Fig. 3 is a flowchart illustrating step 203 of the pooling method for the neural network according to an exemplary embodiment of the present application.
Fig. 4 is a schematic flow chart of step 2032 of the pooling method for neural networks provided by an exemplary embodiment of the present application.
Fig. 5 is a schematic flow chart of step 20322 of the pooling method for neural networks provided by an exemplary embodiment of the present application.
Fig. 6 is a flowchart illustrating step 204 of a pooling method for a neural network according to an exemplary embodiment of the present application.
Fig. 7 is a first schematic structural diagram of a pooling device for a neural network according to an exemplary embodiment of the present application.
Fig. 8 is a schematic structural diagram of a pooling device for a neural network according to an exemplary embodiment of the present application.
Fig. 9 is a schematic structural diagram of the set determination unit 7032 in the second schematic structural diagram of the pooling device for a neural network according to an exemplary embodiment of the present application.
Fig. 10 is a block diagram of an electronic device provided in an exemplary embodiment of the present application.
Detailed Description
Hereinafter, example embodiments according to the present application will be described in detail with reference to the accompanying drawings. It should be understood that the described embodiments are only some embodiments of the present application and not all embodiments of the present application, and that the present application is not limited by the example embodiments described herein.
Summary of the application
With the development of artificial intelligence in recent years, deep learning-based neural networks are widely used to solve abstraction problems, and the deep neural networks can describe data characteristics hierarchically through multiple transformation stages, so as to establish an operational model formed by a large number of nodes interconnected through a mesh, and the nodes are generally called neurons. Generally, the computation of the neural network is large and complex, and the computation of the neural network can be converged by using pooling. Therefore, pooling is of great significance to reduce the computational load of the neural network.
Currently, the feature map is reduced in size mainly by the method of maximum pooling to reduce the amount of computation.
However, maximal pooling tends to introduce outliers, thereby reducing the accuracy of the neural network.
The present disclosure improves the accuracy of pooled output values, and thus the accuracy of the neural network, by considering noise elements within the matrix elements under the data window to reduce the likelihood of noise elements being introduced by the pooling process.
Exemplary method
Fig. 2 is a schematic flow chart diagram of a pooling method for a neural network provided by an exemplary embodiment of the present application.
The embodiment can be applied to electronic equipment, and particularly can be applied to a server or a general computer. As shown in fig. 2, a pooling method for a neural network provided by an exemplary embodiment of the present application includes at least the following steps:
step 201, inputting the image into the convolution layer of the neural network to obtain a feature map.
The electronic device can acquire an image of the input neural network through an image acquisition device such as a camera provided in the electronic device. Alternatively, the electronic device may also obtain an image of the input neural network from an external storage device connected thereto. The external storage device may include a floppy disk, a removable hard disk, a usb disk, and the like, which is not limited herein. Alternatively, other external devices having image capturing capabilities capture an image and transmit the captured image to the electronic device, thereby causing the electronic device to capture an image of the input neural network. For example, a camera near a zebra crossing on a road captures a pedestrian monitoring image, and transmits the pedestrian monitoring image to the electronic device.
The image comprises a plurality of pixel points and pixel values corresponding to each pixel point. The present invention is not limited to the image content. The image is input to a convolutional layer of a neural network, which is convolved by a convolution kernel to detect features in the image from different positions, i.e., for neurons of the next layer, they detect features of neurons of the previous layer from different positions, thereby outputting a feature map, i.e., a matrix of neurons of the next layer generated by a receptive field scan of the convolution kernel. Obviously, the number of the feature maps of the image is the same as that of the convolution kernels, and for any feature map, the feature map comprises a plurality of pixel points and pixel values of each pixel point after convolution, and the number of times of convolution is not limited, and the convolution can be performed once or twice.
It should be noted that the neural network is generally a convolutional neural network, and the convolutional neural network includes, but is not limited to, convolutional layers and pooling layers, and the number of layers of the convolutional layers and the pooling layers is not limited in this embodiment.
Step 202, obtaining a matrix element of the characteristic diagram under a preset data window according to a preset pooling step length.
The pooling step size and the size of the preset data window are integers. The pooling step represents a sliding step of the preset data window on the image, and may include pooling steps in the horizontal direction and the vertical direction, for example, the pooling step is 2 × 2, that is, the pooling steps in the horizontal direction and the vertical direction are both 2 (i.e., 2 pixels). The size of the preset data window is the size of the pooling area of each pooling, and the matrix elements are pixel values of pixel points in the pooling area. For example, the size of the data window is 2 × 2, that is, the pooling region of 2 × 2 is pooled every time, that is, the pooling region includes 4 pixels, the matrix elements are pixel values corresponding to the 4 pixels in the pooling region, and the number of the matrix elements is the same as the size of the preset data window.
Specifically, a plurality of feature maps are input into a pooling layer in the neural network, the pooling layer can perform dimension reduction on each feature map according to a pooling step length and a preset data window, and the number of output feature maps is unchanged. Specifically, for each feature map, the preset data window scans the feature map according to the pooling step length, and each scanning can acquire a plurality of matrix elements in the preset data window.
Referring to fig. 1, a feature diagram is input, the size of the feature diagram is 4 × 4, the feature diagram includes 16 pixel points and a pixel value of each pixel point, the 16 pixel points are squares where X1 to X16 are located in fig. 1, where X1 to X16 respectively represent pixel values corresponding to the pixel points where the pixel points are located, where the size of a data window is 2 × 2, the pooling step size is 2 × 2, and the input feature diagram is scanned sequentially through the data window from left to right and from top to bottom in the order of left to right, matrix elements obtained by the first scanning include X1, X2, X5, and X6, matrix elements obtained by the second scanning include X3, X4, X7, and X8, matrix elements obtained by the third scanning include X9, X10, X13, and X14, and matrix elements obtained by the fourth scanning include X12, X15, and X16. The data window size and pooling step size of the pooling layer need to be determined in conjunction with the actual scene.
Step 203, determining a first mean value set of the matrix elements according to the noise elements in the matrix elements.
The noise element is an abnormal value in the matrix element, the abnormal value refers to an excessively large or excessively small matrix element, and if the noise element is introduced in the pooling process, the accuracy of the neural network is easily reduced. Here, according to the noise element in the matrix element, for example, data processing such as deleting the noise element, weighting the noise element, and the like may be performed, and a first mean set of the matrix element is determined, which takes the noise element into consideration, thereby ensuring a reference value of the data. It is apparent that the first set of means comprises one or more data indicative of mean information of the matrix elements.
It should be noted that, in order to facilitate data processing and reduce the amount of calculation of the pooling layer, the maximum value and/or the minimum value in the matrix elements are determined as noise elements, and abnormal value detection is not required for the matrix elements.
And 204, determining a pooling output value of the matrix element according to the first mean value set of the matrix element.
And determining the pooling output value of the matrix element according to the first mean value set of the matrix element. When the first mean value set comprises a plurality of data, the data need to be fused, and the fusion mode is not limited, so that the pooling output value is determined. The pooling method described above takes noise elements into account, thereby improving the accuracy of the neural network.
The present embodiment improves the accuracy of the pooled output values and thus the accuracy of the neural network by considering noise elements within the data window to reduce the likelihood that the pooling process introduces noise elements.
Fig. 3 shows a flow chart of the step of determining the first mean set of the matrix elements according to the noise elements in the matrix elements in the embodiment shown in fig. 2.
As shown in fig. 3, on the basis of the embodiment shown in fig. 2, in an exemplary embodiment of the present application, the step 203 of determining the first mean set of the matrix elements according to the noise elements in the matrix elements may specifically include the following steps:
step 2031, calculating a first mean value of elements other than the noise element in the matrix elements.
And calculating a first average value of elements except the noise element in the matrix element, thereby reducing the possibility of introducing the noise element and further ensuring the accuracy of the first average value. Referring to fig. 1, the matrix elements obtained by the first scan include X1, X2, X5, and X6, for example, the first average value a ═ X1+ X2+ X5+ X6) -max (X1, X2, X5, X6) -min (X1, X2, X5, X6) ]/2, where max (X1, X2, X5, X6) and min (X1, X2, X5, X6) indicate noise elements.
Step 2032, determining a first mean value set of the matrix elements according to the first mean value.
The first set of means includes, but is not limited to, the first means such that the first set of means retains mean information for matrix elements other than noise elements.
The embodiment determines the first mean value set by the mean value of the elements except the noise elements in the matrix elements, thereby ensuring the reference value of the first mean value set.
Fig. 4 is a flow chart illustrating a step of determining a first mean set of the matrix elements according to the first mean in the embodiment shown in fig. 3.
As shown in fig. 4, on the basis of the embodiment shown in fig. 3, in an exemplary embodiment of the present application, the step 2032 of determining the first mean value set of the matrix elements according to the first mean value may specifically include the following steps:
step 20321, determining a difference between any two adjacent elements in the matrix elements, where the two adjacent elements satisfy a preset condition.
The difference between the elements can reflect the difference between the elements. Specifically, determining a difference value between any two adjacent elements in the matrix elements, where the two adjacent elements satisfy a preset condition may include: the two adjacent elements are any one of a row element, a column element, and a diagonal element. Obviously, two adjacent elements may be adjacent in the horizontal direction, i.e., adjacent to each other on the left and right, may be adjacent in the vertical direction, i.e., adjacent to each other on the top and bottom, or may be adjacent in the diagonal direction. Referring to fig. 1, taking X1 as an example, the matrix elements adjacent to X1 may be X2, X5, and X6. Wherein, X1 and X2 are row elements and are adjacent in the horizontal direction, namely adjacent left and right; x1 and X5 are column elements and are adjacent in the vertical direction, namely up and down; x1 and X6 are diagonal elements, adjacent in the diagonal direction.
It should be noted that the number of differences is determined according to the size of the data window, where, for example, the size of the data window is X × Y, there are X rows and Y columns of matrix elements, each row of elements has (X-1) groups of adjacent elements, and there are (X-1) Y differences in the horizontal direction, correspondingly, (Y-1) X differences in the vertical direction, and 2 (X-1) Y differences in the diagonal direction. For example, the size of the data window is 2 × 2, please refer to fig. 1, where each row of elements has a group of neighboring elements, i.e., two differences in the horizontal direction are X1-X2 and X5-X6, each column of elements has a group of neighboring elements, i.e., two differences in the vertical direction are X1-X5 and X2-X6, respectively, and each diagonal element in each diagonal has a group of neighboring elements, i.e., two differences in the diagonal direction are X1-X6 and X1-X5, respectively.
It should be noted that, the order of the elements is not limited when the difference between two adjacent elements is made, please refer to fig. 1, which takes X1 and X2 as the two adjacent elements as an example, and the difference may be X1 to X2, or X2 to X1.
Step 20322, determining a second mean value set according to each difference value.
The data in the second mean value set may be one or more difference values randomly selected from a plurality of difference values, may be a mean value of the plurality of difference values, may be a median value of the plurality of difference values, may also be a maximum value of the plurality of difference values, and the like, which is not limited in the present invention. Here, the two adjacent elements corresponding to these differences may be any one or more of a row element, a column element, and a diagonal element. That is, two adjacent elements corresponding to these differences may be any one or more of a horizontal direction, a vertical direction, and a diagonal direction. Referring to fig. 1, the matrix elements obtained by the first scan include X1, X2, X5, and X6, which include any one or more of X1-X2, X5-X6, X1-X5, X2-X6, X1-X6, and X2-X5, where X1-X2 and X5-X6 are differences in the horizontal direction, X1-X5 and X2-X6 are differences in the vertical direction, and X1-X6 and X2-X5 are differences in the diagonal direction.
Step 20323, determining a first mean set of the matrix elements according to the first mean and the second mean set.
And forming a first mean value set by using the first mean value and the second mean value set, thereby more retaining information in the characteristic diagram and further improving the precision and the stability of the neural network. Compared with the pooling method for mean pooling in the prior art, the pooling method for the neural network provided by the embodiment reduces the possibility of information loss of the feature map, and simultaneously reduces the influence of noise elements, thereby improving the stability and the precision of the neural network.
In this embodiment, the second mean value set is determined by the difference between adjacent elements, and the first mean value set is formed by using the second mean value set and the first mean value set, so that more information of the feature map is retained, and meanwhile, the influence of noise elements is reduced, thereby improving the precision and stability of the neural network.
Fig. 5 is a flow chart illustrating a step of determining a first mean set of the matrix elements according to the first mean in the embodiment shown in fig. 4.
As shown in fig. 5, based on the embodiment shown in fig. 4, in an exemplary embodiment of the present application, the step 20322 of determining the second mean set according to each difference may specifically include the following steps:
and 203221, determining the absolute value corresponding to each difference value.
Considering that the difference between adjacent elements may have negative values, and no negative value should occur in the pooling calculation process, it is necessary to determine the absolute values corresponding to several differences, so as to ensure the reference values of the differences.
Here, the two adjacent elements to which the respective differences correspond are any one of a row element, a column element, and a diagonal element. Taking the row elements as an example for explanation, referring to fig. 1, taking the matrix elements obtained by the first scanning as examples including X1, X2, X5, and X6 as an example, the number of the differences corresponding to the row elements includes X1-X2 and X5-X6, and obviously, the number of the differences is not greater than the number of all the differences in the horizontal direction.
In step 203222, the mean value of the absolute values corresponding to the difference values is determined as the second mean value.
And determining the mean value of the absolute values corresponding to the difference values respectively, and determining the mean value as a second mean value. It should be noted that the second average indicates an average of differences between two adjacent elements in any one of the horizontal direction, the vertical direction and the diagonal direction.
And 203223, determining a second mean value set according to the second mean value.
When the adjacent elements are row elements, determining a second average value corresponding to the row elements, namely information in the horizontal direction; when the adjacent elements are column elements, determining a second average value corresponding to the column elements, namely information in the vertical direction; when the adjacent elements are all diagonal elements, determining a second average value corresponding to the diagonal elements, namely information in the diagonal direction. At this time, the second mean value set includes, but is not limited to, any one or more of the second mean values respectively corresponding to the row elements, the column elements, and the diagonal elements, that is, any one or more of the second mean values respectively corresponding to the horizontal direction, the vertical direction, and the diagonal direction. Obviously, the second mean value set more retains the information in the characteristic diagram, thereby improving the precision and the stability of the neural network.
Referring to fig. 1, taking the matrix elements obtained from the first scan as X1, X2, X5 and X6 as an example, the second mean value B ═ X1-X2 | X5-X6 |)/2 corresponding to the row elements; a second mean value C | X1-X5 | X2-X6 |)/2 corresponding to the column element; the second average value D | X1-X6 | X2-X5 |)/2 corresponding to the diagonal line.
In the embodiment, the second mean value set is determined by determining the mean value of the absolute values of the difference values, so that more information in the characteristic diagram is kept, and the precision and the stability of the neural network are improved.
Fig. 6 shows a flow chart of the step of determining the pooled output values of the matrix elements based on the first set of mean values of the matrix elements in the embodiment shown in fig. 1.
As shown in fig. 6, based on the embodiment shown in fig. 1, in an exemplary embodiment of the present application, the step 204 of determining the pooled output values of the matrix elements according to the first mean set of the matrix elements may specifically include the following steps:
step 2041, obtaining a weight value corresponding to each mean value in the first mean value set.
The first mean value set comprises a plurality of mean values, and in order to improve accuracy of pooling, a weight value corresponding to each mean value is obtained.
Step 2042, according to the weight value corresponding to each mean value in the first mean value set, performing weighted summation on the mean values in the first mean value set, and determining the pooled output value of the matrix element.
And carrying out weighted summation on the mean values in the first mean value set according to the weighted values corresponding to the mean values in the first mean value set, so as to determine the pooled output values of the matrix elements, wherein the pooled output values more retain information in the characteristic diagram and can more accurately reflect the information in the characteristic diagram, thereby improving the precision and the stability of the neural network.
Referring to fig. 1, taking an example that the matrix elements obtained by the first scan include X1, X2, X5, and X6, assuming that the first average set includes the first average a, the second average B corresponding to the row elements, and the second average C corresponding to the column elements, Y1 is α a + β B + γ C, where α may be 1, and β and γ all have a value range of 0 to 1, and the pooled output values Y1, Y2, Y3, Y4 and the like can be output by sequentially scanning the feature maps through the data windows from left to right and from top to bottom according to the pooling method.
In the embodiment, the weighted sum is performed on the average values in the first average value set through the weight values, so that the pooled output value more retains information in the characteristic diagram and can more accurately reflect the information in the characteristic diagram, thereby improving the precision and stability of the neural network.
Exemplary devices
Based on the same concept as the method embodiment of the application, the embodiment of the application also provides a pooling device for the neural network.
Fig. 7 shows a first structural diagram of a pooling device for a neural network according to an exemplary embodiment of the present application.
As shown in fig. 7, an exemplary embodiment of the present application provides a pooling device for a neural network, including:
a feature extraction module 701, configured to input the image into the convolutional layer of the neural network to obtain a feature map;
an obtaining module 702, configured to obtain a matrix element of the feature map under a preset data window according to a preset pooling step length;
a calculating module 703, configured to determine a first mean set of the matrix elements according to noise elements in the matrix elements;
an output module 704, configured to determine a pooled output value of the matrix element according to the first mean set of the matrix element.
Fig. 8 is a schematic structural diagram of a pooling device for a neural network according to an exemplary embodiment of the present application.
As shown in fig. 8, in an exemplary embodiment, the calculation module 703 includes:
a calculating unit 7031, configured to calculate a first average value of elements other than the noise element in the matrix elements;
a set determining unit 7032 is configured to determine a first mean set of the matrix elements according to the first mean.
As shown in fig. 8, in an exemplary embodiment, the output module 704 includes:
an obtaining unit 7041, configured to obtain a weight value corresponding to each mean value in the first mean value set;
an output unit 7042, configured to perform weighted summation on the mean values in the first mean value set according to respective corresponding weight values of each mean value in the first mean value set, so as to determine a pooled output value of the matrix element.
Fig. 9 is a schematic structural diagram of the set determination unit 7032 in the second schematic structural diagram of the pooling device for a neural network according to an exemplary embodiment of the present application.
As shown in fig. 9, in an exemplary embodiment, the set determining unit 7032 includes:
a difference determination subunit 70321, configured to calculate a first mean value of elements of the matrix elements other than the noise elements;
a first set determination subunit 70322, configured to determine a first set of mean values of the matrix elements according to the first mean values;
a second set determination subunit 70323, configured to determine a first set of mean values of the matrix elements according to the first and second set of mean values.
In an exemplary embodiment, the first set determination subunit 70322 is operable to perform the steps of:
determining the absolute value corresponding to each difference value;
determining the mean value of the absolute values corresponding to the difference values as a second mean value;
and determining a second mean value set according to the second mean value.
Exemplary electronic device
FIG. 10 illustrates a block diagram of an electronic device in accordance with an embodiment of the present application.
As shown in fig. 10, the electronic device 100 includes one or more processors 101 and memory 102.
The processor 101 may be a Central Processing Unit (CPU) or other form of processing unit having data processing capabilities and/or instruction execution capabilities, and may control other components in the electronic device 100 to perform desired functions.
Memory 102 may include one or more computer program products that may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. The volatile memory may include, for example, Random Access Memory (RAM), cache memory (cache), and/or the like. The non-volatile memory may include, for example, Read Only Memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium and executed by the processor 101 to implement the pooling method for neural networks of the various embodiments of the present application described above and/or other desired functionality.
In one example, the electronic device 100 may further include: an input device 103 and an output device 104, which are interconnected by a bus system and/or other form of connection mechanism (not shown).
Of course, for the sake of simplicity, only some of the components related to the present application in the electronic apparatus 100 are shown in fig. 10, and components such as a bus, an input/output interface, and the like are omitted. In addition, electronic device 100 may include any other suitable components depending on the particular application.
Exemplary computer program product and computer-readable storage Medium
In addition to the above-described methods and apparatus, embodiments of the present application may also be a computer program product comprising computer program instructions that, when executed by a processor, cause the processor to perform the steps in the pooling method for neural networks according to various embodiments of the present application described in the "exemplary methods" section above of this specification.
The computer program product may be written with program code for performing the operations of embodiments of the present application in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server.
Furthermore, embodiments of the present application may also be a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, cause the processor to perform the steps in the pooling method for neural networks according to various embodiments of the present application described in the "exemplary methods" section above in this specification.
The computer-readable storage medium may take any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may include, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The foregoing describes the general principles of the present application in conjunction with specific embodiments, however, it is noted that the advantages, effects, etc. mentioned in the present application are merely examples and are not limiting, and they should not be considered essential to the various embodiments of the present application. Furthermore, the foregoing disclosure of specific details is for the purpose of illustration and description and is not intended to be limiting, since the foregoing disclosure is not intended to be exhaustive or to limit the disclosure to the precise details disclosed.
The block diagrams of devices, apparatuses, systems referred to in this application are only given as illustrative examples and are not intended to require or imply that the connections, arrangements, configurations, etc. must be made in the manner shown in the block diagrams. These devices, apparatuses, devices, systems may be connected, arranged, configured in any manner, as will be appreciated by those skilled in the art. Words such as "including," "comprising," "having," and the like are open-ended words that mean "including, but not limited to," and are used interchangeably therewith. The words "or" and "as used herein mean, and are used interchangeably with, the word" and/or, "unless the context clearly dictates otherwise. The word "such as" is used herein to mean, and is used interchangeably with, the phrase "such as but not limited to".
It should also be noted that in the devices, apparatuses, and methods of the present application, the components or steps may be decomposed and/or recombined. These decompositions and/or recombinations are to be considered as equivalents of the present application.
The previous description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present application. Various modifications to these aspects will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other aspects without departing from the scope of the application. Thus, the present application is not intended to be limited to the aspects shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing description has been presented for purposes of illustration and description. Furthermore, the description is not intended to limit embodiments of the application to the form disclosed herein. While a number of example aspects and embodiments have been discussed above, those of skill in the art will recognize certain variations, modifications, alterations, additions and sub-combinations thereof.

Claims (10)

1. A pooling method for a neural network, comprising:
inputting the image into a convolution layer of a neural network to obtain a characteristic diagram;
acquiring matrix elements of the characteristic diagram under a preset data window according to a preset pooling step length;
determining a first mean value set of the matrix elements according to noise elements in the matrix elements;
and determining the pooling output value of the matrix element according to the first mean value set of the matrix element.
2. The method of claim 1, wherein the determining a first set of means of the matrix elements from noise elements in the matrix elements comprises:
calculating a first average value of elements except noise elements in the matrix elements;
and determining a first mean value set of the matrix elements according to the first mean value.
3. The method of claim 2, the determining a first set of mean values for the matrix elements from the first mean values comprising:
determining a difference value between any two adjacent elements in the matrix elements, wherein the two adjacent elements meet a preset condition;
determining a second mean value set according to each difference value;
and determining a first mean value set of the matrix elements according to the first mean value and the second mean value set.
4. The method of claim 3, wherein said determining a second set of means from each of said difference values comprises:
determining the absolute value corresponding to each difference value;
determining the mean value of the absolute values corresponding to the difference values as a second mean value;
and determining a second mean value set according to the second mean value.
5. The method of claim 4, the two neighboring elements satisfying a preset condition comprising: the two adjacent elements are any one of row elements, column elements and diagonal elements in the matrix elements;
the second set of means includes: and the second average value corresponds to any one or more of row elements, column elements and diagonal elements in the matrix elements.
6. The method of claim 1, wherein the determining the pooled output values of the matrix elements from the first set of means of the matrix elements comprises:
obtaining a weight value corresponding to each mean value in the first mean value set;
and according to the weight value corresponding to each mean value in the first mean value set, carrying out weighted summation on the mean values in the first mean value set, and determining the pooled output value of the matrix elements.
7. The method of any one of claims 1 to 6, wherein the noise elements comprise maxima and/or minima in the matrix elements.
8. A pooling device for a neural network, comprising:
the characteristic extraction module is used for inputting the image into the convolution layer of the neural network to obtain a characteristic diagram;
the acquisition module is used for acquiring matrix elements of the characteristic diagram under a preset data window according to a preset pooling step length;
the calculation module is used for determining a first mean value set of the matrix elements according to the noise elements in the matrix elements;
and the output module is used for determining the pooling output value of the matrix element according to the first mean value set of the matrix element.
9. A computer-readable storage medium storing a computer program for performing the pooling method for neural networks of any of the above claims 1-7.
10. An electronic device, the electronic device comprising:
a processor;
a memory for storing the processor-executable instructions;
the processor is configured to read the executable instructions from the memory and execute the instructions to implement the pooling method for neural network of any of the above claims 1-7.
CN202010039300.6A 2020-01-14 2020-01-14 Pooling method and device for neural network Pending CN113191480A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010039300.6A CN113191480A (en) 2020-01-14 2020-01-14 Pooling method and device for neural network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010039300.6A CN113191480A (en) 2020-01-14 2020-01-14 Pooling method and device for neural network

Publications (1)

Publication Number Publication Date
CN113191480A true CN113191480A (en) 2021-07-30

Family

ID=76972436

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010039300.6A Pending CN113191480A (en) 2020-01-14 2020-01-14 Pooling method and device for neural network

Country Status (1)

Country Link
CN (1) CN113191480A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107766292A (en) * 2017-10-30 2018-03-06 中国科学院计算技术研究所 A kind of Processing with Neural Network method and processing system
CN108932536A (en) * 2018-07-18 2018-12-04 电子科技大学 Human face posture method for reconstructing based on deep neural network
CN109829506A (en) * 2019-02-18 2019-05-31 南京旷云科技有限公司 Image processing method, device, electronic equipment and computer storage medium
CN110309906A (en) * 2019-05-23 2019-10-08 北京百度网讯科技有限公司 Image processing method, device, machine readable storage medium and processor
CN110390650A (en) * 2019-07-23 2019-10-29 中南大学 OCT image denoising method based on intensive connection and generation confrontation network

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107766292A (en) * 2017-10-30 2018-03-06 中国科学院计算技术研究所 A kind of Processing with Neural Network method and processing system
CN108932536A (en) * 2018-07-18 2018-12-04 电子科技大学 Human face posture method for reconstructing based on deep neural network
CN109829506A (en) * 2019-02-18 2019-05-31 南京旷云科技有限公司 Image processing method, device, electronic equipment and computer storage medium
CN110309906A (en) * 2019-05-23 2019-10-08 北京百度网讯科技有限公司 Image processing method, device, machine readable storage medium and processor
CN110390650A (en) * 2019-07-23 2019-10-29 中南大学 OCT image denoising method based on intensive connection and generation confrontation network

Similar Documents

Publication Publication Date Title
JP7058373B2 (en) Lesion detection and positioning methods, devices, devices, and storage media for medical images
WO2019201035A1 (en) Method and device for identifying object node in image, terminal and computer readable storage medium
WO2021073493A1 (en) Image processing method and device, neural network training method, image processing method of combined neural network model, construction method of combined neural network model, neural network processor and storage medium
CN111402130B (en) Data processing method and data processing device
US10733705B2 (en) Information processing device, learning processing method, learning device, and object recognition device
CN109117846B (en) Image processing method and device, electronic equipment and computer readable medium
JP2017004350A (en) Image processing system, image processing method and program
CN111428805B (en) Method for detecting salient object, model, storage medium and electronic device
CN113343958B (en) Text recognition method, device, equipment and medium
CN109313806A (en) Image processing apparatus, image processing system, image processing method and program
CN112597918A (en) Text detection method and device, electronic equipment and storage medium
CN111226226A (en) Motion-based object detection method, object detection device and electronic equipment
CN110503002B (en) Face detection method and storage medium
CN112001923A (en) Retina image segmentation method and device
CN111414913B (en) Character recognition method, recognition device and electronic equipment
CN114139630A (en) Gesture recognition method and device, storage medium and electronic equipment
CN111709338B (en) Method and device for table detection and training method of detection model
CN116229262A (en) Modeling method and device for building information model
CN113191480A (en) Pooling method and device for neural network
JP2021061546A (en) Imaging apparatus, control method of the same, and program
CN114239760B (en) Multi-modal model training and image recognition method and device, and electronic equipment
CN107977923B (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN113762017B (en) Action recognition method, device, equipment and storage medium
US10938999B2 (en) Image processing apparatus that performs filter operation on group of regions in an image, image processing method and non-transitory computer- readable storage medium
CN112651494A (en) Training method of neural network for cable anti-winding early warning

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination