A target detection method, system, device and storage medium

By constructing a global self-attention module in the DETR model to perform global self-attention calculation and transformation of feature maps, the problem of low detection efficiency is solved, and efficient and accurate small target detection is achieved.

CN115761386BActive Publication Date: 2026-04-10STATE GRID DIGITAL TECHNOLOGY HOLDING CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
STATE GRID DIGITAL TECHNOLOGY HOLDING CO LTD
Filing Date
2022-11-23
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing DETR models suffer from low detection efficiency due to the lack of global attention calculation on feature maps during object detection. Furthermore, image segmentation reduces the correlation between pixels in the image, affecting the accuracy of small object detection.

Method used

By constructing a global self-attention module in a pre-defined convolutional neural network, global self-attention calculation is performed on the feature map, and it is converted into a target dimension matrix and input into the target detection model, which simplifies the detection process and avoids the steps of image restoration and convolutional layer stacking.

Benefits of technology

It improves the efficiency and accuracy of target detection, especially for small targets, simplifies the detection process, and reduces the proportion of time spent on feature extraction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115761386B_ABST
    Figure CN115761386B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a target detection method, system, device and storage medium, wherein the method comprises: performing feature extraction on an obtained target image by using a preset convolutional neural network to obtain a first feature map; performing global self-attention calculation on the first feature map by using a preset global self-attention module in the preset convolutional neural network to obtain a second feature map; converting an image matrix of the second feature map into a target dimension matrix; and inputting the target dimension matrix into a preset target detection model for target detection. The present application improves the detection efficiency of targets in an image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a target detection method, system, device, and storage medium. Background Technology

[0002] The Detection Transformer (DETR) model is used for object detection within images. When using the DETR model for object detection, a convolutional network is used to extract image features. However, the image dimensions of the extracted feature maps still do not meet the input requirements of the object detection network (transformer). Therefore, the DETR model needs to segment the obtained feature maps and then input multiple feature map chunks into the object detection network for object detection.

[0003] However, the DETR model does not calculate global attention for the feature maps before inputting them into the object detection network. This forces the object detection network to reconstruct each feature map and calculate global attention by stacking a large number of encoding layers. This results in low efficiency for detecting objects within images in existing object detection models. Summary of the Invention

[0004] The purpose of this invention is to provide a target detection method, system, device, and storage medium to improve the detection efficiency of targets within images. The specific technical solution is as follows:

[0005] A target detection method, the method comprising:

[0006] The target image is processed using a pre-defined convolutional neural network to extract features and obtain the first feature map.

[0007] Using the preset global self-attention module in the preset convolutional neural network, global self-attention calculation is performed on the first feature map to obtain the second feature map;

[0008] The image matrix of the second feature map is converted into a target dimension matrix, and the target dimension matrix is ​​input into a preset target detection model for target detection.

[0009] Optionally, the step of using a preset global self-attention module in the preset convolutional neural network to perform global self-attention calculation on the first feature map to obtain the second feature map includes:

[0010] The image matrix of the first feature map is reduced in dimensionality using the dimensionality reduction convolution kernel of the preset global self-attention module to obtain the first image matrix.

[0011] Using a preset dimension transformation function, the first image matrix is ​​subjected to two different dimension transformations to obtain the second and third image matrices.

[0012] The second and third image matrices are multiplied to obtain the feature weight matrix;

[0013] Using a preset convolution kernel, the first image matrix is ​​convolved to obtain a fourth image matrix. The fourth image matrix is ​​then multiplied with the feature weight matrix to obtain a global attention matrix.

[0014] The global attention matrix is ​​increased in dimension using the dimensionality-increasing convolution kernel of the preset global self-attention module to obtain the second feature map.

[0015] Optionally, the step of converting the image matrix of the second feature map into a target dimension matrix and inputting the target dimension matrix into a preset target detection model for target detection includes:

[0016] Using the preset dimension transformation function, the image matrix of the second feature map is flattened to obtain the target dimension matrix;

[0017] The target dimension matrix is ​​input to the encoder of the preset target detection model so that the encoder performs vector encoding on the target dimension matrix; the target dimension matrix after the vector encoding operation is input to the decoder of the preset target detection model for target detection.

[0018] Optionally, the vector encoding operation includes:

[0019] The encoder superimposes a preset position encoding matrix onto the target dimension matrix so that each element of the target dimension matrix carries corresponding position encoding information, wherein the position encoding information includes absolute position encoding and relative position encoding.

[0020] A target detection system, the system comprising:

[0021] The feature extraction module is used to extract features from the obtained target image using a preset convolutional neural network to obtain a first feature map;

[0022] The data calculation module is used to perform global self-attention calculation on the first feature map using the preset global self-attention module in the preset convolutional neural network to obtain the second feature map.

[0023] The target detection module is used to convert the image matrix of the second feature map into a target dimension matrix, and input the target dimension matrix into a preset target detection model for target detection.

[0024] Optionally, the data calculation module is configured as follows:

[0025] The image matrix of the first feature map is reduced in dimensionality using the dimensionality reduction convolution kernel of the preset global self-attention module to obtain the first image matrix.

[0026] Using a preset dimension transformation function, the first image matrix is ​​subjected to two different dimension transformations to obtain the second and third image matrices.

[0027] The second and third image matrices are multiplied to obtain the feature weight matrix;

[0028] Using a preset convolution kernel, the first image matrix is ​​convolved to obtain a fourth image matrix. The fourth image matrix is ​​then multiplied with the feature weight matrix to obtain a global attention matrix.

[0029] The global attention matrix is ​​increased in dimension using the dimensionality-increasing convolution kernel of the preset global self-attention module to obtain the second feature map.

[0030] Optionally, the target detection module is configured as follows:

[0031] Using the preset dimension transformation function, the image matrix of the second feature map is flattened to obtain the target dimension matrix;

[0032] The target dimension matrix is ​​input to the encoder of the preset target detection model so that the encoder performs vector encoding on the target dimension matrix; the target dimension matrix after the vector encoding operation is input to the decoder of the preset target detection model for target detection.

[0033] Optionally, the encoder in the target detection module is configured to perform the vector encoding operation as follows:

[0034] The encoder superimposes a preset position encoding matrix onto the target dimension matrix so that each element of the target dimension matrix carries corresponding position encoding information, wherein the position encoding information includes absolute position encoding and relative position encoding.

[0035] A target detection device, the device comprising:

[0036] processor;

[0037] Memory used to store the processor's executable instructions;

[0038] The processor is configured to execute the instructions to implement the target detection method as described above.

[0039] A computer-readable storage medium, when the instructions in the computer-readable storage medium are executed by a processor of a target detection device, enables the target detection device to perform any of the target detection methods described above.

[0040] This invention provides a target detection method, system, device, and storage medium. By setting a pre-defined convolutional neural network to extract features from target images, it can improve feature extraction efficiency while maintaining the network's feature extraction accuracy, reducing the time consumed by the feature extraction process in the overall target detection process. Simultaneously, by constructing a pre-defined global self-attention module based on a GC framework, global self-attention calculation can be implemented while ensuring the output feature map dimension meets the input constraints of the target detection model. Therefore, compared to existing technologies, the target detection model of this invention does not require image reconstruction and superimposed encoding layers, thus improving target detection efficiency. Finally, by constructing a pre-defined target detection model based on Transformer that eliminates the need for image reconstruction and convolutional layer superposition, the target detection process is simplified, further improving target detection efficiency. Therefore, this invention improves the efficiency of target detection within images.

[0041] Of course, any product or method implementing the present invention does not necessarily need to achieve all of the advantages described above at the same time. Attached Figure Description

[0042] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0043] Figure 1 A flowchart of a target detection method provided in an embodiment of the present invention;

[0044] Figure 2 A schematic diagram illustrating the execution steps of a preset global self-attention module, provided as an optional embodiment of the present invention;

[0045] Figure 3 A block diagram of a target detection system provided for another optional embodiment of the present invention;

[0046] Figure 4 A block diagram of a target detection device provided for another optional embodiment of the present invention. Detailed Implementation

[0047] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0048] This invention provides a target detection method, such as... Figure 1 As shown, the method includes:

[0049] S101. Use a pre-defined convolutional neural network to extract features from the obtained target image to obtain the first feature map.

[0050] Optionally, in one alternative embodiment of the present invention, the aforementioned preset convolutional neural network can be a neural network for image feature extraction, such as a residual learning network (ResNet). By setting the aforementioned preset convolutional neural network to extract features from the target image, the present invention can improve the feature extraction efficiency while maintaining the feature extraction accuracy of the network, thereby improving the overall efficiency of target detection.

[0051] S102. Using the preset global self-attention module in the preset convolutional neural network, perform global self-attention calculation on the first feature map to obtain the second feature map.

[0052] Optionally, in one alternative embodiment of the present invention, the aforementioned preset global self-attention module may be a module built based on the global context block (GC block).

[0053] It should be noted that calculating global attention is a crucial step in object detection in practical applications. However, when using existing models such as Transformer and DETR for object detection, the feature map dimension after convolution is still larger than the model's input limit. Therefore, image segmentation of the feature map is required, followed by image reconstruction by the model, and global attention is calculated by stacking a large number of encoding layers. This leads to a significant reduction in the overall efficiency of object detection. This invention constructs a pre-defined global attention module based on the GC framework, which can calculate global attention while ensuring that the output feature map dimension meets the aforementioned input limit of the object detection model. Thus, compared to existing technologies, the object detection model in this invention does not require image reconstruction and stacking encoding layers, thereby improving the efficiency of object detection.

[0054] It should be noted that existing object detection models based on Transformer obtain feature maps from multiple segmented images, none of which have undergone global self-attention computation. Image segmentation reduces the correlation between pixels in the images, thus lowering the accuracy of existing object detection models in detecting small objects. This invention, however, employs the aforementioned pre-set global self-attention module, performing global self-attention computation on the feature maps before inputting them into the object detection model, and eliminating the need for image segmentation. This results in improved accuracy for detecting small objects in images compared to existing technologies.

[0055] S103. Convert the image matrix of the second feature map into a target dimension matrix, and input the target dimension matrix into the preset target detection model for target detection.

[0056] Optionally, in one alternative embodiment of the present invention, in a practical application scenario, after the above-described... Figure 1 The second feature map obtained in step S102 may have dimensions that do not meet the input constraints of the object detection model. Therefore, in order to reduce the dimensionality of the second feature map while preserving the feature data in the second feature map, it is necessary to convert the image matrix of the second feature map into a target dimension matrix.

[0057] Those skilled in the art will understand that the operation described above, which converts the image matrix of the second feature map into a target dimension matrix, can be implemented using a matrix transformation function (Reshape). This invention will not elaborate further on the specific construction process of Reshape.

[0058] It should be noted that the present invention, through the above-described... Figure 1Steps S101 and S102, as shown, have completed the global attention calculation on the feature map. Therefore, the above... Figure 1 The preset target detection model in step S103, compared to existing target detection models, eliminates the need for image reconstruction and convolutional layer stacking, simplifying the target detection process and improving its efficiency. Optionally, in one alternative embodiment of the present invention, the above-described... Figure 1 The preset target detection model in step S103 shown can be a model obtained by removing image restoration and convolutional layer stacking functions from an existing target detection model based on Transformer.

[0059] This invention extracts features from target images using a pre-defined convolutional neural network, maintaining feature extraction accuracy while improving efficiency and reducing the time commitment of feature extraction in the overall target detection process. Simultaneously, by constructing a pre-defined global self-attention module based on a GC framework, global self-attention computation is achieved while ensuring the output feature map dimension meets the input constraints of the target detection model. Therefore, compared to existing technologies, the target detection model in this invention eliminates the need for image reconstruction and layer stacking, thus improving target detection efficiency. Finally, by constructing a Transformer-based pre-defined target detection model that eliminates the need for image reconstruction and convolutional layer stacking, the target detection process is simplified, further improving efficiency. Therefore, this invention significantly improves the efficiency of target detection within images.

[0060] Optionally, a second feature map is obtained by performing global self-attention calculation on the first feature map using a preset global self-attention module in a preset convolutional neural network, including:

[0061] The image matrix of the first feature map is reduced in dimension by using the dimensionality reduction convolution kernel of the preset global self-attention module to obtain the first image matrix;

[0062] Using a preset dimension transformation function, the first image matrix is ​​transformed twice with different dimensions to obtain the second and third image matrices.

[0063] The feature weight matrix is ​​obtained by multiplying the second and third image matrices.

[0064] Using a preset convolution kernel, the first image matrix is ​​convolved to obtain the fourth image matrix. The fourth image matrix is ​​then multiplied with the feature weight matrix to obtain the global attention matrix.

[0065] The global attention matrix is ​​increased in dimension by using the up-dimensional convolution kernel of the preset global self-attention module to obtain the second feature map.

[0066] Optionally, in another alternative embodiment of the present invention, the aforementioned preset dimension transformation function can be a function constructed based on the matrix transformation function (Reshape).

[0067] It should be noted that in practical applications, the convolutional dimensions of the aforementioned dimensionality reduction convolution kernel, the aforementioned dimensionality increase convolution kernel, and the aforementioned preset convolution kernel are consistent.

[0068] Optionally, in another embodiment of the present invention, since each pixel in the image carries redundant information, performing global attention calculation on each pixel in the image would not only fail to improve subsequent detection accuracy but would also reduce computational efficiency. Therefore, to improve the computational efficiency of global attention, the parameters of the convolution kernel can be adjusted to perform interval calculation of global attention on each pixel.

[0069] It should be noted that, for ease of understanding of the aforementioned preset global self-attention module and its execution steps, an optional embodiment of the present invention is described in conjunction with the following:

[0070] Please see Figure 1 and Figure 2 This embodiment will be understood. Wherein, Figure 2 The diagram shows the execution steps of the aforementioned preset global self-attention module.

[0071] For ease of description, let's set it as follows: Figure 1 The target image in step S101 has dimensions of 1*3*224*224. Here, 1 represents one image, 3 represents that the target image has 3 channels, and 224*224 represents the height and width of the target image.

[0072] Then the above will be passed as follows Figure 1 After step S101, the first feature map obtained has dimensions of 1*1024*14*14. Here, 1 represents one image, 1024 represents the number of channels of the target image is 1024, and 14*14 represents the height and width of the target image.

[0073] It should be noted that, for ease of description, the settings here are as follows: Figure 1 The preset convolutional neural network in step S101 is ResNet50. In this embodiment, the steps performed by ResNet50 are steps well known to those skilled in the art, and the specific execution flow of these steps will not be described in detail in this invention.

[0074] Please see Figure 1 and Figure 2 For example Figure 1 Please understand step S102 as shown:

[0075] The dimensionality reduction of the first feature map's image matrix (1*1024*14*14) is reduced using a pre-defined global self-attention module's dimensionality reduction convolution kernel (CONV1), resulting in a first image matrix with dimensions of 1*512*14*14. Here, CONV1 is set to a 1*1*1 convolution kernel. This dimensionality reduction process involves performing two convolution operations on the first feature map's image matrix using CONV1.

[0076] Using a preset dimension transformation function (Reshape), the first image matrix is ​​subjected to two different dimension transformations to obtain the second and third image matrices. The second image matrix has a dimension of 196*512, and the third image matrix has a dimension of 512*196.

[0077] The second and third image matrices are multiplied and then normalized (Softmax) to obtain a feature weight matrix with dimensions 196*196. The multiplication operation in this step... Figure 2 The product is represented by an "X" inside a circle, and the product operation is performed within the circle. Figure 2 The label in is 1.

[0078] It should be noted that in practical applications, the above normalization operation may not be performed.

[0079] The first image matrix is ​​convolved using a preset convolution kernel (CONV2) to obtain a fourth image matrix. This fourth image matrix has a dimension of 196*512, and CONV2 is set to a 1*1*1 convolution kernel.

[0080] Optionally, the fourth image matrix can be obtained simultaneously with the second and third image matrices.

[0081] The feature weight matrix is ​​multiplied by the fourth image matrix to obtain the global attention matrix. This global attention matrix has a dimension of 196*512. The multiplication operation in this step... Figure 2 The product is represented by an "X" inside a circle, and the product operation is performed within the circle. Figure 2 The number in is 2.

[0082] The global attention matrix is ​​increased in dimension using Convolution V3 (CONV3) to obtain the image matrix representing the second feature map. CONV3 is set to a 1x1x1 convolution kernel. The image matrix of the second feature map has a dimension of 1024x14x14.

[0083] It should be noted that, in cases such as Figure 2In an optional embodiment of the present invention shown, both input and output variables are represented by dashed boxes. The execution entities of each step are represented by solid boxes.

[0084] Optionally, the image matrix of the second feature map is converted into a target dimension matrix, and the target dimension matrix is ​​input into a preset target detection model for target detection, including:

[0085] Using a preset dimension transformation function, the image matrix of the second feature map is flattened to obtain the target dimension matrix;

[0086] The target dimension matrix is ​​input into the encoder of the preset target detection model so that the encoder performs vector encoding on the target dimension matrix; the target dimension matrix after vector encoding is input into the decoder of the preset target detection model for target detection.

[0087] Optionally, in one alternative embodiment of the present invention, the aforementioned dimension flattening operation may refer to: using a preset dimension transformation function to transform the dimensions of a multi-dimensional image matrix so that the dimensions of the image matrix meet the input constraints of the target detection dimension. For example, if the dimensions of the image matrix are 1*1024*14*14, then after the aforementioned dimension flattening operation, the dimensions of the target dimension matrix obtained are 1*1024*96.

[0088] It should be noted that since the second feature map has already undergone global attention calculation, the encoder of the above-mentioned preset object detection model does not need to perform the global attention calculation process that the existing encoder would perform after receiving the target dimension matrix, but directly performs vector encoding operation.

[0089] It should be noted that the target detection performed by the decoder of the above-mentioned preset target detection model is the same as the operation performed by the decoder in the existing Transformer model. The present invention will not elaborate on the specific process of the above-mentioned target detection.

[0090] Optionally, the above vector encoding operations include:

[0091] The encoder superimposes a preset position encoding matrix onto the target dimension matrix so that each element of the target dimension matrix carries the corresponding position encoding information, which includes absolute position encoding and relative position encoding.

[0092] Among them, the absolute position embedding represents the position of a pixel in the image, and the relative position embedding represents the relative position relationship between pixels.

[0093] It should be noted that the dimensions of the aforementioned preset position encoding matrix are the same as the dimensions of the target dimension matrix. The specific construction process is common knowledge in this field, and will not be elaborated upon further in this invention.

[0094] Corresponding to the above method embodiments, the present invention also provides a target detection system, such as... Figure 3 As shown, the system includes:

[0095] Feature extraction module 301 is used to extract features from the obtained target image using a preset convolutional neural network to obtain a first feature map;

[0096] The data calculation module 302 is used to perform global self-attention calculation on the first feature map using the preset global self-attention module in the preset convolutional neural network to obtain the second feature map;

[0097] The target detection module 303 is used to convert the image matrix of the second feature map into a target dimension matrix and input the target dimension matrix into a preset target detection model for target detection.

[0098] Optionally, the data calculation module 302 described above is configured as follows:

[0099] The image matrix of the first feature map is reduced in dimension by using the dimensionality reduction convolution kernel of the preset global self-attention module to obtain the first image matrix;

[0100] Using a preset dimension transformation function, the first image matrix is ​​transformed twice with different dimensions to obtain the second and third image matrices.

[0101] The feature weight matrix is ​​obtained by multiplying the second and third image matrices.

[0102] Using a preset convolution kernel, the first image matrix is ​​convolved to obtain the fourth image matrix. The fourth image matrix is ​​then multiplied with the feature weight matrix to obtain the global attention matrix.

[0103] The global attention matrix is ​​increased in dimension by using the up-dimensional convolution kernel of the preset global self-attention module to obtain the second feature map.

[0104] Optionally, the target detection module 303 described above is configured as follows:

[0105] Using a preset dimension transformation function, the image matrix of the second feature map is flattened to obtain the target dimension matrix;

[0106] The target dimension matrix is ​​input into the encoder of the preset target detection model so that the encoder performs vector encoding on the target dimension matrix; the target dimension matrix after vector encoding is input into the decoder of the preset target detection model for target detection.

[0107] Optionally, the encoder in the target detection module 303 described above is configured to perform vector encoding operations as follows:

[0108] The encoder superimposes a preset position encoding matrix onto the target dimension matrix so that each element of the target dimension matrix carries the corresponding position encoding information, which includes absolute position encoding and relative position encoding.

[0109] This invention also provides a target detection device, such as... Figure 4 As shown, the device includes:

[0110] Processor 401;

[0111] Memory 402 is used to store executable instructions of processor 401;

[0112] The processor 401 is configured to execute instructions to implement any of the target detection methods described above.

[0113] This invention also provides a computer-readable storage medium, which, when the instructions in the computer-readable storage medium are executed by the processor of a target detection device, enables the target detection device to perform any of the target detection methods described above.

[0114] In a typical configuration, the device includes one or more processors (CPUs), memory, and a bus. The device may also include input / output interfaces, network interfaces, etc.

[0115] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, like read-only memory (ROM) or flash RAM, and memory includes at least one memory chip. Memory is an example of computer-readable media.

[0116] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0117] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0118] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.

[0119] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0120] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A target detection method characterized by, The method comprises: performing feature extraction on the obtained target image by using a preset convolutional neural network to obtain a first feature map; performing dimension reduction processing on an image matrix of the first feature map by using a dimension reduction convolution kernel of a preset global self-attention module constructed based on a global context module in the preset convolutional neural network to obtain a first image matrix; performing dimension conversion on the first image matrix twice by using a preset dimension conversion function to obtain a second image matrix and a third image matrix; performing product operation on the second image matrix and the third image matrix to obtain a feature weight matrix; performing convolution operation on the first image matrix by using a preset convolution kernel to obtain a fourth image matrix, and performing product operation on the fourth image matrix and the feature weight matrix to obtain a global attention matrix; performing dimension reduction processing on the global attention matrix by using a dimension reduction convolution kernel of the preset global self-attention module to obtain a second feature map; converting an image matrix of the second feature map into a target dimension matrix, and inputting the target dimension matrix into a preset target detection model based on a Transformer to perform target detection, wherein the preset target detection model does not need to perform image restoration and superposition coding layer.

2. The method of claim 1, wherein, The conversion of the image matrix of the second feature map into the target dimension matrix and the input of the target dimension matrix into the preset target detection model based on the Transformer to perform target detection comprises: performing dimension flattening operation on the image matrix of the second feature map by using the preset dimension conversion function to obtain the target dimension matrix; inputting the target dimension matrix into an encoder of the preset target detection model to enable the encoder to perform vector coding operation on the target dimension matrix; and inputting the target dimension matrix subjected to the vector coding operation into a decoder of the preset target detection model to perform the target detection.

3. The method of claim 2, wherein, The vector coding operation comprises: the encoder superimposes a preset position encoding matrix on the target dimension matrix to enable each element of the target dimension matrix to carry corresponding position encoding information, wherein the position encoding information comprises absolute position encoding and relative position encoding.

4. A target detection system characterized by, The system comprises: a feature extraction module configured to perform feature extraction on a target image obtained by using a preset convolutional neural network to obtain a first feature map; The data calculation module is configured to: perform dimension reduction processing on an image matrix of the first feature map by using a dimension reduction convolution kernel of a preset global self-attention module constructed based on a global context module in the preset convolutional neural network, to obtain a first image matrix; perform two different dimension conversions on the first image matrix by using a preset dimension conversion function, to obtain a second image matrix and a third image matrix; perform product operation on the second image matrix and the third image matrix, to obtain a feature weight matrix; perform convolution operation on the first image matrix by using a preset convolution kernel, to obtain a fourth image matrix; perform product operation on the fourth image matrix and the feature weight matrix, to obtain a global attention matrix; and perform dimension increase processing on the global attention matrix by using a dimension increase convolution kernel of the preset global self-attention module, to obtain a second feature map. The target detection module is configured to: convert an image matrix of the second feature map into a target dimension matrix, and input the target dimension matrix into a preset target detection model based on a Transformer, to perform target detection, wherein the preset target detection model does not need to perform image restoration and superposition coding layer.

5. The system of claim 4, wherein, The target detection module is configured to: perform dimension flattening operation on the image matrix of the second feature map by using the preset dimension conversion function, to obtain the target dimension matrix; input the target dimension matrix into an encoder of the preset target detection model, to enable the encoder to perform vector coding operation on the target dimension matrix; input the target dimension matrix subjected to the vector coding operation into a decoder of the preset target detection model, to perform the target detection.

6. The system of claim 5, wherein, The encoder in the target detection module is configured to perform the vector coding operation in that: the encoder superimposes a preset position encoding matrix on the target dimension matrix, to enable each element of the target dimension matrix to carry corresponding position encoding information, wherein the position encoding information includes absolute position encoding and relative position encoding.

7. A target detection device, characterized by The device comprises: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the target detection method according to any one of claims 1 to 3.

8. A computer-readable storage medium, characterized in that, When the instructions in the computer-readable storage medium are executed by the processor of the target detection device, the target detection device is enabled to perform the target detection method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • Image key point detection method and system, electronic equipment and storage medium

    CN113469111A