Feature map processing method, device, equipment and storage medium
Patent Information
- Application Number
- CN202011371411.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-30
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2040-11-30
AI Technical Summary
Existing convolution and pooling methods cannot meet the requirements of retaining spatial features and having spatial invariance in target detection, resulting in limited detection accuracy.
A feature map processing method is proposed. By determining the processing window to slide on the feature map, convolution and pooling are performed in the current area in the processing window, and the sum of the convolution element and the pooling element is calculated as the output element to generate the output feature. picture.
This method can simultaneously extract high-level semantic features and detailed features, improve the accuracy of the target detection model, and meet the requirements of spatial invariance and equivariance.
Smart Images

Figure CN112488126B
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, specifically to the field of artificial intelligence technologies such as computer vision, augmented reality and deep learning, and in particular to feature map processing methods, devices, equipment and storage media. Background Art
[0002] The application of convolution and pooling in deep learning has achieved great success, constantly breaking records in classification data sets. However, detection and classification are different. Classification only needs to extract high-level semantics to determine the category it belongs to, while detection not only needs to classify the target, but also locate its position in the image. This requires that the extracted features are not only invariant, that is, they will not change with the rotation and scaling of the target, but also have equivariance, and move with the movement of the target position.
[0003] At present, convolution includes ordinary convolution, deformable convolution, dilated convolution, grouped convolution, depthwise separable convolution, etc., and pooling includes average pooling, maximum pooling, random pooling, spatial pyramid pooling, etc. Ordinary convolution uses a convolution kernel of size K×K (K is a positive integer) to slide on the feature map with a step size of S (S is a positive integer), and does not have spatial and scale invariance. Deformable convolution also learns an offset that causes the convolution kernel to shift at the sampling point of the input feature map, focusing on the area of interest and the target. Grouped convolution and depthwise separable convolution are both involved in reducing the amount of convolution operations, and do not have a fundamental improvement in feature extraction capabilities. Average pooling takes the average value of the S×S grid size input as output. Maximum pooling takes the maximum value in the S×S grid as output. Random pooling randomly selects a number in the grid as output. In short, pooling has a certain degree of spatial invariance but at the expense of positioning accuracy, which leads to the current object detection model rarely using it. Spatial pyramid pooling uses different step sizes for inputs of different sizes to ensure that the same size of output can be obtained. The existence of two quantizations restricts the further improvement of detection accuracy. In summary, the current convolution and pooling cannot meet the requirements of both retaining spatial features and having spatial invariance required for detection. Summary of the invention
[0004] The embodiments of the present application provide a feature map processing method, apparatus, device, and storage medium.
[0005] In the first aspect, an embodiment of the present application proposes a feature map processing method, including: determining a processing window, wherein the size of the processing window is larger than the size of the convolution kernel; sliding the processing window on the input feature map according to the convolution step size to determine the current area in the processing window; convolving at least a portion of the current area with the convolution kernel to obtain a convolution element, and pooling at least a portion of the current area to obtain a pooling element; calculating the sum of the convolution element and the pooling element as an output element; when the sliding of the processing window ends, generating an output feature map based on all output elements.
[0006] In the second aspect, an embodiment of the present application proposes a feature map processing device, comprising: a determination module, configured to determine a processing window, wherein the size of the processing window is larger than the size of the convolution kernel; a sliding module, configured to slide the processing window on the input feature map according to the convolution step size, and determine the current area in the processing window; a processing module, configured to convolve at least a portion of the current area with the convolution kernel to obtain a convolution element, and to pool at least a portion of the current area to obtain a pooling element; a calculation module, configured to calculate the sum of the convolution element and the pooling element as an output element; and a generation module, configured to generate an output feature map based on all output elements when the sliding of the processing window ends.
[0007] In the third aspect, an embodiment of the present application proposes a target detection method, comprising: obtaining an image to be detected; inputting the image to be detected into a target detection model to obtain the category and position of the target in the image to be detected, wherein the target detection model includes a convolutional pooling layer, and the convolutional pooling layer executes the method described in any implementation method of the first aspect.
[0008] In the fourth aspect, an embodiment of the present application proposes a target detection device, comprising: an acquisition module, configured to acquire an image to be detected; a detection module, configured to input the image to be detected into a target detection model to obtain the category and position of the target in the image to be detected, wherein the target detection model includes a convolutional pooling layer, and the convolutional pooling layer executes the method described in any implementation method in the first aspect.
[0009] In a fifth aspect, an embodiment of the present application proposes an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute a method described in any implementation manner in the first aspect or a method described in any implementation manner in the second aspect.
[0010] In a sixth aspect, an embodiment of the present application proposes a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute a method as described in any implementation manner in the first aspect or a method as described in any implementation manner in the second aspect.
[0011] The feature map processing method, device, equipment and storage medium provided in the embodiments of the present application first slide the determined processing window on the input feature map according to the convolution step size to determine the current area in the processing window; then use the convolution kernel to convolve at least part of the current area to obtain the convolution element, and pool at least part of the current area to obtain the pooling element; then calculate the sum of the convolution element and the pooling element as the output element; finally, when the processing window slides, generate an output feature map based on all output elements. Convolution and pooling are performed on the feature map at the same time, so that both high-level semantic features and detail features can be extracted, thereby enriching the extracted features.
[0012] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Other features, purposes and advantages of the present application will become more apparent by reading the detailed description of the non-limiting embodiments made with reference to the following drawings. The drawings are used to better understand the present solution and do not constitute a limitation of the present application. Among them:
[0014] Figure 1 is a flow chart of an embodiment of a feature graph processing method according to the present application;
[0015] Figure 2 is a flowchart of another embodiment of a feature map processing method according to the present application;
[0016] Figure 3 This is a schematic diagram of a non-center pooled convolution;
[0017] Figure 4 This is another schematic diagram of a non-center pooled convolution;
[0018] Figure 5 is a flow chart of an embodiment of a target detection method according to the present application;
[0019] Figure 6 is a structural schematic diagram of an embodiment of a feature graph processing device according to the present application;
[0020] Figure 7 is a schematic structural diagram of an embodiment of a target detection device according to the present application;
[0021] Figure 8 It is a block diagram of an electronic device used to implement the feature graph processing method of an embodiment of the present application. DETAILED DESCRIPTION
[0022] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0023] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0024] Figure 1 A process 100 of an embodiment of a feature graph processing method according to the present application is shown. The feature graph processing method comprises the following steps:
[0025] Step 101, determining a processing window.
[0026] In this embodiment, the execution subject of the feature map processing method can determine a processing window, wherein the processing window is a matrix for performing convolution and pooling processing on data at the same time, and is used to extract feature information from input data, and its size is larger than the size of the convolution kernel.
[0027] In some optional implementations of this embodiment, the execution subject may determine the initial processing window based on a preset size; if the preset size is larger than the size of the convolution kernel, the initial processing window is used as the processing window; if the preset size is smaller than the size of the convolution kernel, a black border is expanded around the initial processing window to generate a processing window. The size of the initial processing window is equal to the preset size. The size of the processing window is larger than the size of the convolution kernel. The pixel value of the expanded black border is equal to 0.
[0028] Step 102: Slide the processing window on the input feature map according to the convolution step size to determine the current area in the processing window.
[0029] In this embodiment, the execution subject may slide the processing window on the input feature map according to the convolution step size to determine the current area in the processing window. The sliding direction may be from left to right or from top to bottom. The current area in the processing window may be the area currently surrounded by the processing window on the input feature map.
[0030] Step 103: convolve at least a portion of the current region using a convolution kernel to obtain a convolution element, and pool at least a portion of the current region to obtain a pooling element.
[0031] In this embodiment, the execution subject may perform convolution on at least part of the current region using a convolution kernel to obtain convolution elements, and perform pooling on at least part of the current region to obtain pooling elements, wherein the convolution elements are detail features of the feature map, and the pooling elements are high-level semantic features.
[0032] Among them, pooling may include but is not limited to at least one of the following: average pooling, maximum pooling, random pooling and pyramid pooling, etc. Average pooling is also called mean-pooling, which is to average all values in the local receptive domain, and take the average value of the S×S grid size input as the output. Max-pooling is to take the point with the largest value in the local receptive domain, and take the maximum value in the S×S grid as the output. Stochastic Pooling can be regarded as normalizing the feature map values within a pooling window, and randomly sampling and selecting according to the probability value of the normalized feature map, that is, the probability of the element value being selected is also large, and a number in the grid is randomly selected as the output. The significance of spatial pyramid pooling is that feature maps of any size can be converted into feature vectors of fixed size, and different step sizes are used for inputs of different sizes to ensure that outputs of the same size can be obtained.
[0033] Step 104, calculate the sum of the convolution element and the pooling element as the output element.
[0034] In this embodiment, the execution entity may calculate the sum of the convolution element and the pooling element as the output element, so that the output element carries both detail features and high-level semantic features.
[0035] Step 105: When the processing window slides to the end, an output feature map is generated based on all output elements.
[0036] In this embodiment, when the processing window slides to the end, the above execution can mainly generate an output feature map based on all output elements. Among them, the pixel points of the output feature map are output elements. Since the output feature map is obtained by convolution and pooling the feature map at the same time, its size is smaller than the input feature map.
[0037] The feature map processing method provided in the embodiment of the present application first slides the determined processing window on the input feature map according to the convolution step size to determine the current area in the processing window; then, convolve at least part of the current area with the convolution kernel to obtain the convolution element, and pool at least part of the current area to obtain the pooling element; then calculate the sum of the convolution element and the pooling element as the output element; finally, when the processing window slides, generate an output feature map based on all the output elements. By simultaneously convolving and pooling the feature map, both high-level semantic features and detail features can be extracted, thereby enriching the extracted features.
[0038] Further references Figure 2 , which shows a process 200 of another embodiment of a feature graph processing method according to the present application. The feature graph processing method comprises the following steps:
[0039] Step 201, determine the processing window based on the size of the convolution kernel and the convolution step size.
[0040] In this embodiment, the execution entity may determine the processing window based on the size of the convolution kernel and the convolution step, so that the size of the processing window is larger than the size of the convolution kernel.
[0041] Assuming that the size of the convolution kernel is K×K (K≥3) and the convolution step is S (S is a positive integer), the size of the processing window can be: (2×S+K-2)×(2×S+K-2).
[0042] Step 202: Slide the processing window on the input feature map according to the convolution step size to determine the current area in the processing window.
[0043] In this embodiment, the specific operation of step 202 is already Figure 1 Step 102 is described in detail in the illustrated embodiment and will not be described again here.
[0044] Step 203, convolve the central area of the current area using the convolution kernel to obtain a convolution element.
[0045] In this embodiment, since the details of the target are usually in the central area, the above-mentioned execution subject can use the convolution kernel to convolve the central area of the current area to obtain the convolution element. Among them, the central area is centered on the center of the current area and its size is equal to the size of the convolution kernel. The convolution element is a detail feature used to locate the target. The convolution operation amount is: (K-2)×(K-2), where K is the size of the convolution kernel.
[0046] Step 204: pooling is performed on the surrounding area of the central area to obtain pooling elements.
[0047] In this embodiment, inspired by biological vision, the category can still be accurately identified by covering a part of the center, so the execution subject pools the surrounding area of the center area to obtain pooling elements. The pooling elements are high-level semantic features used to classify the target. The pooling operation amount is: S×4-4, S is the convolution step size.
[0048] Step 205, calculate the sum of the convolution element and the pooling element as the output element.
[0049] Step 206: When the processing window slides to the end, an output feature map is generated based on all output elements.
[0050] In this embodiment, the specific operations of steps 205-206 are already Figure 1 In the illustrated embodiment, steps 104 - 105 are described in detail and will not be repeated here.
[0051] from Figure 2 It can be seen that Figure 1 Compared with the corresponding embodiment, the process 200 of the feature map processing method in this embodiment highlights the convolution and pooling steps. Therefore, the scheme described in this embodiment is inspired by biological vision, and can still accurately identify the category to which it belongs by covering a part of the center. Convolution is performed on the central area and pooling is performed on the surrounding area, which can improve the accuracy of the extracted high-level semantic features and the accuracy of the extracted detail features, thereby improving the accuracy of target classification and positioning.
[0052] It should be noted that convolution of the central area and pooling of the surrounding area is also called non-center pooling convolution. Non-center pooling convolution can extract high-level semantic features of the surrounding area while retaining the detailed features of the central area, which can meet the requirements of detection correspondence invariance and equivariance. When applied to the target detection model, it can improve the accuracy of the target detection model.
[0053] For ease of understanding, Figure 3 A schematic diagram showing a non-center pooled convolution, Figure 4 Another schematic diagram of non-center pooled convolution is shown. Figure 3 As shown in , the size of the processing window is 3×3, and the size of the convolution kernel is 1×1. The central gray area performs convolution operations, and the surrounding white areas perform pooling operations. Figure 4 As shown in the figure, the size of the processing window is 5 × 5, and the size of the convolution kernel is 3 × 3. The central gray area performs convolution operation, and the surrounding white area performs pooling operation.
[0054] Further references Figure 5 , which shows a process 500 of an embodiment of a target detection method according to the present application. The target detection method comprises the following steps:
[0055] Step 501: Acquire an image to be detected.
[0056] In this embodiment, the execution subject of the target detection method can obtain an image to be detected. There is a target in the image to be detected. The target can be any tangible object that objectively exists in nature, including but not limited to people, animals, plants, objects, buildings, etc.
[0057] Step 502: input the image to be detected into the target detection model to obtain the category and position of the target in the image to be detected.
[0058] In this embodiment, the execution entity may input the image to be detected into the target detection model to obtain the category and position of the target in the image to be detected.
[0059] The target detection model here includes a convolutional pooling layer. The convolutional pooling layer can have the functions of a convolutional layer and a pooling layer at the same time, and is used to use a convolution kernel to convolve at least a part of the current area, and to pool at least a part of the current area. The convolutional pooling layer can execute a feature map processing method, and the feature map is an intermediate product of the target detection model processing the image. The target detection model may include multiple convolutional pooling layers. Taking the target detection model including two convolutional pooling layers as an example, the image is input to the first convolutional pooling layer, and the first convolutional pooling layer performs a convolutional pooling operation on the image to obtain a first feature map; the first feature map is input to the second convolutional pooling layer, and the second convolutional pooling layer performs a convolutional pooling operation on the first feature map to obtain a second feature map; the second feature map is input to the fully connected layer, and the fully connected layer combines the features of the second feature map to obtain the category and position of the target in the image.
[0060] The target detection method provided in the embodiment of the present application performs image detection using a target detection model including a convolutional pooling layer. The convolutional pooling layer can extract both high-level semantic features and detail features, thereby enriching the extracted features. High-level semantic features can be used to determine the category of the target in the image, thereby achieving classification of the target. High-level semantic features are invariant and will not cause category changes with target rotation, scaling, etc. Detail features can be used to determine the position of the target in the image, thereby achieving positioning of the target. Detail features are equivariant and move with the movement of the target position.
[0061] Further references Figure 6 As an implementation of the methods shown in the above figures, the present application provides an embodiment of a feature map processing device, and the device embodiment is similar to Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0062] like Figure 6 As shown, the feature map processing device 600 of this embodiment may include: a determination module 601, a sliding module 602, a processing module 603, a calculation module 604 and a generation module 605. Among them, the determination module 601 is configured to determine a processing window, wherein the size of the processing window is greater than the size of the convolution kernel; the sliding module 602 is configured to slide the processing window on the input feature map according to the convolution step size to determine the current area in the processing window; the processing module 603 is configured to convolve at least part of the current area using the convolution kernel to obtain a convolution element, and to pool at least part of the current area to obtain a pooling element; the calculation module 604 is configured to calculate the sum of the convolution element and the pooling element as an output element; the generation module 605 is configured to generate an output feature map based on all output elements when the processing window slides.
[0063] In this embodiment, in the feature graph processing device 600, the specific processing of the determination module 601, the sliding module 602, the processing module 603, the calculation module 604 and the generation module 605 and the technical effects thereof can be referred to respectively. Figure 2 The relevant descriptions of steps 201 - 205 in the corresponding embodiment are not repeated here.
[0064] In some optional implementations of this embodiment, the determination module 601 is further configured to: determine the processing window based on the size of the convolution kernel and the convolution step size.
[0065] In some optional implementations of this embodiment, the determination module 601 is further configured to: determine an initial processing window based on a preset size; if the preset size is smaller than the size of the convolution kernel, expand a black border around the initial processing window to generate a processing window.
[0066] In some optional implementations of this embodiment, the processing module 603 is further configured to: use a convolution kernel to convolve the central area of the current area to obtain a convolution element, wherein the central area is centered on the center of the current area and has a size equal to the size of the convolution kernel; and pool the surrounding area of the central area to obtain a pooling element.
[0067] In some optional implementations of this embodiment, pooling includes at least one of the following: average pooling, maximum pooling, random pooling, and pyramid pooling.
[0068] Further references Figure 7 As an implementation of the methods shown in the above figures, the present application provides an embodiment of a target detection device, which is similar to Figure 5 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0069] like Figure 7 As shown, the target detection device 700 of this embodiment may include: an acquisition module 701 and a detection module 702. The acquisition module 701 is configured to acquire an image to be detected; the detection module 702 is configured to input the image to be detected into a target detection model to obtain the category and position of the target in the image to be detected, wherein the target detection model includes a convolutional pooling layer, and the convolutional pooling layer performs the method described in any implementation manner of the first aspect.
[0070] In the target detection device 700, the specific processing of the acquisition module 701 and the detection module 702 and the technical effects thereof can be referred to in Figure 2 The relevant descriptions of steps 501-502 in the corresponding embodiment are not repeated here.
[0071] According to an embodiment of the present application, the present application also provides an electronic device and a readable storage medium.
[0072] like Figure 8 , is a block diagram of an electronic device according to a characteristic graph processing method of an embodiment of the present application. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples, and are not intended to limit the implementation of the present application described and / or required herein.
[0073] like Figure 8 As shown, the electronic device includes: one or more processors 801, memory 802, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are interconnected using different buses and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In other embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 8 A processor 801 is taken as an example.
[0074] The memory 802 is a non-transitory computer-readable storage medium provided in the present application. The memory stores instructions executable by at least one processor to enable the at least one processor to perform the feature graph processing method provided in the present application. The non-transitory computer-readable storage medium of the present application stores computer instructions, which are used to enable a computer to perform the feature graph processing method provided in the present application.
[0075] The memory 802 is a non-transient computer-readable storage medium that can be used to store non-transient software programs, non-transient computer executable programs and modules, such as program instructions / modules corresponding to the feature map processing method in the embodiment of the present application (for example, the attached Figure 6 The determination module 601, the sliding module 602, the processing module 603, the calculation module 604 and the generation module 605 are shown. Figure 7 The processor 801 executes various functional applications and data processing of the server by running the non-transient software programs, instructions and modules stored in the memory 802, that is, the feature map processing method in the above method embodiment is implemented.
[0076] The memory 802 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the use of an electronic device according to the feature graph processing method, etc. In addition, the memory 802 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory 802 may optionally include a memory remotely arranged relative to the processor 801, and these remote memories may be connected to the electronic device of the feature graph processing method via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0077] The electronic device of the feature graph processing method may further include: an input device 803 and an output device 804. The processor 801, the memory 802, the input device 803 and the output device 804 may be connected via a bus or other means. Figure 8 The example of connecting through bus is taken in the following.
[0078] The input device 803 can receive input digital or character information, and generate key signal input related to user settings and function control of the electronic device of the feature map processing method, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator rod, one or more mouse buttons, a trackball, a joystick and other input devices. The output device 804 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display and a plasma display. In some embodiments, the display device may be a touch screen.
[0079] Various implementations of the systems and techniques described herein can be realized in digital electronic circuit systems, integrated circuit systems, dedicated ASICs (application specific integrated circuits), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0080] These computer programs (also referred to as programs, software, software applications, or code) include machine instructions for programmable processors and can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, device, and / or means (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.
[0081] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0082] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0083] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.
[0084] According to the technical solution of the present application, the determined processing window is first slid on the input feature map according to the convolution step size to determine the current area in the processing window; then, at least part of the current area is convolved with a convolution kernel to obtain a convolution element, and at least part of the current area is pooled to obtain a pooling element; then the sum of the convolution element and the pooling element is calculated as the output element; finally, when the processing window slides, an output feature map is generated based on all output elements. By simultaneously convolving and pooling the feature map, both high-level semantic features and detail features can be extracted, thereby enriching the extracted features.
[0085] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution disclosed in this application can be achieved, and this document is not limited here.
[0086] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.
Claims
1. A target detection method, comprising: Acquire the image to be detected; Inputting the image to be detected into a target detection model to obtain the category and position of the target in the image to be detected, wherein the target detection model includes a convolutional pooling layer; Among them, the convolution pooling layer performs the following feature map processing method: Determining a processing window, wherein a size of the processing window is larger than a size of the convolution kernel; Slide the processing window on the input feature map according to the convolution step size to determine the current area in the processing window; Convolve the central area of the current area using a convolution kernel to obtain a convolution element, wherein the central area is centered on the center of the current area and has a size equal to the size of the convolution kernel; pool the surrounding area of the central area to obtain a pooling element; Calculate the sum of the convolution element and the pooling element as an output element; When the processing window slides to the end, an output feature map is generated based on all output elements.
2. The method according to claim 1, wherein: The determining of the processing window comprises: The processing window is determined based on the size of the convolution kernel and the convolution step size.
3. The method according to claim 1, wherein: The determining of the processing window comprises: determining an initial processing window based on a preset size; If the preset size is smaller than the size of the convolution kernel, a black border is expanded around the initial processing window to generate the processing window.
4. The method according to claim 1, wherein: Pooling includes at least one of the following: average pooling, maximum pooling, random pooling, and pyramid pooling.
5. A target detection device, comprising: An acquisition module is configured to acquire an image to be detected; A detection module is configured to input the image to be detected into a target detection model to obtain the category and position of the target in the image to be detected, wherein the target detection model includes a convolutional pooling layer; Wherein, the convolution pooling layer includes the following feature map processing device: A determination module is configured to determine a processing window, wherein the size of the processing window is larger than the size of the convolution kernel; A sliding module is configured to slide the processing window on the input feature map according to the convolution step size to determine a current area in the processing window; A processing module is configured to convolve a central area of the current area using a convolution kernel to obtain a convolution element, wherein the central area is centered on the center of the current area and has a size equal to the size of the convolution kernel; and pool the surrounding area of the central area to obtain a pooling element; A calculation module, configured to calculate the sum of the convolution element and the pooling element as an output element; The generating module is configured to generate an output feature map based on all output elements when the processing window slides to the end.
6. The device according to claim 5, wherein: The determination module is further configured to: The processing window is determined based on the size of the convolution kernel and the convolution step size.
7. The device according to claim 5, wherein: The determination module is further configured to: determining an initial processing window based on a preset size; If the preset size is smaller than the size of the convolution kernel, a black border is expanded around the initial processing window to generate the processing window.
8. The device according to claim 5, wherein: Pooling includes at least one of the following: average pooling, maximum pooling, random pooling, and pyramid pooling.
9. An electronic device, comprising: at least one processor; as well as 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, and the instructions are 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 to 4.
10. A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 4.
