An edge pooling method and device based on edge information in a feature map of an image

By calculating the edge information of the feature map in the convolutional neural network and using the edge pooling method, the problem of edge information loss in the existing pooling method is solved, the network performance is improved and the impact of noise is reduced.

CN118429661BActive Publication Date: 2026-11-24CHINESE PEOPLES LIBERATION ARMY UNIT 63891
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410312045.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-19
Publication Date
2026-11-24
Estimated Expiration
2044-03-19

AI Technical Summary

Technical Problem

Existing pooling methods in convolutional neural networks ignore areas where grayscale values ​​change abruptly in feature maps, resulting in the loss of edge information and affecting image understanding and processing performance.

Method used

This paper proposes an edge pooling method based on edge information in the feature map of an image. By calculating the absolute value of the difference between elements in the pooling region, the average value or probability weight of the largest absolute value pair is selected as the pooling output, thus focusing on and preserving edge information.

Benefits of technology

Without increasing computational complexity and hyperparameters, the performance of convolutional neural networks is improved, important edge information of image content is preserved, and the impact of noise is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118429661B_ABST
    Figure CN118429661B_ABST
Patent Text Reader

Abstract

This invention provides an edge pooling method and apparatus based on edge information in a feature map of an image. The method includes obtaining the feature map through a pooling layer and dividing the feature map into multiple pooling regions. For each pooling region, the following operations are performed: determining the absolute value of the difference between an element in the pooling region and each element adjacent to it, wherein the elements adjacent to the element include those adjacent to it in the vertical, horizontal, and diagonal directions; and taking the average of the two elements corresponding to the largest absolute value as the pooling output of the pooling region. This method can retain edge information that is crucial for understanding image content during the pooling process, thus helping to improve the performance of convolutional neural networks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to an edge pooling method and apparatus based on edge information in the feature map of an image. Background Technology

[0002] When processing images using convolutional neural networks, for various types of images, such as visible light images, infrared images, and satellite images, the images are often first processed into corresponding feature maps through convolutional layers, and then pooling layers are used to perform pooling operations on the feature maps.

[0003] Pooling layers are a crucial component of convolutional neural networks (CNNs). They downsample the feature maps of the previous network layer, generating new feature maps with reduced resolution. Adding pooling layers to a CNN reduces the number of parameters or weights, lowering computational overhead and preventing overfitting. It also enhances the network's invariance to spatial transformations such as translation, rotation, and scaling. Essentially, pooling aggregates multiple values ​​from a specific region in a feature map into a single value. Its key lies in extracting the most representative feature information from that region while ignoring irrelevant and redundant information.

[0004] Common traditional pooling methods in convolutional neural networks include average pooling and max pooling. Average pooling calculates the mean of all elements within the pooling region, while max pooling only retains the largest element within that region. Because these two methods are computationally simple and perform well, they are widely used in various convolutional neural network architectures. However, both methods have their drawbacks. Max pooling completely ignores elements other than the largest element, easily losing some detailed information, while average pooling ignores the importance of elements of different sizes, leading to reduced contrast in the resulting feature map.

[0005] With the gradual optimization of convolutional neural network architectures and the deepening research on pooling methods, many new pooling methods have emerged, such as median pooling, K-max pooling, and L-max pooling. p Pooling methods include random pooling, hybrid pooling, spectral pooling, spatial pyramid pooling, edge-aware pyramid pooling, and region-of-interest pooling. These methods improve upon the computation of pooling results in different ways and have achieved performance superior to average pooling and max pooling in relevant application areas and experimental conditions. However, the computation of these pooling methods is usually quite complex, and some methods even introduce additional hyperparameters that need to be learned, thus increasing the training overhead of convolutional neural networks.

[0006] However, the aforementioned pooling methods do not consider abrupt changes in grayscale values ​​in the feature map when calculating the pooling results, i.e., they ignore edge information in the feature map. Human visual cells are highly sensitive to the edges of objects; similarly, in fields such as computer vision, edges in images play a crucial role in understanding image content and processing images. This application proposes an edge pooling method and apparatus based on edge information in the feature map of an image. Summary of the Invention

[0007] To address the aforementioned technical problems, this invention proposes an edge pooling method and apparatus based on edge information in the feature map of an image, thereby resolving the issues existing in the prior art.

[0008] This invention proposes an edge pooling method based on edge information in the feature map of an image, the method comprising:

[0009] Step S1: Construct a convolutional neural network model, which includes convolutional layers and pooling layers; acquire an image, and generate a feature map corresponding to the image through the convolutional layers; acquire the feature map through the pooling layers, and divide the feature map into multiple pooling regions according to the pooling parameters. Each pooling region contains h×w elements, where h is the number of elements in the width of the pooling region and w is the number of elements in the length of the pooling region.

[0010] Step S2: When the convolutional neural network model is in the forward propagation stage, the pooling layer performs the following operations for each pooling region: the pooling region is denoted as R. j Calculate element a. i and element a i The absolute value of the difference between adjacent elements, where 1 ≤ i ≤ h × w, and the difference between element a and the element a. i Each adjacent element, including the element a i Among the adjacent elements in the vertical, horizontal, and diagonal directions, find the two elements corresponding to the largest absolute value, denoted as a. p and a q Where 1≤p≤h×w, 1≤q≤h×w, p<q; element a p and a q The average value is used as the pooling region R j The pooled output; records the pooling history information, i.e., the values ​​of element indices p and q, represented as (p, q); element a i The index i of the element is incremented from left to right in the same row and from top to bottom in the same column; p and q are the indices of the two elements corresponding to the maximum absolute value, respectively.

[0011] Preferably, if there are more than one pair of elements corresponding to the maximum absolute value, these pairs of elements are denoted as (api a qi Let ), where 1 ≤ pi ≤ h × w, 1 ≤ qi ≤ h × w, pi < qi, and pi and qi are the subscripts of the two elements corresponding to the largest absolute value; then select the pair of elements with the smallest pi and denote them as a. p and a q If there is more than one pair of elements with the smallest pi, then select the pair with the smallest qi from the multiple pairs of elements with the smallest pi, and denote them as a. p and a q .

[0012] Preferably, when the convolutional neural network model is in the backpropagation phase, the error Err of each pooling region is determined based on the feedback from the network layer located after the pooling layer in the convolutional neural network model; for each pooling region, the following operations are performed: for pooling region R j The corresponding error Err j , causing Err' j =Err j / 2; Err is accessed through the element index (p, q) recorded during the forward propagation phase. j To pinpoint the source, that is, Err' j Passed to pooling region R j element a in p and a q The corresponding neuron, and passes 0 to R j The neurons corresponding to the other elements in the text.

[0013] Preferably, when the convolutional neural network model is in the testing phase, the pooling layer performs the following operations for each pooling region: the pooling region is denoted as R. j Calculate element a. i and element a i The absolute value of the difference between adjacent elements, where 1 ≤ i ≤ h × w, and the difference between element a and the element a. i Each adjacent element, including the element a i Among the adjacent elements in the vertical, horizontal, and diagonal directions, find the two elements corresponding to the largest absolute value, denoted as a. p and a q Where 1≤p≤h×w, 1≤q≤h×w, p<q; element a p and a q The probability weighting is used as the pooling region R j Pooling output; element a i The index i of the element is incremented from left to right within the same row and from top to bottom within the same column; p and q are the indices of the two elements corresponding to the maximum absolute value, respectively; where the pooling region R... jThe pooling output is:

[0014]

[0015] Among them, Vala p Vala q element a p a q The corresponding value;

[0016] If the maximum absolute value corresponds to more than one pair of elements, these pairs of elements are denoted as (a pi a qi Let ), where 1 ≤ pi ≤ h × w, 1 ≤ qi ≤ h × w, pi < qi, and pi and qi are the subscripts of the two elements corresponding to the largest absolute value; then select the pair of elements with the smallest pi and denote them as a. p and a q If there is more than one pair of elements with the smallest pi, then select the pair with the smallest qi from the pairs with the smallest pi and denote them as a. p and a q .

[0017] This invention provides an edge pooling device based on edge information in the feature map of an image, the device comprising:

[0018] Initialization module: configured to build a convolutional neural network model, the convolutional neural network model including convolutional layers and pooling layers; acquire an image, generate a feature map corresponding to the image through the convolutional layers; acquire the feature map through the pooling layers, and divide the feature map into multiple pooling regions according to the pooling parameters, each pooling region containing h×w elements, where h is the number of elements in the wide side of the pooling region, and w is the number of elements in the long side of the pooling region;

[0019] Edge pooling module: Configured so that when the convolutional neural network model is in the forward propagation stage, the pooling layer performs the following operations for each pooling region: The pooling region is denoted as R. j Calculate element a. i and element a i The absolute value of the difference between adjacent elements, where 1 ≤ i ≤ h × w, and the difference between element a and the element a. i Each adjacent element, including the element a i Among the adjacent elements in the vertical, horizontal, and diagonal directions, find the two elements corresponding to the largest absolute value, denoted as a. p and a q Where 1≤p≤h×w, 1≤q≤h×w, p<q; element a p and a q The average value is used as the pooling region R jThe pooled output; records the pooling history information, i.e., the values ​​of element indices p and q, represented as (p, q); element a i The index i of the element is incremented from left to right in the same row and from top to bottom in the same column; p and q are the indices of the two elements corresponding to the maximum absolute value, respectively.

[0020] This invention provides an electronic device, the device comprising:

[0021] At least one processor; and

[0022] A memory communicatively connected to the at least one processor; wherein,

[0023] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method as described above.

[0024] The present invention provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to perform the method described above.

[0025] This invention employs a relatively simple pooling result calculation method that does not introduce additional hyperparameters. It focuses on edge information, which plays an important role in understanding image content, and preserves edge information in the feature map during the pooling process, thereby improving the performance of convolutional neural networks.

[0026] The present invention has the following technical effects:

[0027] (1) When calculating the pooling result, this invention focuses on the places where the gray value changes abruptly in the feature map. During the pooling process, it retains the edge information that plays an important role in understanding the image content, which helps to improve the performance of the convolutional neural network.

[0028] (2) The solution of the present invention is relatively simple and does not introduce additional hyperparameters, and will not significantly increase the training overhead of the convolutional neural network;

[0029] (3) In the testing phase, the present invention calculates the pooling output by probability weighting, which helps to reduce the noise introduced by the pooling operation.

[0030] It should be understood that the description in the Summary of the Invention is not intended to limit the key or essential features of the embodiments of this disclosure, nor is it intended to restrict the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0031] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. The drawings are provided for a better understanding of the invention and are not intended to limit the scope of this disclosure. In the drawings, the same or similar reference numerals denote the same or similar elements, wherein:

[0032] Figure 1 This is a flowchart illustrating the edge pooling method based on edge information in the feature map of an image proposed in this invention.

[0033] Figure 2 This is a schematic diagram of the edge pooling method based on edge information in the feature map of an image proposed in this invention;

[0034] Figure 3 This is a schematic diagram of edge pooling with a pooling region of 2×2 and a step size of 2 proposed in this invention.

[0035] Figure 4 This is a schematic diagram illustrating the selection results when the maximum absolute value corresponds to multiple element pairs, as proposed in this invention.

[0036] Figure 5 This is a schematic diagram of the edge pooling device based on edge information in the feature map of an image proposed in this invention. Detailed Implementation

[0037] To make the objectives, technical solutions, and advantages of the embodiments of this disclosure clearer, the technical solutions of the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this disclosure, and not all embodiments. Based on the embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this disclosure.

[0038] Figure 1 An edge pooling method based on edge information in the feature map of an image is shown. The method includes:

[0039] Step S1: Construct a convolutional neural network model, which includes convolutional layers and pooling layers; acquire an image, and generate a feature map corresponding to the image through the convolutional layers; acquire the feature map through the pooling layers, and divide the feature map into multiple pooling regions according to the pooling parameters. Each pooling region contains h×w elements, where h is the number of elements in the width of the pooling region and w is the number of elements in the length of the pooling region.

[0040] Step S2: When the convolutional neural network model is in the forward propagation stage, the pooling layer performs the following operations for each pooling region: the pooling region is denoted as R. j Calculate element a.i and element a i The absolute value of the difference between adjacent elements, where 1 ≤ i ≤ h × w, and the difference between element a and the element a. i Each adjacent element, including the element a i Among the adjacent elements in the vertical, horizontal, and diagonal directions, find the two elements corresponding to the largest absolute value, denoted as a. p and a q Where 1≤p≤h×w, 1≤q≤h×w, p<q; element a p and a q The average value is used as the pooling region R j The pooled output; records the pooling history information, i.e., the values ​​of element indices p and q, represented as (p, q); element a i The index i of the element is incremented from left to right in the same row and from top to bottom in the same column; p and q are the indices of the two elements corresponding to the maximum absolute value, respectively.

[0041] In this embodiment, the image is applicable to various technical fields, such as visible light images, infrared images, and satellite images; the feature map corresponding to the generated image includes image features corresponding to visible light images, infrared images, and satellite images.

[0042] Step S2 includes:

[0043] During the forward propagation phase, for each pooling region R in the feature map... j Select the two adjacent elements 'a' with the largest absolute difference. p and a q :

[0044]

[0045] Where a p a q For pooling region R j Two adjacent elements in the array. Let a... p and a q The average value is used as the pooling region R j Pooled output:

[0046]

[0047] In this embodiment, the convolutional neural network model is a neural network model known in the art.

[0048] Furthermore, if there are more than one pair of elements corresponding to the maximum absolute value, these pairs of elements are denoted as (a pi a qiLet ), where 1 ≤ pi ≤ h × w, 1 ≤ qi ≤ h × w, pi < qi, and pi and qi are the subscripts of the two elements corresponding to the largest absolute value; then select the pair of elements with the smallest pi and denote them as a. p and a q If there is more than one pair of elements with the smallest pi, then select the pair with the smallest qi from the multiple pairs of elements with the smallest pi, and denote them as a. p and a q .

[0049] Furthermore, during the backpropagation phase of the convolutional neural network model, the error Err of each pooling region is determined based on the feedback from the network layer located after the pooling layer in the convolutional neural network model; for each pooling region, the following operations are performed: for pooling region R... j The corresponding error Err j , causing Err' j =Err j / 2; Err is accessed through the element index (p, q) recorded during the forward propagation phase. j To pinpoint the source, that is, Err' j Passed to pooling region R j element a in p and a q The corresponding neuron, and passes 0 to R j The neurons corresponding to the other elements in the text.

[0050] Furthermore, when the convolutional neural network model is in the testing phase, the pooling layer performs the following operations for each pooling region: the pooling region is denoted as R. j Calculate element a. i and element a i The absolute value of the difference between adjacent elements, where 1 ≤ i ≤ h × w, and the difference between element a and the element a. i Each adjacent element, including the element a i Among the adjacent elements in the vertical, horizontal, and diagonal directions, find the two elements corresponding to the largest absolute value, denoted as a. p and a q Where 1≤p≤h×w, 1≤q≤h×w, p<q; element a p and a q The probability weighting is used as the pooling region R j Pooling output; element a i The index i of the element is incremented from left to right within the same row and from top to bottom within the same column; p and q are the indices of the two elements corresponding to the largest absolute value, respectively.

[0051] In this embodiment, the probability weight of these two elements is used as R.j The pooled output is used to reduce the noise introduced by the pooling operation.

[0052] In this embodiment, during the testing phase, for each pooling region R in the feature map... j Select the two adjacent elements 'a' with the largest absolute difference. p and a q :

[0053]

[0054] Where a p a q For pooling region R j Two adjacent elements in the array. Let a... p and a q The probability weighting is used as the pooling region R j Pooled output:

[0055]

[0056] Preferably, if there are more than one pair of elements corresponding to the maximum absolute value, these pairs of elements are denoted as (a pi a qi Let ), where 1 ≤ pi ≤ h × w, 1 ≤ qi ≤ h × w, pi < qi, and pi and qi are the subscripts of the two elements corresponding to the largest absolute value; then select the pair of elements with the smallest pi and denote them as a. p and a q If there is more than one pair of elements with the smallest pi, then select the pair with the smallest qi from the multiple pairs of elements with the smallest pi, and denote them as a. p and a q .

[0057] This invention provides a specific embodiment of an edge pooling method based on edge information in the feature map of an image. For example... Figure 2 As shown, it includes the following steps:

[0058] Step 1, Edge Pooling

[0059] During the forward propagation phase, for each pooling region R in the feature map... j Select the two elements 'a' with the largest absolute difference among all adjacent elements. p and a q The average of these two elements is taken as R. j The pooled output. The specific steps for calculating the pooled output are as follows:

[0060] Step 1.1, for each pooling region R in the feature map j Select the two adjacent elements 'a' with the largest absolute difference.p and a q :

[0061]

[0062] Where a p a q For pooling region R j If there exist multiple adjacent elements in a given set |a|, then... p -a q The largest (p, q) pair is selected only if the first pair is left as |a| p -a q The largest (p, q);

[0063] Step 1.2: Use the average of the two selected adjacent elements as the pooling output for that region.

[0064]

[0065] The main pseudocode for implementing the edge pooling calculation process is as follows:

[0066] (1) For a pooling region R of size H×W j Define a function MaxDifference2d(H, W, R) to find the index positions p and q of the two adjacent elements with the largest absolute difference within the pooling region. j ).

[0067] The following pseudocode gives the MaxDifference2d(H, W, R) function. j One implementation of this is to traverse the pooling region R. j For each element in the array, for each current element, without exceeding the region boundaries, only consider its difference with the elements to its right, lower left, below, and lower right. `max` is used to record the current maximum difference, and `p` and `q` are used to record the indices of the two adjacent elements when a new maximum difference is found. After the traversal process is complete, return the indices `p` and `q` of the two adjacent elements with the largest absolute difference. The advantage of this implementation is that it avoids redundant calculations. For two adjacent elements `a`... p and a q If we iterate to a p It has already been calculated that it is related to a. q The difference, then when traversing to a q It will not calculate its relationship with a twice. p The difference; secondly, it can ensure that if multiple values ​​of |a| appear... p -a q The largest (p, q) pair is selected only if the first pair is left as |a| p -a qThe largest (p, q).

[0068] The pseudocode is as follows:

[0069]

[0070] Figure 3 The diagram illustrates edge pooling with a pooling region of 2×2 and a stride of 2, showing the result after the first step MaxDifference2d(H, W, R) j The function selects the two adjacent elements with the largest absolute difference in each pooling region. For the green pooling region in the lower left corner, element 6 and its three adjacent elements 2 all satisfy the condition of having the largest absolute difference, MaxDifference2d(H, W, R). j The function selects only element 6 and the element to its right 2.

[0071] To further illustrate MaxDifference2d(H, W, R) j The order of function selection Figure 4 Taking a 3×3 pooling region as an example, the MaxDifference2d(H, W, R) method is given. j The function, when multiple orders of |a appear, p -a q The selection order and results when the largest (p, q) pair is reached. (See diagram |a) p -a q The maximum value of |a is 7, and there exist 8 such that |a| = 7. p -a q The largest (p, q) pair is given in the figure: MaxDifference2d(H, W, R) j The selection order of the function ultimately results in the selection of the (p, q) pair corresponding to ① (1, 5).

[0072] (2) According to MaxDifference2d(H, W, R) j The function selects the (p, q) pair, and uses the average of the two corresponding adjacent elements as the pooling region R. j The pooled output, pseudocode is as follows:

[0073] 1.p, q=MaxDifference2d(H, W, Rj)

[0074] 2.sj=(Rj[p]+Rj[q]) / 2

[0075] Step 2: Record the index position

[0076] Record the pooling history information during the forward propagation phase, i.e., the values ​​of index positions p and q, denoted as (p, q).

[0077] Step 3: Backpropagation of error

[0078] During the backpropagation phase, the source of error is located based on the recorded (p, q), and the error is divided by 2 and passed to R. j The neurons at index positions p and q in R are used to pass 0 to R. j The neurons corresponding to the other elements in the text.

[0079] Step 4: Probability-weighted pooling

[0080] During the testing phase, for each pooling region R in the feature map... j Select the two elements 'a' with the largest absolute difference among all adjacent elements. p and a q The probabilities of these two elements are weighted and used as R. j The pooled output is used to reduce noise introduced by the pooling operation. The specific steps for calculating probability-weighted pooling are as follows:

[0081] Step 4.1, Testing Phase: For each pooling region R in the feature map... j Select the two adjacent elements 'a' with the largest absolute difference. p and a q :

[0082]

[0083] Where a p a q For pooling region R j If there exist multiple adjacent elements in a given set |a|, then... p -a q The largest (p, q) pair is selected only if the first pair is left as |a| p -a q The largest (p, q);

[0084] Step 4.2: The probability weights of the two selected adjacent elements are used as the pooling output for that region.

[0085]

[0086] The main pseudocode for implementing the probability-weighted pooling calculation process is as follows:

[0087] 1.p, q=MaxDifference2d(H, W, Rj)

[0088] 2.sj=(Rj[p]*Rj[p]+Rj[q]*Rj[q]) / (Rj[p]+Rj[q])

[0089] like Figure 5 As shown, this invention proposes an edge pooling device based on edge information in the feature map of an image, the device comprising:

[0090] Initialization module: configured to build a convolutional neural network model, the convolutional neural network model including convolutional layers and pooling layers; acquire an image, generate a feature map corresponding to the image through the convolutional layers; acquire the feature map through the pooling layers, and divide the feature map into multiple pooling regions according to the pooling parameters, each pooling region containing h×w elements, where h is the number of elements in the wide side of the pooling region, and w is the number of elements in the long side of the pooling region;

[0091] Edge pooling module: Configured so that when the convolutional neural network model is in the forward propagation stage, the pooling layer performs the following operations for each pooling region: The pooling region is denoted as R. j Calculate element a. i and element a i The absolute value of the difference between adjacent elements, where 1 ≤ i ≤ h × w, and the difference between element a and the element a. i Each adjacent element, including the element a i Among the adjacent elements in the vertical, horizontal, and diagonal directions, find the two elements corresponding to the largest absolute value, denoted as a. p and a q Where 1≤p≤h×w, 1≤q≤h×w, p<q; element a p and a q The average value is used as the pooling region R j The pooled output; records the pooling history information, i.e., the values ​​of element indices p and q, represented as (p, q); element a i The index i of the element is incremented from left to right in the same row and from top to bottom in the same column; p and q are the indices of the two elements corresponding to the maximum absolute value, respectively.

[0092] These modules can be one or more integrated circuits configured to implement the above methods, such as one or more Application Specific Integrated Circuits (ASICs), one or more digital signal processors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs). Alternatively, when a module is implemented using processing element scheduler code, the processing element can be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor capable of calling program code. Furthermore, these modules can be integrated together as a system-on-a-chip (SOC).

[0093] The modules described above can be connected or communicate with each other via wired or wireless connections. Wired connections can include metal cables, optical fibers, hybrid cables, or any combination thereof. Wireless connections can include connections via LAN, WAN, Bluetooth, ZigBee, or NFC, or any combination thereof. Two or more modules can be combined into a single module, and any module can be divided into two or more units. Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems and devices described above can be referred to the corresponding processes in the method embodiments, and will not be repeated here.

[0094] Optionally, this application also provides a program product, such as a computer-readable storage medium, including a program that, when executed by a processor, performs the above-described method embodiments.

[0095] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0096] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0097] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or in a combination of hardware and software functional units.

[0098] The integrated units implemented as software functional units described above can be stored in a computer-readable storage medium. These software functional units, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

Claims

1. An edge pooling method based on edge information in the feature map of an image, characterized in that, The method includes the following steps: Step S1: Construct a convolutional neural network model, which includes convolutional layers and pooling layers; acquire an image, and generate a feature map corresponding to the image through the convolutional layers; acquire the feature map through the pooling layers, and divide the feature map into multiple pooling regions according to the pooling parameters. Each pooling region contains h×w elements, where h is the number of elements in the width of the pooling region and w is the number of elements in the length of the pooling region. Step S2: When the convolutional neural network model is in the forward propagation stage, the pooling layer performs the following operations for each pooling region: the pooling region is denoted as R. j Calculate element a. i and element a i The absolute value of the difference between adjacent elements, where 1 ≤ i ≤ h × w, and the difference between element a and the element a. i Each adjacent element, including the element a i Among the adjacent elements in the vertical, horizontal, and diagonal directions, find the two elements corresponding to the largest absolute value, denoted as a. p and a q Where 1≤p≤h×w, 1≤q≤h×w, p<q; element a p and a q The average value is used as the pooling region R j The pooled output; records the pooling history information, i.e., the values ​​of element indices p and q, represented as (p, q); element a i The index i of the element is incremented from left to right in the same row and from top to bottom in the same column; p and q are the indices of the two elements corresponding to the maximum absolute value, respectively.

2. The method as described in claim 1, characterized in that, If the maximum absolute value corresponds to more than one pair of elements, these pairs of elements are denoted as (a pi a qi Let ), where 1 ≤ pi ≤ h × w, 1 ≤ qi ≤ h × w, pi < qi, and pi and qi are the subscripts of the two elements corresponding to the largest absolute value; then select the pair of elements with the smallest pi and denote them as a. p and a q If there is more than one pair of elements with the smallest pi, then select the pair with the smallest qi from the multiple pairs of elements with the smallest pi, and denote them as a. p and a q .

3. The method as described in claim 2, characterized in that, When the convolutional neural network model is in the backpropagation phase, the error Err of each pooling region is determined based on the feedback from the network layer located after the pooling layer in the convolutional neural network model; for each pooling region, the following operations are performed: for pooling region R j The corresponding error Err j , causing Err' j =Err j / 2; Err is accessed through the element index (p, q) recorded during the forward propagation phase. j To pinpoint the source, that is, Err' j Passed to pooling region R j element a in p and a q The corresponding neuron, and passes 0 to R j The neurons corresponding to the other elements in the text.

4. The method as described in claim 1, characterized in that, When the convolutional neural network model is in the testing phase, the pooling layer performs the following operations for each pooling region: the pooling region is denoted as R. j Calculate element a. i and element a i The absolute value of the difference between adjacent elements, where 1 ≤ i ≤ h × w, and the difference between element a and the element a. i Each adjacent element, including the element a i Among the adjacent elements in the vertical, horizontal, and diagonal directions, find the two elements corresponding to the largest absolute value, denoted as a. p and a q Where 1≤p≤h×w, 1≤q≤h×w, p<q; element a p and a q The probability weighting is used as the pooling region R j Pooling output; element a i The index i of the element is incremented from left to right within the same row and from top to bottom within the same column; p and q are the indices of the two elements corresponding to the maximum absolute value, respectively; where the pooling region R... j The pooling output is: Among them, Vala p Vala q element a p a q The corresponding numerical value.

5. An edge pooling device based on edge information in a feature map of an image, characterized in that, include: Initialization module: configured to build a convolutional neural network model, which includes convolutional layers and pooling layers; An image is acquired, and a feature map corresponding to the image is generated through the convolutional layer; the feature map is acquired through the pooling layer, and the feature map is divided into multiple pooling regions according to the pooling parameters. Each pooling region contains h×w elements, where h is the number of elements in the width side of the pooling region, and w is the number of elements in the length side of the pooling region. Edge pooling module: Configured so that when the convolutional neural network model is in the forward propagation stage, the pooling layer performs the following operations for each pooling region: The pooling region is denoted as R. j Calculate element a. i and element a i The absolute value of the difference between adjacent elements, where 1 ≤ i ≤ h × w, and the difference between element a and the element a. i Each adjacent element, including the element a i Among the adjacent elements in the vertical, horizontal, and diagonal directions, find the two elements corresponding to the largest absolute value, denoted as a. p and a q Where 1≤p≤h×w, 1≤q≤h×w, p<q; element a p and a q The average value is used as the pooling region R j The pooled output; records the pooling history information, i.e., the values ​​of element indices p and q, represented as (p, q); element a i The index i of the element is incremented from left to right in the same row and from top to bottom in the same column; p and q are the indices of the two elements corresponding to the maximum absolute value, respectively.

6. An electronic device, characterized in that, The device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1-4.

7. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-4.

Citation Information

Patent Citations

  • Semantic segmentation method and system

    CN113128510A

  • Image processing method, electronic device, and computer-readable storage medium

    WO2020186385A1