Target detection method, device, neuromorphic device and medium

By adjusting the size and number of channels of the target image, and performing feature map extraction and fusion processing, the problem of insufficient network feature extraction and spatial positioning capabilities of the target detection algorithm in the existing technology is solved, and higher detection accuracy and speed are achieved.

CN113221896BActive Publication Date: 2024-10-15LYNXI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110605019.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-31
Publication Date
2024-10-15
Estimated Expiration
2041-05-31

AI Technical Summary

Technical Problem

Existing target detection algorithms have deficiencies in network feature extraction capabilities and spatial positioning capabilities, resulting in low detection accuracy and poor real-time performance.

Method used

By adjusting the image size and number of channels of the target image, the data rearranged image is obtained, and the feature map is extracted, and a variety of feature extraction methods are used for fusion processing to enhance the network's feature extraction and spatial positioning capabilities.

Benefits of technology

It improves the accuracy and speed of target detection, improves network feature extraction and spatial positioning capabilities, and solves the problems of insufficient detection accuracy and real-time performance in the existing technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113221896B_ABST
    Figure CN113221896B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses a target detection method, apparatus, neuromorphic device and medium. The method comprises: acquiring a target image; adjusting the image size and the number of channels of the target image to obtain a data rearrangement image; extracting a feature map of the data rearrangement image, and performing target detection based on the feature map. The above technical solution can increase the network feature extraction capability and spatial positioning capability during target detection, thereby improving the speed and accuracy of target detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of image processing technology, and in particular, to a target detection method, apparatus, neuromorphic device equipment and medium. Background Art

[0002] With the continuous development of science and technology, people's demand for image processing is increasing, and its application is becoming more extensive. Among them, target detection is an important part of image processing. How to improve the accuracy of target detection has become an urgent problem to be solved. Summary of the invention

[0003] Embodiments of the present invention provide a target detection method, apparatus, neuromorphic device equipment and medium, which can improve the accuracy of target detection.

[0004] In a first aspect, an embodiment of the present invention provides a target detection method, including:

[0005] Get the target image;

[0006] Adjusting the image size and the number of channels of the target image to obtain a data rearrangement image;

[0007] A feature map is extracted from the data rearrangement image, and target detection is performed based on the feature map.

[0008] In a second aspect, an embodiment of the present invention further provides a target detection device, including:

[0009] An image acquisition module, used for acquiring a target image;

[0010] An image rearrangement module, used for adjusting the image size and the number of channels of the target image to obtain a data rearranged image;

[0011] The target detection module is used to extract a feature map from the data rearrangement image and perform target detection based on the feature map.

[0012] In a third aspect, an embodiment of the present invention further provides a neuromorphic device, including a many-core system, wherein the many-core system includes an image rearrangement core, a feature extraction core, and a target detection output core; wherein,

[0013] The image rearrangement core is used to adjust the image size and the number of channels of the target image to obtain a data rearranged image;

[0014] The feature extraction core is used to extract feature maps from the data rearrangement image;

[0015] The target detection output core is used to perform target detection based on the feature map.

[0016] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the target detection method described in any embodiment of the present invention.

[0017] The technical solution of the embodiment of the present invention, when performing target detection on a target image, adjusts its image size and the number of channels to obtain a corresponding data rearrangement image, and then extracts a feature map of the data rearrangement image to perform target detection based on the extracted feature map, thereby increasing the network feature extraction capability and spatial positioning capability during target detection, thereby improving the accuracy of target detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 is a flow chart of a target detection method in Embodiment 1 of the present invention;

[0019] Figure 2 is an example diagram of data rearrangement of a target image in the first embodiment of the present invention;

[0020] Figure 3 This is an example diagram of extracting feature maps of data rearrangement images using different feature extraction methods in the first embodiment of the present invention;

[0021] Figure 4 is an example diagram of the overall network structure of the target detection network in the first embodiment of the present invention;

[0022] Figure 5 is a schematic diagram of the structure of a neuromorphic device in Embodiment 2 of the present invention;

[0023] Figure 6 is a flow chart of a target detection method in Embodiment 3 of the present invention;

[0024] Figure 7 This is an example diagram of the process of performing target detection on a high-resolution large-size image in Embodiment 3 of the present invention;

[0025] Figure 8 is a flowchart of a target detection method in Embodiment 3 of the present invention;

[0026] Fig. 9 is a schematic diagram of the structure of a target detection device in Embodiment 4 of the present invention;

[0027] Fig.10 It is a schematic diagram of the hardware structure of an electronic device in Embodiment 5 of the present invention. DETAILED DESCRIPTION

[0028] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0029] It should be mentioned before discussing the exemplary embodiments in more detail that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe the operations (or steps) as sequential processes, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but can also have additional steps not included in the accompanying drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.

[0030] In related technologies, target detection algorithms are usually divided into two-stage algorithms and single-stage algorithms. The two-stage algorithm has higher detection accuracy but poor real-time performance, while the single-stage algorithm has slightly insufficient detection accuracy but better real-time performance. However, the network feature extraction capabilities and spatial positioning capabilities of both types of target detection algorithms need to be strengthened.

[0031] The target detection method provided by the embodiment of the present disclosure can ensure the network feature extraction capability and spatial positioning capability, and improve the accuracy of target detection.

[0032] Embodiment 1

[0033] Figure 1 A flow chart of a target detection method provided in Embodiment 1 of the present invention. This embodiment can be applied to improving the network feature extraction capability and spatial positioning of the target detection algorithm. The method can be executed by the target detection device provided in the embodiment of the present invention. The device can be implemented in software and / or hardware and can generally be integrated into an electronic device. The method can also be executed by a neuromorphic device including a many-core system.

[0034] like Figure 1 As shown, the target detection method provided in this embodiment specifically includes:

[0035] S110: Acquire a target image.

[0036] The target image refers to an image that needs to be detected, which may be an original image or any sub-image obtained by segmenting the original image, for example, any sub-image obtained by segmenting a high-resolution large-size image.

[0037] S120, adjusting the image size and the number of channels of the target image to obtain a data rearrangement image.

[0038] Image size refers to the size of the image in terms of width and height, for example, it can include width information and height information, where the image size can be expressed in pixels. The number of channels refers to the size of the image in terms of depth. Taking the target image as a 512*512 (pixel) three-channel image (such as a BGR three-channel image) as an example, the image size of the target image is 512*512 (pixel) and the number of channels of the target image is 3.

[0039] By adjusting the image size and the number of channels of the target image, the pixel data included in the target image can be rearranged in the width and height direction and the depth direction (channel direction) to obtain a data rearranged image. The pixel data may include channel information, for example, a 1*1*3 data block.

[0040] Optionally, when adjusting the image size and the number of channels of the target image, the image size and the number of channels of the target image may be adjusted according to a requirement for rearrangement of image pixels to change the spatial distribution of image pixels of the target image.

[0041] Wherein, before and after the pixel data of the target image are rearranged, the product of the image size of the target image and the number of channels is equal. For example, taking the target image as a 3-channel image of 512*512 (pixels), the image size of the target image can be reduced from 512*512 to 256*256, and the number of channels of the target image can be expanded from 3 channels to 12 channels.

[0042] As an optional implementation, adjusting the image size and the number of channels of the target image to obtain a data rearrangement image can be understood as: reducing the image size of the target image and increasing the number of channels of the target image to obtain a data rearrangement image.

[0043] By reducing the image size of the target image and increasing the number of channels of the target image, the pixel data of the target image can be rearranged, which can not only retain the spatial structure information of the original image but also improve the fine-grained feature representation capability, thereby enhancing the image's feature extraction capability and spatial positioning capability.

[0044] Optionally, a DFR (Depth Feature Rearrangement Module) module that converts the width and height information of the target image into depth information is used to implement data rearrangement operations on the target image, reduce the image size of the target image, and increase the number of channels of the target image to enhance feature extraction capabilities and spatial positioning capabilities.

[0045] For example, for pixel information on any channel of the target image, the pixel information on the channel can be divided into multiple channels to generate multiple recombined channels corresponding to the channel, thereby reducing the image size of the target image and increasing the number of channels of the target image. The pixel information can be understood as pixel points, for example, 1*1 pixel points.

[0046] The ratio of the reduction in the image size of the target image or the ratio of the increase in the number of channels of the target image can be determined according to actual needs, and this embodiment does not make any specific limitation on this.

[0047] Further, as an optional implementation, adjusting the image size and the number of channels of the target image to obtain the data rearrangement image may include:

[0048] Divide the pixel data of the target image to determine Z target sub-images, wherein the target sub-images have the same number of channels as the target image, and the ratio of the product of the width information and the height information of the target image to the product of the width information and the height information of the target sub-image is Z, where Z is an integer greater than 1;

[0049] The Z target sub-images are combined in the channel direction to obtain a data rearrangement image.

[0050] The pixel data of the target image may be divided by dividing the target image by region and determining the pixel data of each region as a target sub-image, or by determining multiple pixel data that meet the preset data screening method as the pixel data of a target sub-image, and determining Z target sub-images respectively. The pixel data of different target sub-images are different. The present disclosure does not limit the way of dividing the pixel data.

[0051] Among them, the preset data screening method may refer to a method of screening pixel data in the target image according to preset rules while keeping the number of channels of the target image unchanged. For example, the preset data screening method may be to extract pixel data according to equal interval sizes, or to extract pixel data according to unequal interval sizes. Among them, when multiple extraction directions are included (for example, width information direction and height information direction), the equal interval sizes in different extraction directions may be different, for example, pixel data is extracted at an interval of 1 pixel along the width information direction (row direction), and pixel data is extracted at an interval of 0 pixels along the height information direction (column direction). The equal interval sizes in different extraction directions may also be the same. For example, pixel data is extracted at an interval of 1 pixel to generate a target sub-image, and the present disclosure does not limit the data screening method.

[0052] According to a preset data screening method, the target image is cut to obtain a plurality of target sub-images. The pixel data in the target sub-image is combined while maintaining the original spatial position characteristics. The number of channels of the target sub-image is equal to the number of channels of the target image, and the image size of the target sub-image is smaller than the image size of the target image. For example, the ratio of the product of the width information and the height information of the target image to the product of the width information and the height information of the target sub-image is Z.

[0053] Among them, in the target sub-image generated according to a preset data filtering method, two adjacent pixel data may not be adjacent in the target image. For example, the data filtering method may include extracting pixel data of the target image according to a preset interval size, and two adjacent pixel data in the target sub-image are two pixel data with the preset interval size in the target image.

[0054] When determining the target sub-image, the first pixel data extracted is the pixel data not included in the determined target sub-image, so that the pixel data of different target sub-images are different. Extracting pixel data according to a preset interval size can be extracting pixel data according to a preset interval size along the width information direction and along the length information direction.

[0055] For example, when the image size of the target image is 4*4, the number of channels is 3, and the preset interval size is 1 pixel interval in the same row and 1 pixel interval in the same column, the 1st and 3rd pixel data of the first row of the target image and the 1st and 3rd pixel data of the third row are multiple pixel data for generating the first target sub-image. The 2nd and 4th pixel data of the first row of the target image and the 2nd and 4th pixel data of the third row are multiple pixel data for generating the second target sub-image. The 1st and 3rd pixel data of the second row of the target image and the 1st and 3rd pixel data of the fourth row are multiple pixel data for generating the third target sub-image. The 2nd and 4th pixel data of the second row of the target image and the 2nd and 4th pixel data of the fourth row are multiple pixel data for generating the fourth target sub-image.

[0056] Wherein, two adjacent pixel data in each target sub-image are two pixel data with a preset interval size in the target image. The pixel data of different target sub-images are different, and the number of target sub-images can be determined according to the preset interval size. The present disclosure does not limit the way to divide the pixel data of the target image.

[0057] As mentioned above, the pixel data includes channel information, and the target sub-image obtained by division has the same number of channels as the target image. The pixel data of the target image is divided, and the image size of the generated target sub-image is smaller than the image size of the target image, and the ratio of the product of the width information and height information of the target image to the product of the width information and height information of the target sub-image is Z, where Z is an integer greater than 1. For example, when the target image is divided into 4 target sub-images, the ratio of the product of the width information and height information of the target image to the product of the width information and height information of the target sub-image is 4.

[0058] The Z target sub-images are combined in the channel direction to obtain a data rearrangement image, which can be understood as: sequentially superimposing the target sub-images in the channel direction. The superimposition order of the Z target sub-images in the channel direction can be determined according to the order of the first pixel data in the target sub-image in the target image.

[0059] The obtained multiple target sub-images are superimposed in a channel combination manner to obtain a data rearrangement image, wherein the image size of the data rearrangement image is equal to the image size of the target sub-image, and the number of channels of the data rearrangement image is the sum of the number of channels of the multiple target sub-images. When the multiple target sub-images are superimposed in a channel combination manner, the channel arrangement of each target sub-image is consistent with the target image.

[0060] The image size of the data rearranged image is the same as the image size of the target sub-image, and the ratio of the number of channels of the data rearranged image to the number of channels of the target image is Z.

[0061] For example, the first pixel data of the first row of the data rearrangement image is determined based on the first pixel data of the first row of the first target sub-image, the first pixel data of the first row of the second target sub-image, the first pixel data of the first row of the third target sub-image, and the first pixel data of the first row of the fourth target sub-image.

[0062] Reference Figure 2 In the example shown, when data is rearranged for a 4*4 (pixel) 3-channel target image, a target sub-image can be generated by extracting one pixel data at every other pixel to obtain multiple target sub-images, and they are superimposed in a channel combination manner to obtain a 2*2 (pixel) 12-channel data rearranged image.

[0063] In this way, when filtering pixel data in the target image to generate a target sub-image, pixel data can be extracted from the target image according to a preset interval size (such as one or more pixels) to generate a target sub-image. The pixel data filtered out in the target image according to the preset data filtering method is sequentially combined to obtain a corresponding target sub-image.

[0064] In some optional embodiments, the DFR module can be used to rearrange the data of the target detection image. Generally, the image data is first screened in the width and height directions and then superimposed in the depth direction to achieve pixel depth rearrangement of the multi-channel image. Figure 2 In the example shown, the target image’s width and height data are reduced by half, and its depth data is increased fourfold, which not only preserves the spatial structure information of the original image but also improves the fine-grained feature representation.

[0065] S130, extracting a feature map from the data rearrangement image, and performing target detection based on the feature map.

[0066] After obtaining the data rearrangement image, a feature map is extracted from the data rearrangement image, and then target detection can be performed based on the extracted feature map.

[0067] As an optional implementation, extracting a feature map from the data rearrangement image and performing target detection based on the feature map may be:

[0068] Different feature extraction methods are used in parallel to extract feature maps of the data rearrangement image respectively; the extracted feature maps are fused to obtain a target feature map corresponding to the target image, and target detection is performed based on the target feature map.

[0069] Optionally, different feature extraction methods have different image receptive fields.

[0070] Different feature extraction methods are used in parallel to extract feature maps of the target image respectively, and multiple feature maps are obtained. Since the image receptive fields of different feature extraction methods are different, the multiple feature maps obtained are of different sizes. The feature maps of different sizes are fused to obtain the target feature map corresponding to the target image.

[0071] Optionally, the feature extraction method may include only the convolution feature extraction method, may include only the pooling feature extraction method, or may include both the convolution feature extraction method and the pooling feature extraction method.

[0072] When the convolution kernel size of the convolution feature extraction method is different (such as 3*3, 5*5, 7*7, 9*9 respectively), the image receptive field is different; when the pooling kernel size of the pooling feature extraction method is different (such as 3*3, 5*5, 7*7, 9*9 respectively, the image receptive field is different. When both the convolution feature extraction method and the pooling feature extraction method are used, different kernel sizes can be used for different feature extraction methods.

[0073] like Figure 3As shown in the figure, taking the target image with an input of 512*512*3 (indicating that the image size is 512*512 and the number of channels is 3) as an example, after the data rearrangement processing of the DFR module (network layer), a 256*256*12 data rearrangement image is obtained, and then different feature extraction methods are used to extract feature maps of the data rearrangement image respectively. Taking the use of different convolution feature extraction methods in parallel to extract feature maps of the data rearrangement image as an example, such as group convolution of four different convolution kernels 3*3, 5*5, 7*7, and 9*9, the receptive field is expanded to extract feature information of different scales. Then, the feature map of 48 channels is obtained by splicing in the depth direction through the routing layer to realize the fusion of multi-scale feature information. Among them, the group convolution of convolution kernels of different scales not only reduces the amount of calculation but also can fuse feature information of different scales, thereby enhancing the spatial feature extraction capability of the network.

[0074] For example, taking the target detection algorithm as a single-stage algorithm, when performing target detection on a target image, the overall network structure of the target detection network can be as follows: Figure 4 As shown in the figure (the downward arrow in the figure indicates upsampling, and the upward arrow indicates downsampling), the input target image undergoes data rearrangement, feature map extraction, and feature map fusion processing to achieve downsampling while extracting more feature information between different channels in adjacent areas, and then multi-level downsampling and upsampling are performed to perform multi-scale feature fusion to achieve target detection.

[0075] The technical solution of the embodiment of the present invention, when performing target detection on a target image, first adjusts its image size and the number of channels to obtain a corresponding data rearrangement image, and then extracts a feature map of the data rearrangement image to perform target detection based on the extracted feature map, thereby increasing the network feature extraction capability and spatial positioning capability during target detection, thereby improving the speed and accuracy of target detection.

[0076] In the above technical solution, the operation of data rearrangement for the target image can appear as an operation of the network layer (that is, it can be processed by the core in the many-core system), or as a preprocessing operation before the network layer (that is, it can be processed by the CPU (Central Processing Unit)). When it appears as an operation of the network layer, a feature fusion layer is subsequently added for fusion and parallel calculation is performed through the GPU, that is, the pixel data of the target image is rearranged and the feature map is extracted through the core in the many-core system, and the processing speed is faster. When it is a preprocessing operation before the network layer, the pixel data is rearranged by the CPU and then sent to the core for feature extraction. The processing speed will be relatively slow, but it can also enhance the expression ability of the image.

[0077] Embodiment 2

[0078] Figure 5 FIG. 1 is a schematic diagram of a neuromorphic device provided in Embodiment 2 of the present invention. The neuromorphic device provided in this embodiment is suitable for processing target detection. Figure 5 As shown, the neuromorphic device 2 provided by the embodiment of the present invention includes: a multi-core system 20, wherein the multi-core system 20 includes an image rearrangement core 21, a feature extraction core 22 and a target detection output core 23.

[0079] An image rearrangement core 21, used for adjusting the image size and the number of channels of the target image to obtain a data rearrangement image;

[0080] A feature extraction core 22, for extracting a feature map from the data rearrangement image;

[0081] The target detection output core 23 is used to perform target detection based on the feature map.

[0082] Many-core chips have many computing units, and the smallest unit with complete computing power that can be independently scheduled is called a core. The core has its own storage and computing resources. A single chip can have multiple cores, and the joint work of multiple chips can be regarded as having more cores. Among them, the cores of the many-core system can run program instructions independently, and the use of parallel computing capabilities can speed up the running speed of the program and provide multi-tasking capabilities. It should be pointed out that Figure 5 The devices other than the many-core system 20 in the neuromorphic device 2 are not shown, and the functions implemented by the other cores included in the many-core system 20 independently running program instructions are not specifically limited in this embodiment.

[0083] In this embodiment, multiple cores are selected from the cores included in the many-core system 20 to independently run program instructions to implement the corresponding functions of running the program, specifically including an image rearrangement core 21 for performing image rearrangement operations, a feature extraction core 22 for performing feature map extraction, and a target detection output core 23 for performing target detection.

[0084] The image rearrangement core 21 is used to adjust the image size and the number of channels of the target image to obtain a data rearrangement image. The image size and the number of channels of the target image are adjusted so that the pixel data included in the target image are rearranged in the width and height directions and the depth direction to obtain a data rearrangement image. Before and after the pixel data of the target image are rearranged, the product of the image size and the number of channels of the target image is equal.

[0085] Optionally, an image rearrangement core 21 is used to divide the pixel data of the target image to determine Z target sub-images, wherein the target sub-images have the same number of channels as the target image, and the ratio of the image size of the target image to the image size of the target sub-image is Z, where Z is an integer greater than 1;

[0086] The Z target sub-images are combined in the channel direction to obtain a data rearrangement image,

[0087] The feature extraction core 22 is used to extract feature maps from the data rearrangement image. The target detection output core 23 is used to perform target detection based on the feature maps and determine the target detection frame.

[0088] Among them, the image rearrangement core 21 rearranges the pixel data of the target image by reducing the image size of the target image and increasing the number of channels of the target image, which can not only retain the spatial structure information of the original image but also improve the fine-grained feature representation capability, thereby enhancing the image's feature extraction capability and spatial positioning capability.

[0089] Furthermore, the image rearrangement core 21 is used to determine the multiple pixel data in the target image that meet the data screening method as the pixel data of a target sub-image, and generate the Z target sub-images respectively.

[0090] Among them, the pixel data of different target sub-images are different.

[0091] According to the preset data screening method, the target image is cut to obtain multiple target sub-images. The pixel data in the target sub-image is combined while maintaining the original spatial position characteristics. The number of channels of the target sub-image is equal to the number of channels of the target image, and the image size of the target sub-image is smaller than the image size of the target image. The multiple target sub-images obtained are superimposed in a channel combination manner to obtain a data rearrangement image, wherein the image size of the data rearrangement image is equal to the image size of the target sub-image, and the number of channels of the data rearrangement image is the sum of the number of channels of the multiple target sub-images.

[0092] Furthermore, the data screening method includes extracting pixel data of the target image according to a preset interval size, and two adjacent pixel data in the target sub-image are two pixel data with the preset interval size in the target image.

[0093] When filtering pixel data in the target image to generate a target sub-image, pixel data can be extracted from the target image according to a preset interval size (such as one or more pixels) to generate the target sub-image. The pixel data filtered out in the target image according to the preset data filtering method is sequentially combined to obtain a corresponding target sub-image.

[0094] As an optional implementation, the number of feature extraction cores 22 in the many-core system 20 is multiple; wherein the multiple feature extraction cores 22 are used to extract feature maps of the data rearrangement image in parallel using different feature extraction methods. Accordingly, the many-core system 20 also includes: a feature fusion core 24; the feature fusion core 24 is used to fuse the extracted feature maps to obtain a target feature map corresponding to the target image; and a target detection output core 23 is specifically used to perform target detection according to the target feature map.

[0095] Among them, the image receptive fields of different feature extraction methods are different;

[0096] Multiple feature extraction cores 22 use different feature extraction methods in parallel to extract feature maps of the target image respectively, and obtain multiple feature maps. Since the image receptive fields of different feature extraction methods are different, the multiple feature maps obtained are of different sizes. The feature fusion core 24 fuses the feature maps of different sizes to obtain a target feature map corresponding to the target image. Furthermore, the target detection output core 23 performs target detection based on the target feature map to determine the target detection frame in the target image.

[0097] Optionally, the feature extraction method may include only the convolution feature extraction method, may include only the pooling feature extraction method, or may include both the convolution feature extraction method and the pooling feature extraction method.

[0098] When the convolution kernel size of the convolution feature extraction method is different (such as 3*3, 5*5, 7*7, 9*9 respectively), the image receptive field is different; when the pooling kernel size of the pooling feature extraction method is different (such as 3*3, 5*5, 7*7, 9*9 respectively, the image receptive field is different. When both the convolution feature extraction method and the pooling feature extraction method are used, different kernel sizes can be used for different feature extraction methods.

[0099] As an optional implementation, the many-core system 20 includes multiple core groups, each core group includes: an image rearrangement core, a feature extraction core and a target detection output core; multiple core groups are used to perform target detection on multiple different target images in parallel.

[0100] When performing target detection on multiple target images, multiple core groups in the many-core system 20 may be used to perform target detection on the multiple target images in parallel, with each core group performing a target detection operation on one target image.

[0101] Furthermore, each core group includes: an image rearrangement core, a target detection output core, a feature fusion core, and multiple feature extraction cores. Among them, when each core group performs target detection on a target image, the image rearrangement core adjusts the image size and the number of channels of the target image to obtain a data rearrangement image; multiple feature extraction cores use different feature extraction methods in parallel to extract feature maps from the data rearrangement image; the feature fusion core fuses the extracted feature maps to obtain a target feature map corresponding to the target image; the target detection output core performs target detection based on the target feature map to determine the target detection frame of the target image.

[0102] For details not explained in this embodiment, please refer to the aforementioned embodiments and will not be repeated here.

[0103] In the above technical solution, the cores in the multi-core system rearrange the pixel data of the target image and extract the feature map, which is faster. By using multiple feature extraction cores in parallel to extract feature maps of the data rearranged image using different feature extraction methods, it can not only fully extract the spatial feature information between multiple channels, but also expand the receptive field and strengthen the multi-scale feature fusion, further enhance the network feature extraction ability and spatial positioning ability, and improve the speed and accuracy of target detection.

[0104] Embodiment 3

[0105] Figure 6 This is a flow chart of a target detection method provided in Embodiment 3 of the present invention. This embodiment provides a specific implementation method based on the previous embodiment, which is applicable to the case of detecting small targets in high-resolution large-size images. In this implementation method, the target image can be specifically a sub-image obtained by segmenting the image to be detected.

[0106] like Figure 6 As shown, the target detection method provided in this embodiment includes:

[0107] S310: Acquire an image to be detected, and determine at least one sub-image to be detected corresponding to the image to be detected, and use the at least one sub-image to be detected as a target image.

[0108] The present embodiment does not specifically limit the image size and resolution of the image to be detected. Optionally, the image to be detected is a high-resolution large-size image that needs to be used for small target detection, and its image size is greater than 4460×9561 pixels, or greater than 16000×16000 pixels.

[0109] The sub-image to be detected refers to an image that needs to be detected as a small target after adaptive segmentation of the image to be detected. The number of sub-images to be detected corresponding to the image to be detected may be one or more. The image content included in at least one sub-image to be detected corresponding to the image to be detected is consistent with the image content included in the image to be detected. The number of sub-images to be detected corresponding to the image to be detected can be determined based on the size of the image to be detected and the size of the standard input template image of the target detection network. Among them, the standard input template image of the target detection network refers to a template image that meets the network input size of the target detection network, and the target detection network can be any detection network for small target detection.

[0110] As an optional implementation manner, determining at least one sub-image to be detected corresponding to the image to be detected may be:

[0111] Calculate the size ratio coefficient of the image to be detected and the standard input template image of the target detection network; when the size ratio coefficient meets the segmentation condition, segment the image to be detected and determine at least two sub-images to be detected corresponding to the image to be detected; when the size ratio coefficient does not meet the segmentation condition, process the image to be detected and determine a sub-image to be detected corresponding to the image to be detected; wherein the size of the sub-image to be detected is the same as the size of the standard input template image of the target detection network.

[0112] The size ratio coefficient is calculated according to the size of the image to be detected and the size of the standard input template image of the target detection network. For example, if the size of the image to be detected is A1×A2 (pixels) and the size of the standard input template image of the target detection network is B1×B2 (pixels), the ratio of A1×A2 (pixels) to B1×B2 (pixels) can be used as the size ratio coefficient. The obtained size ratio coefficient is analyzed to determine whether the size ratio coefficient meets the segmentation condition, and the image to be detected is adaptively segmented according to the judgment result to obtain at least one sub-image to be detected corresponding to the image to be detected.

[0113] For example, the segmentation condition may be that the size ratio coefficient is not less than or greater than a preset ratio coefficient threshold. Taking the segmentation condition that the size ratio coefficient is not less than 2 as an example, when the size ratio coefficient meets the segmentation condition, that is, when the obtained size ratio coefficient is greater than or equal to 2, the image to be detected is segmented according to the size of the target detection network standard input template image, and multiple sub-images to be detected with the same size as the target detection network standard input template image are obtained; when the obtained size ratio coefficient does not meet the segmentation condition, that is, when the obtained size ratio coefficient is less than 2, the image to be detected is reduced according to the size of the target detection network standard input template image, and a sub-image to be detected with the same size as the target detection network standard input template image is obtained.

[0114] Further, as an optional implementation, the size ratio coefficient of the image to be detected and the standard input template image of the target detection network is calculated as follows:

[0115] Calculate the image width ratio coefficient and image height ratio coefficient of the image to be detected and the standard input template image of the target detection network, and round up the image width ratio coefficient and the image height ratio coefficient to integers to obtain the image width correction ratio coefficient and the image height correction ratio coefficient respectively; use the larger one of the image width correction ratio coefficient and the image height correction ratio coefficient as the size ratio coefficient; accordingly, the size ratio coefficient satisfies the segmentation condition, which can be specifically as follows: if the size ratio coefficient is greater than a preset ratio coefficient threshold, then it is determined that the size ratio coefficient satisfies the segmentation condition; the size ratio coefficient does not meet the segmentation condition, which can be specifically as follows: if the size ratio coefficient is less than or equal to the preset ratio coefficient threshold, then it is determined that the size ratio coefficient does not meet the segmentation condition.

[0116] Assume that the image size of the image to be detected is img_w×img_h (pixels), and the image size of the standard input template image of the target detection network is net_w×net_h (pixels), where img_w is the image width of the image to be detected, img_h is the image height of the image to be detected, net_w is the image width of the standard input template image of the target detection network, and net_h is the image height of the standard input template image of the target detection network.

[0117] The image width ratio coefficient refers to the ratio of the image width of the image to be detected to the image width of the standard input template image of the target detection network, that is, the image width ratio coefficient w = img_w / net_w; the image height ratio coefficient refers to the ratio of the image height of the image to be detected to the image height of the standard input template image of the target detection network, that is, the image height ratio coefficient h = img_h / net_h.

[0118] The image width ratio coefficient w and the image height ratio coefficient h are rounded up to obtain the image width correction ratio coefficient w' and the image height correction ratio coefficient h', respectively, and the larger ratio coefficient a' (w' or h') of the image width correction ratio coefficient w' and the image height correction ratio coefficient h' is used as the size ratio coefficient. Furthermore, the size ratio coefficient a' can be used as a judgment condition for whether subsequent image segmentation is required.

[0119] Whether it is necessary to segment the image to be detected is determined according to the size ratio coefficient a'. Taking the preset ratio coefficient threshold of 2 as an example, when the size ratio coefficient a' is greater than 2, the image to be detected needs to be segmented, that is, when the ratio of a corresponding edge of the image to be detected and the standard input template image of the target detection network is greater than 2, the image to be detected needs to be segmented to determine multiple sub-images to be detected corresponding to the image to be detected; when the size ratio coefficient a' is less than or equal to 2, the image to be detected does not need to be segmented, and a sub-image to be detected corresponding to the image to be detected is determined after the image to be detected is processed.

[0120] Further, as an optional implementation, when the size ratio coefficient meets the segmentation condition, the image to be detected is segmented to determine at least two sub-images to be detected corresponding to the image to be detected, which can be:

[0121] According to the image width correction ratio coefficient and the image height correction ratio coefficient, the image unit size of the image to be detected is determined, and each segmentation center alignment point in the image to be detected is determined according to the image unit size; with each segmentation center alignment point as the center, the image to be detected is segmented according to the size of the target detection network standard input template image to obtain at least two sub-images to be confirmed; the at least two sub-images to be confirmed are respectively aligned with the center of the target detection network standard input template image to generate at least two sub-images to be detected corresponding to the image to be detected.

[0122] The width of the image unit size refers to the quotient of the image width of the image to be detected and the image width correction ratio coefficient, and the height of the image unit size refers to the quotient of the image height of the image to be detected and the image height correction ratio coefficient. The segmentation center alignment point refers to the center point of each segmented image area obtained when the image to be detected is segmented according to the image unit size.

[0123] Taking each segmentation center alignment point as the center, the image to be detected is segmented according to the size of the standard input template image of the target detection network to obtain multiple sub-images to be confirmed. Among them, there may be overlapping areas between two sub-images to be confirmed that are adjacent to each other up and down or left and right. Since each segmentation center alignment point is determined according to the image unit size, the sub-image to be confirmed obtained by segmentation with each segmentation center alignment point as the center is segmented according to the size of the standard input template image of the target detection network, and the size of the standard input template image of the target detection network is greater than or equal to the image unit size, so the size of the sub-image to be confirmed is less than or equal to the size of the standard input template image of the target detection network. Among them, when the sub-image to be confirmed is located in the first row, last row, first column or last column of the segmented image to be detected, the size of the sub-image to be confirmed may be smaller than the size of the standard input template image of the target detection network. At this time, the segmentation center alignment point is not the center of the sub-image to be confirmed.

[0124] For each sub-image to be confirmed, it is aligned with the target detection network standard input template image to generate the corresponding sub-image to be detected. Specifically, for each sub-image to be confirmed, it can be aligned with the target detection network standard input template image, and the position coordinates of the sub-image to be confirmed relative to the target detection network standard input template image are calculated according to the size of the sub-image to be confirmed and the target detection network standard input template image, wherein the position coordinates include the upper left alignment point and the lower right alignment point, or include the lower left alignment point and the upper right alignment point, and the sub-image to be confirmed is filled into the target detection network standard input template image in the area between the upper left alignment point and the lower right alignment point, or in the area between the lower left alignment point and the upper right alignment point. If there are blank areas around the target detection network standard input template image (either the upper, lower, left, or right side) after the sub-image to be confirmed is filled into the target detection network standard input template image, it is necessary to fill pixels in the corresponding blank areas, such as filling pixels with a pixel value of "0" in the blank areas to generate a sub-image to be detected corresponding to the sub-image to be confirmed.

[0125] Further, as an optional implementation, taking each segmentation center alignment point as the center, the size of the template image is input according to the target detection network standard, and segmentation is performed in the image to be detected to obtain at least two sub-images to be confirmed, which can be specifically as follows:

[0126] Taking each segmentation center alignment point as the center and inputting the size of the template image according to the target detection network standard, the coordinate range of each sub-image to be confirmed in the image to be detected is calculated respectively; according to the coordinate range of each sub-image to be confirmed in the image to be detected, the image to be detected is segmented to obtain at least two sub-images to be confirmed.

[0127] For each segmentation center alignment point, the segmentation center alignment point is taken as the center, and the size of the template image and the coordinates of the segmentation center alignment point are input according to the target detection network standard to calculate the coordinate range of the corresponding sub-image to be confirmed. If the calculated coordinate range exceeds the coordinate range in the image to be detected, for example, the calculated coordinate value is a negative value, or the calculated coordinate value is greater than the maximum coordinate value in the corresponding direction of the image to be detected, the calculated coordinate range is adjusted, and the exceeded coordinate range is limited to the corresponding boundary of the image to be detected, and the adjusted coordinate range is used as the coordinate range of the sub-image to be confirmed in the image to be detected, and then the image to be detected can be segmented according to the coordinate range of the sub-image to be confirmed in the image to be detected, and the corresponding sub-image to be confirmed is obtained.

[0128] Optionally, when the size ratio coefficient meets the segmentation condition, the image to be detected is adaptively segmented, and the adaptive segmentation is performed in the width direction first and then the height direction, or in the height direction first and then the width direction. Taking the adaptive segmentation in the width direction and then the height direction as an example, the adaptive segmentation can be achieved through two layers of loops, the inner loop is performed in the width direction of the image to be detected, and the outer loop is performed in the height direction of the image to be detected. The sub-image to be confirmed obtained after each inner loop segmentation is aligned with the standard input template image of the target detection network to generate the sub-image to be detected. Optionally, the generated multiple sub-images to be detected are stored in the sub-image list to be detected for batch processing of small target detection.

[0129] As a specific implementation, when the size ratio coefficient meets the segmentation condition, the process of adaptively segmenting the image to be detected to obtain multiple sub-images to be detected may include:

[0130] a. Set the segmentation counters. The width direction (i.e., x-coordinate direction) counter is represented by i, and the height direction (i.e., y-coordinate direction) counter is represented by j. The counters start from 0 and the maximum values ​​are w'-1 and h'-1 respectively. According to the image width and height correction ratio coefficient (w', h'), the width and height (c_w, c_h) of the image unit size for adaptive segmentation of the image to be detected are calculated, that is, the segmentation center alignment point of the subsequent segmentation is determined in turn by the width and height of the image unit size.

[0131] b. The outer loop controls the height direction. When the y-direction counter j is less than the height coefficient h', the inner loop continues. When j is greater than or equal to h', the outer loop ends and the sub-image to be confirmed is output.

[0132] c. The outer loop counter j controls the selection of different y-direction offset calculations. Different positions correspond to different up and down offsets for centering and alignment in the image height direction. When y is equal to 0, the image to be detected is segmented at the top row; when y is greater than 0 and less than h'-1, the image to be detected is segmented in the middle; when y is equal to h'-1, the image to be detected is segmented at the bottom row.

[0133] d. The inner loop controls the width direction. When the x-direction counter i is less than w', the current inner loop is performed. When i is greater than or equal to w', the current inner loop is exited. When the width counter i of the inner loop is set to 0, the height counter j of the outer loop is increased by 1, and the next round of outer loop control is performed.

[0134] e. The inner loop counter i controls the selection of different x-direction offset calculations. Different positions correspond to different left and right offsets for centering and alignment in the width direction of the image. When x is equal to 0, the image to be detected is segmented in the leftmost column; when x is greater than 0 and less than w'-1, the image to be detected is segmented in the middle part; when x is equal to w'-1, the image to be detected is segmented in the rightmost column.

[0135] f. The offset in the y direction is controlled by the outer loop counter j, and the offset in the x direction is controlled by the inner loop counter i. The alignment coordinate points when the image to be detected is segmented are calculated, such as the upper left alignment coordinate point and the lower right alignment coordinate point (i.e., the upper left point and lower right point of the sub-image to be confirmed), or the lower left alignment coordinate point and the upper right alignment coordinate point (i.e., the lower left point and upper right point of the sub-image to be confirmed), and then the sub-image to be confirmed can be output according to the alignment coordinate points.

[0136] g. According to the alignment coordinate points of the sub-image to be confirmed and the alignment coordinate points of the standard input template image of the target detection network, the sub-image to be confirmed is filled into the standard input template image of the target detection network, and after filling the blank area around the standard input template image of the target detection network with pixels, a sub-image to be detected corresponding to the sub-image to be confirmed is generated.

[0137] Optionally, the sub-images to be detected that have completed segmentation and alignment transformation are stored in a list of sub-images to be detected as a batch, and are used as target images for subsequent small target detection.

[0138] Furthermore, as an optional implementation, when the size ratio coefficient does not meet the segmentation condition, the image to be detected is processed to determine a sub-image to be detected corresponding to the image to be detected. Specifically, the image to be detected is reduced according to the size ratio coefficient to obtain a reduced image to be detected; the reduced image to be detected is centered with the standard input template image of the target detection network to generate a sub-image to be detected corresponding to the image to be detected.

[0139] First, the image to be detected is reduced according to the size ratio coefficient a' to obtain a reduced image to be detected; then the reduced image to be detected is aligned with the target detection network standard input template image in the center to generate a sub-image to be detected corresponding to the image to be detected. Specifically, the position coordinates of the reduced image to be detected relative to the target detection network standard input template image are calculated according to the size of the reduced image to be detected and the target detection network standard input template image, wherein the position coordinates include the upper left alignment point and the lower right alignment point, or include the lower left alignment point and the upper right alignment point, and the reduced image to be detected is filled into the area between the upper left alignment point and the lower right alignment point in the target detection network standard input template image, or the area between the lower left alignment point and the upper right alignment point. If there are blank areas around the target detection network standard input template image (either the upper, lower, left, or right sides) after the reduced image to be detected is filled into the target detection network standard input template image, it is necessary to fill pixels in the corresponding blank areas, such as filling pixels with a pixel value of "0" in the blank areas to generate a sub-image to be detected corresponding to the reduced image to be detected, that is, a sub-image to be detected corresponding to the image to be detected.

[0140] S320, for each target image, adjusting the image size and the number of channels of the target image to obtain a data rearrangement image, performing feature map extraction on the data rearrangement image, and performing target detection according to the feature map.

[0141] When there are multiple target images, in order to improve the efficiency of target detection, parallel processing can be performed in the form of batch processing to achieve target detection on multiple target images at the same time. Optionally, multiple core groups in the many-core system perform target detection on multiple target images in parallel to determine the target detection frame of each target image.

[0142] S330: Determine the target detection result of the image to be detected according to the target detection result of the target image.

[0143] When there are multiple target images, the target detection results of the multiple target images can be combined to obtain the target detection result corresponding to the image to be detected. For example, the target detection frames of the multiple target images can be restored to the image to be detected, and the target detection result of the image to be detected can be obtained by ranking the confidences of these target detection frames and removing duplicates.

[0144] The technical solution of the embodiment of the present invention, when performing target detection on the image to be detected, first obtains each sub-image to be detected corresponding to the image to be detected, and performs target detection as the target image respectively, and then obtains the target detection result of the image to be detected based on the target detection results of each target image. When the image to be detected is a high-resolution large-size image, the technical problem of performing target detection on the high-resolution large-size image can be solved, and target detection is performed on each sub-image to be detected (that is, the target image) corresponding to the image to be detected to determine the target detection result of the image to be detected, and the detection accuracy and detection speed when performing target detection on the high-resolution large-size image can also be improved.

[0145] In the above technical solution, when the image to be detected is a high-resolution large-size image, the image to be detected is adaptively segmented to generate multiple sub-images to be detected corresponding to the image to be detected, and target detection is performed on each sub-image to be detected separately through a target detection network that matches the size of the sub-image to be detected. Compared with using an ultra-large network input for detection, the detection accuracy is high, the detection speed is fast, and high-performance hardware support is not required.

[0146] Furthermore, in the case where multiple sub-images to be detected corresponding to the image to be detected can be determined, the target detection method provided in this embodiment further includes: determining a secondary detection sub-image based on each two adjacent sub-images to be detected, and using the secondary detection sub-image as the target image to perform target detection on the target image. Furthermore, the target detection result of the image to be detected can be determined based on the target detection results of the sub-image to be detected and the secondary detection sub-image.

[0147] No matter how the image to be detected is segmented, the problem that the target at the adjacent or overlapping part of two adjacent sub-images to be detected is segmented into two parts cannot be avoided. In order to solve the problem that the target at the adjacent or overlapping part of the sub-images to be detected is segmented into multiple parts, this embodiment performs a secondary detection on the basis of the target detection for each sub-image to be detected to improve the target detection performance.

[0148] For two adjacent sub-images to be detected, which may be two adjacent sub-images to be detected in the width direction of the image to be detected, or two adjacent sub-images to be detected in the height direction of the image to be detected, a secondary detection sub-image corresponding to the two images to be detected is determined. The secondary detection sub-image is determined based on the adjacent or overlapping areas of the two adjacent sub-images to be detected, and the overlapping area corresponding to the two adjacent sub-images to be detected does not exist repeatedly in the secondary detection sub-image. Optionally, the size of the secondary detection sub-image is the same as the size of the sub-image to be detected.

[0149] After determining the secondary detection sub-image for each two adjacent sub-images to be detected, the corresponding secondary detection sub-image is used as the target image to continue the target detection, and the target detection result corresponding to the secondary detection sub-image is obtained.

[0150] In this embodiment, target detection is performed not only on multiple sub-images to be detected obtained by adaptively segmenting the image to be detected, but also on each secondary detection sub-image determined by two adjacent sub-images to be detected. Furthermore, after obtaining the target detection results of each sub-image to be detected and the target detection results of each secondary detection sub-image, that is, after obtaining the target detection frames corresponding to each sub-image to be detected and the target detection frames corresponding to each secondary detection sub-image, the target detection results of the image to be detected can be determined by combining the target detection results of the sub-image to be detected and the secondary detection sub-image.

[0151] As an optional implementation, a secondary detection sub-image is determined based on every two adjacent sub-images to be detected. Specifically, if two adjacent sub-images to be detected meet the repeated detection condition, a secondary detection sub-image is determined based on the two adjacent sub-images to be detected.

[0152] In order to avoid unnecessary waste of computing resources, two adjacent sub-images to be detected can be screened, and a secondary detection sub-image is generated only when necessary, and small target detection is performed on the generated secondary detection sub-image.

[0153] The repeated detection condition refers to the condition that requires secondary detection, for example, the existence of a target detection frame at the adjacent or overlapping position of two adjacent sub-images to be detected. For each two adjacent sub-images to be detected, when the two adjacent sub-images to be detected meet the repeated detection condition, for example, the existence of a target detection frame at the adjacent or overlapping position of the two adjacent sub-images to be detected, the corresponding secondary detection sub-image is generated according to the two adjacent sub-images to be detected.

[0154] As an optional implementation, two adjacent sub-images to be detected satisfy the repeated detection condition, which can be specifically as follows: if there are two target detection frames in the two adjacent sub-images to be detected whose overlap is greater than a preset overlap threshold, it is determined that the two adjacent sub-images to be detected satisfy the repeated detection condition.

[0155] After performing target detection on each sub-image to be detected, a target detection frame corresponding to each sub-image to be detected can be obtained. For two adjacent sub-images to be detected, the target detection frames corresponding to the two sub-images to be detected are judged to overlap, and if there are two target detection frames whose overlap is greater than a preset overlap threshold (for example, 50% or 25%), it can be determined that the two adjacent sub-images to be detected meet the repeated detection condition.

[0156] As an optional implementation, determining a secondary detection sub-image based on two adjacent sub-images to be detected can be specifically as follows: determining a target area image corresponding to the two adjacent sub-images to be detected in the image to be detected; taking the center point of the target area image as the center, inputting the size of the template image according to the target detection network standard, and cutting out the secondary detection sub-image in the target area image.

[0157] When analyzing two adjacent sub-images to be detected, if the two adjacent sub-images to be detected meet the repeated detection condition, the target area image corresponding to the two adjacent sub-images to be detected can be determined in the image to be detected, that is, the joint area image of the two adjacent sub-images to be detected. After determining the target area image corresponding to the two adjacent sub-images to be detected, the secondary detection sub-image corresponding to the two adjacent sub-images to be detected can be cut out in the target area image with the center point of the target area image as the center and the size of the template image input according to the target detection network standard.

[0158] As an optional implementation, the target detection result of the image to be detected is determined based on the target detection results of the sub-image to be detected and the secondary detection sub-image. Specifically, the target detection box in the sub-image to be detected and the target detection box in the secondary detection sub-image are restored to the image to be detected; the target detection box in the image to be detected is screened to obtain the target detection result of the image to be detected.

[0159] The target detection frames in each sub-image to be detected and the target detection frames in each secondary detection sub-image are restored to the image to be detected, and the target detection frames restored to the image to be detected are screened to obtain the target detection result of the image to be detected. When the target detection frames restored to the image to be detected are screened, the category confidence of each target detection frame can be sorted, and each target detection frame can be deduplicated to obtain each target detection frame that matches the image to be detected as the final detection result of small target detection of the image to be detected.

[0160] Optionally, when screening the target detection frames restored to the image to be detected, NMS (Non-Maximum Suppression) processing can be performed on all target detection frames regressed to the image to be detected to avoid the problem of multiple target detection frames for the same target in the image to be detected.

[0161] When the target detection method provided in this embodiment is used to detect small targets in a high-resolution large-size image, the processing flow can be as follows: Figure 7As shown, the input high-resolution large-size image is adaptively segmented to obtain multiple sub-images to be detected corresponding to the high-resolution large-size image. After small target detection is performed on the multiple sub-images to be detected, the secondary detection sub-image is determined according to the adjacent or overlapping parts of two adjacent sub-images to be detected, and target detection is performed on each secondary detection sub-image. Finally, the target detection results of the sub-image to be detected and the secondary detection sub-image are regressed to the high-resolution large-size image, and all target detection frames regressed to the high-resolution large-size image are subjected to NMS de-duplication and merging processing to obtain the target detection result of the high-resolution large-size image.

[0162] The above technical scheme, after performing small target detection on multiple sub-images to be detected obtained by adaptively dividing the image to be detected, continues to analyze two adjacent sub-images to be detected to determine whether secondary detection is needed, and if necessary, generates a secondary detection sub-image based on the two adjacent sub-images to be detected, and continues to perform target detection on the generated secondary detection sub-image, thereby realizing secondary detection at adjacent parts of sub-images to be detected, solving the problem of affecting target detection results due to the fact that targets at adjacent or overlapping parts of adjacent sub-images to be detected are divided into multiple parts when adaptively dividing the sub-images to be detected, thereby improving the overall detection performance.

[0163] Figure 8 A specific implementation of the target detection method provided in this embodiment is shown. Figure 8 , the input high-resolution large-size image is adaptively segmented to obtain sub-images to be detected 0_0, sub-images to be detected 0_1, sub-images to be detected 0_2, sub-images to be detected 0_3, and sub-images to be detected Figure 1 _0、Sub-items to be tested Figure 1 _1. The subunit to be tested Figure 1 _2 and the molecules to be detected Figure 1 _3, and perform small target detection on these sub-images to be detected. Figure 8 The left and right adjacent particles to be detected are shown in the example Figure 1 _0 and the subunit to be detected Figure 1 The adaptive segmentation method of the sub-image to be detected can be found in the above embodiment and will not be described in detail here.

[0164] Assume that the detected particle Figure 1 _0 and the subunit to be detected Figure 1The small target detection results of _1 are divided into two groups, BBox_0 and BBox_1. Each group of BBox may contain multiple target detection frames. Suppose the representation format of the target detection frame is [center_x, center_y, b_w, b_h], where center_x represents the x-coordinate of the center point of the target detection frame, center_y represents the y-coordinate of the center point of the target detection frame, b_w represents the width of the target detection frame, and b_h represents the height of the target detection frame.

[0165] The following is a detailed explanation of the steps of generating a secondary detection image based on adjacent sub-images to be detected:

[0166] (1) Target detection frame coordinate conversion. The target detection frames of two adjacent sub-images to be detected are converted from the representation format [center_x, center_y, b_w, b_h] to [xmin, ymin, xmax, ymax], where xmin represents the minimum value of the target detection frame x coordinate, ymin represents the minimum value of the target detection frame y coordinate, xmax represents the maximum value of the target detection frame x coordinate, and ymax represents the maximum value of the target detection frame y coordinate.

[0167] (2) Sort the target detection frames according to the coordinates. Among them, the left sub-images of the two adjacent sub-images to be detected are sorted by the xmax column to find the rightmost target detection frame bbox_r (that is, one or more target detection frames closest to the adjacent sub-images to be detected), and the right sub-images of the two adjacent sub-images to be detected are sorted by the xmin column to find the leftmost target detection frame bbox_l (that is, one or more target detection frames closest to the adjacent sub-images to be detected).

[0168] If two adjacent sub-images to be detected are two sub-images to be detected that are adjacent to each other up and down, the upper sub-images of the two adjacent sub-images to be detected can be sorted by the ymin column to find the lowermost target detection box bbox_d (that is, one or more target detection boxes closest to the adjacent sub-image to be detected), and the lower sub-images of the two adjacent sub-images to be detected can be sorted by the ymax column to find the uppermost target detection box bbox_u (that is, one or more target detection boxes closest to the adjacent sub-image to be detected).

[0169] (3) Calculate the IOU (Intersection over Union) of the target detection boxes bbox_r and bbox_l. If the calculated IOU is greater than a preset overlap threshold (for example, 0.25), they can be considered to be two repeated target detection boxes of the same object. If it is less than the preset overlap threshold, they are considered to belong to two different objects and no secondary detection is required.

[0170] Perform IOU calculation on the target detection boxes bbox_u and bbox_d. If the calculated overlap IOU is greater than the preset overlap threshold, they can be considered as two repeated target detection boxes of the same object. If it is less than the preset overlap threshold, they are considered to belong to two different objects and no secondary detection is required.

[0171] (4) Generate a secondary detection sub-image based on two adjacent sub-images to be detected. If the IOU of the target detection boxes bbox_r and bbox_l is greater than the preset overlap threshold, or the IOU of the target detection boxes bbox_u and bbox_d is greater than the preset overlap threshold, then generate a secondary detection sub-image based on the two adjacent sub-images to be detected and use it as the target image for target detection. The secondary detection sub-image can be an image block obtained by dividing the image with the center point of the joint area of ​​the two adjacent sub-images to be detected as the center and the width and height (net_w, net_h) of the standard input template image of the target detection network as the boundary.

[0172] After obtaining the target detection results of each sub-image to be detected and each secondary detection sub-image, the target detection frames corresponding to each sub-image to be detected and each secondary detection sub-image are regressed to the high-resolution large-size image, and all target detection frames regressed to the high-resolution large-size image are subjected to NMS deduplication processing, so that the target detection results of the high-resolution large-size image can be obtained.

[0173] A high-resolution large-size image img (img_w, img_h) is divided into multiple sub-images to be confirmed img_c (c_w, c_h) (where c_w is the image width of the sub-image to be confirmed, and c_h is the image height of the sub-image to be confirmed). All sub-images to be confirmed are filled into the target detection network standard input template image IMG (net_w, net_h) in a way that the center coordinates are aligned to generate multiple sub-images to be detected. Multiple sub-images to be detected can be used as a batch for target detection to obtain the target detection box information corresponding to each sub-image to be detected, that is, [center_x, center_y, b_w, b_h, score, class_id], where score identifies the confidence of the target detection box, and class_id indicates the category of the target detection box. At this time, the information of the target detection box obtained is relative to the standard input template image IMG (net_w, net_h) of the target detection network. When regressing the target detection frame information to a high-resolution large-size image (original image), only two reference coordinate transformations are required for the center point coordinates (center_x, center_y), and there is no need to process the target detection frame width and height (b_w, b_h), confidence, and category included in the target detection frame information.

[0174] Specifically, the steps of regressing the target detection frames of the sub-image to be detected and the secondary detection sub-image to a high-resolution large-size image (original image) may include:

[0175] (1) Convert the reference coordinate origin of the target detection box information from IMG (0, 0) to the IMG center point (net_w / 2, net_h), that is, convert the target detection box information from [center_x, center_y, b_w, b_h, score, class_id] to [center_x-net_w / 2, center_y-net_h / 2, b_w, b_h, score, class_id].

[0176] (2) Calculate the relative relationship (relation_x, relation_y) between the center point of the sub-image img_c (c_w, c_h) to be confirmed and the origin of the original image coordinate img (0,0).

[0177] (3) The center-aligned target detection box information is added with the distance between the center point of the sub-image to be confirmed and the origin of the original image coordinate system, that is, the target detection box information is converted from [center_x-net_w / 2, center_y-net_h / 2, b_w, b_h, score, class_id] to [center_x-net_w / 2+relation_x, center_y-net_h / 2+relation_y, b_w, b_h, score, class_id].

[0178] (4) Perform NMS processing on all regressed target detection frames on the high-resolution large-size image (original image) to avoid multiple detection frames for the same object in the high-resolution large-size image.

[0179] The above technical solution proposes a method for adaptive segmentation of high-resolution large-size images, which divides the large image into sub-images, reduces the size of the input image of the target detection network, improves the target detection speed and accuracy, and reduces the pressure on hardware equipment. The above technical solution also proposes a method for efficient small target detection for high-resolution large-size images. Combining the adaptive segmentation method of high-resolution large-size images and the improved network structure, the multiple sub-images to be detected obtained by segmentation are detected as a batch, and secondary detection is performed for the case where the target detection frames in adjacent sub-images to be detected have a high degree of overlap, thereby achieving fast and accurate target detection.

[0180] Embodiment 4

[0181] Fig. 9This is a schematic diagram of the structure of a target detection device provided by the fourth embodiment of the present invention. This embodiment can be applied to improving the network feature extraction capability and spatial positioning of the target detection algorithm. The device can be implemented in software and / or hardware and can generally be integrated in an electronic device. Fig. 9 As shown, the device includes: an image acquisition module 410, an image rearrangement module 420 and a target detection module 430. Among them,

[0182] An image acquisition module 410 is used to acquire a target image;

[0183] An image rearrangement module 420 is used to adjust the image size and the number of channels of the target image to obtain a data rearranged image;

[0184] The target detection module 430 is used to extract a feature map from the data rearrangement image and perform target detection based on the feature map.

[0185] The technical solution of the embodiment of the present invention, when performing target detection on a target image, first adjusts its image size and the number of channels to obtain a corresponding data rearrangement image, and then extracts a feature map of the data rearrangement image to perform target detection based on the extracted feature map, thereby increasing the network feature extraction capability and spatial positioning capability during target detection, thereby improving the speed and accuracy of target detection.

[0186] Optionally, the image rearrangement module 420 is specifically used to reduce the image size of the target image, increase the number of channels of the target image, and obtain a data rearranged image.

[0187] Optionally, the image rearrangement module 420 is specifically configured to cut the target image into a plurality of target sub-images according to a preset data screening method; and superimpose the plurality of target sub-images in a channel combination manner to obtain a data rearrangement image.

[0188] Optionally, the image rearrangement module 420 is specifically configured to extract pixel data from the target image according to a preset interval size to generate a plurality of target sub-images.

[0189] Optionally, the target detection module 430 is specifically used to extract feature maps of the data rearrangement image using different feature extraction methods in parallel; fuse the extracted feature maps to obtain a target feature map corresponding to the target image, and perform target detection based on the target feature map.

[0190] Optionally, different feature extraction methods have different image receptive fields.

[0191] Optionally, the feature extraction method includes: a convolution feature extraction method and / or a pooling feature extraction method.

[0192] The above-mentioned target detection device can execute the target detection method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the executed target detection method.

[0193] Embodiment 5

[0194] Fig.10 This is a schematic diagram of the hardware structure of an electronic device provided in Embodiment 5 of the present invention. Fig.10 As shown, the electronic device includes:

[0195] one or more processors 510, Fig.10 A processor 510 is taken as an example;

[0196] Memory 520.

[0197] The processor 510 and the memory 520 in the electronic device can be connected via a bus or other means. Fig.10 The example of connecting through bus is taken in the following.

[0198] The memory 520, as a non-transitory computer-readable storage medium, can be used to store software programs and computer executable programs, such as program instructions corresponding to a target detection method in an embodiment of the present invention, including: acquiring a target image; adjusting the image size and the number of channels of the target image to obtain a data rearrangement image; extracting a feature map of the data rearrangement image, and performing target detection based on the feature map.

[0199] The processor 510 executes various functional applications and data processing of the chip by running the software program instructions stored in the memory 520, that is, implements a target detection method in any embodiment of the above method.

[0200] The memory 520 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and an application required by at least one function; the data storage area may store data created according to the use of the chip, etc. In addition, the memory 520 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage devices.

[0201] Embodiment 6

[0202] Embodiment 6 of the present invention further provides a storage medium including computer executable instructions, wherein the computer executable instructions are used to implement a target detection method when executed by a processor, the method comprising:

[0203] Acquire a target image; adjust the image size and the number of channels of the target image to obtain a data rearrangement image; extract a feature map of the data rearrangement image, and perform target detection based on the feature map.

[0204] Optionally, when executed by a processor, the computer executable instruction may also be used to implement a technical solution of a target detection method provided by any embodiment of the present invention.

[0205] Through the above description of the implementation methods, the technicians in the relevant field can clearly understand that the present invention can be implemented by means of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for the chip to execute the methods described in each embodiment of the present invention.

[0206] It is worth noting that in the embodiment of the above-mentioned target detection device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.

[0207] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A target detection method, characterized in that: include: Get the target image; Adjusting the image size and the number of channels of the target image to obtain a data rearrangement image; Extracting a feature map from the data rearrangement image, and performing target detection based on the feature map; Wherein, acquiring the target image comprises: Acquire an image to be detected, and determine at least one sub-image to be detected corresponding to the image to be detected, and use the at least one sub-image to be detected as a target image; The step of determining at least one sub-image to be detected corresponding to the image to be detected includes: Calculate the size ratio coefficient of the image to be detected and the standard input template image of the target detection network; When the size ratio coefficient meets the segmentation condition, segmenting the image to be detected to determine at least two sub-images to be detected corresponding to the image to be detected; When the size ratio coefficient does not meet the segmentation condition, processing the image to be detected to determine a sub-image to be detected corresponding to the image to be detected; Wherein, the size of the sub-image to be detected is the same as the size of the standard input template image of the target detection network; When the size ratio coefficient does not meet the segmentation condition, the image to be detected is processed to determine a sub-image to be detected corresponding to the image to be detected, including: When the size ratio coefficient does not meet the segmentation condition, the image to be detected is reduced to obtain a sub-image to be detected corresponding to the image to be detected; The size ratio coefficient satisfies the segmentation conditions, including: If the size ratio coefficient is greater than a preset ratio coefficient threshold, determining that the size ratio coefficient meets the segmentation condition; The size ratio coefficient does not meet the segmentation conditions, including: If the size ratio coefficient is less than or equal to the preset ratio coefficient threshold, it is determined that the size ratio coefficient does not meet the segmentation condition.

2. The method according to claim 1, characterized in that The image size includes width information and height information, wherein adjusting the image size and the number of channels of the target image to obtain a data rearrangement image includes: Divide the pixel data of the target image to determine Z target sub-images, wherein the target sub-images have the same number of channels as the target image, and the ratio of the product of the width information and the height information of the target image to the product of the width information and the height information of the target sub-image is Z, where Z is an integer greater than 1; The Z target sub-images are combined in the channel direction to obtain a data rearrangement image.

3. The method according to claim 2, characterized in that Dividing the pixel data of the target image to determine Z target sub-images includes: Determine multiple pixel data in the target image that meet the data screening method as pixel data of a target sub-image, and generate the Z target sub-images respectively. Among them, the pixel data of different target sub-images are different.

4. The method according to claim 3, characterized in that in, The data screening method includes extracting pixel data of the target image according to a preset interval size, and two adjacent pixel data in the target sub-image are two pixel data with the preset interval size in the target image.

5. The method according to claim 1, characterized in that Extracting a feature map from the data rearrangement image and performing target detection based on the feature map, including: Using different feature extraction methods in parallel to extract feature maps from the data rearrangement images respectively; The extracted feature maps are fused to obtain a target feature map corresponding to the target image, and target detection is performed based on the target feature map.

6. The method according to claim 5, characterized in that Different feature extraction methods have different image receptive fields; and / or, The feature extraction method includes: a convolution feature extraction method and / or a pooling feature extraction method.

7. A neuromorphic device, comprising a many-core system, characterized in that: The multi-core system includes an image rearrangement core, a feature extraction core and a target detection output core; wherein, The image rearrangement core is used to adjust the image size and the number of channels of the target image to obtain a data rearranged image; The feature extraction core is used to extract feature maps from the data rearrangement image; The target detection output core is used to perform target detection according to the feature map; The target image is obtained by: Acquire an image to be detected, and determine at least one sub-image to be detected corresponding to the image to be detected, and use the at least one sub-image to be detected as a target image; The step of determining at least one sub-image to be detected corresponding to the image to be detected includes: Calculate the size ratio coefficient of the image to be detected and the standard input template image of the target detection network; When the size ratio coefficient meets the segmentation condition, segmenting the image to be detected to determine at least two sub-images to be detected corresponding to the image to be detected; When the size ratio coefficient does not meet the segmentation condition, processing the image to be detected to determine a sub-image to be detected corresponding to the image to be detected; Wherein, the size of the sub-image to be detected is the same as the size of the standard input template image of the target detection network; When the size ratio coefficient does not meet the segmentation condition, the image to be detected is processed to determine a sub-image to be detected corresponding to the image to be detected, including: When the size ratio coefficient does not meet the segmentation condition, the image to be detected is reduced to obtain a sub-image to be detected corresponding to the image to be detected; The size ratio coefficient satisfies the segmentation conditions, including: If the size ratio coefficient is greater than a preset ratio coefficient threshold, determining that the size ratio coefficient meets the segmentation condition; The size ratio coefficient does not meet the segmentation conditions, including: If the size ratio coefficient is less than or equal to the preset ratio coefficient threshold, it is determined that the size ratio coefficient does not meet the segmentation condition.

8. The neuromorphic device according to claim 7, characterized in that The image size includes width information and height information. The image rearrangement core is used to divide the pixel data of the target image to determine Z target sub-images, wherein the target sub-images have the same number of channels as the target image, and the ratio of the product of the width information and the height information of the target image to the product of the width information and the height information of the target sub-image is Z, and Z is an integer greater than 1; The Z target sub-images are combined in the channel direction to obtain a data rearrangement image.

9. The neuromorphic device according to claim 7, characterized in that The number of the feature extraction cores is multiple; The plurality of feature extraction cores are used to extract feature maps of the data rearrangement images respectively using different feature extraction methods in parallel; The multi-core system further includes: a feature fusion core; the feature fusion core is used to fuse the extracted feature maps to obtain a target feature map corresponding to the target image; The target detection output core is used to perform target detection based on the target feature map.

10. The neuromorphic device according to claim 9, characterized in that Different feature extraction methods have different image receptive fields; and / or, The feature extraction method includes: a convolution feature extraction method and / or a pooling feature extraction method.

11. The neuromorphic device according to claim 7, characterized in that The many-core system includes a plurality of core groups, each of which includes: an image rearrangement core, a feature extraction core, and a target detection output core; The multiple core groups are used to perform target detection on multiple different target images in parallel.

12. A target detection device, characterized in that: include: An image acquisition module, used for acquiring a target image; An image rearrangement module, used for adjusting the image size and the number of channels of the target image to obtain a data rearranged image; An object detection module, used to extract a feature map from the data rearrangement image and perform object detection based on the feature map; Wherein, acquiring the target image comprises: Acquire an image to be detected, and determine at least one sub-image to be detected corresponding to the image to be detected, and use the at least one sub-image to be detected as a target image; The step of determining at least one sub-image to be detected corresponding to the image to be detected includes: Calculate the size ratio coefficient of the image to be detected and the standard input template image of the target detection network; When the size ratio coefficient meets the segmentation condition, segmenting the image to be detected to determine at least two sub-images to be detected corresponding to the image to be detected; When the size ratio coefficient does not meet the segmentation condition, processing the image to be detected to determine a sub-image to be detected corresponding to the image to be detected; Wherein, the size of the sub-image to be detected is the same as the size of the standard input template image of the target detection network; When the size ratio coefficient does not meet the segmentation condition, the image to be detected is processed to determine a sub-image to be detected corresponding to the image to be detected, including: When the size ratio coefficient does not meet the segmentation condition, the image to be detected is reduced to obtain a sub-image to be detected corresponding to the image to be detected; The size ratio coefficient satisfies the segmentation conditions, including: If the size ratio coefficient is greater than a preset ratio coefficient threshold, determining that the size ratio coefficient meets the segmentation condition; The size ratio coefficient does not meet the segmentation conditions, including: If the size ratio coefficient is less than or equal to the preset ratio coefficient threshold, it is determined that the size ratio coefficient does not meet the segmentation condition.

13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.