Target detection methods, electronic devices and their storage media

By acquiring the predicted probability and feature position sequence of the detection feature units in the detected image, selecting candidate positions and considering spatial location information, the problem of inaccurate target detection in the existing technology is solved, and higher accuracy image target recognition is achieved.

CN117788795BActive Publication Date: 2026-11-10PENG CHENG LAB +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311782180.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-21
Publication Date
2026-11-10
Estimated Expiration
2043-12-21

AI Technical Summary

Technical Problem

In existing image target detection methods, the initialization of the target depends on the probability value predicted by the transform network or static parameters, which results in insufficient accuracy in the predicted target location and category.

Method used

By acquiring multiple detection feature units of the detected image, prediction processing is performed to obtain a prediction probability sequence and a feature position sequence. Candidate positions are selected, and the target position is selected from the candidate positions based on the evaluation index. Finally, the target position is input into the transformation network for target recognition, and the spatial location information of the candidate positions is considered to improve accuracy.

Benefits of technology

It improves the accuracy of image target recognition by considering the spatial distribution information between candidate locations and selecting more accurate target locations, thereby enhancing the target recognition effect of the detected image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117788795B_ABST
    Figure CN117788795B_ABST
Patent Text Reader

Abstract

The target detection method, electronic device, and storage medium proposed in this application acquire multiple detection feature units of a detection image, perform a first prediction process on these multiple detection feature units to obtain a predicted probability sequence and a feature position sequence for each detection feature unit; then, select multiple candidate positions based on the predicted probability sequence and feature position sequence; next, acquire an evaluation index corresponding to each candidate position, and select a target position from the candidate positions based on the evaluation index; wherein, the evaluation index is used to indicate the spatial position information between the candidate position and other candidate positions; finally, input the target position and the detection feature units into a first transformation network for target recognition, and obtain the target detection result and classification recognition result of the detection image. Therefore, in the process of image target recognition, the spatial distribution information of candidate positions is considered to obtain a more accurate target position, thereby improving the accuracy of target recognition in the detection image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image recognition technology, and in particular to target detection methods, electronic devices and their storage media. Background Technology

[0002] Object detection and image recognition are among the most important research areas in computer vision. Object detection refers to automatically detecting objects of a specific category in a given image and accurately locating their positions. Image recognition refers to classifying or labeling a given input image, mapping the image to a fixed category or label. Object detection and image recognition are closely related and complementary fundamental research tasks in computer vision, with wide applications in fields such as robot navigation, autonomous driving, intelligent monitoring, human-computer interaction, and image retrieval.

[0003] In related technologies, for image target recognition, a CNN model is typically used to extract image features from the detection image. These features are then input into a transform network to obtain output features, which are then input into a neural network to obtain the predicted location and category of the target in the detection image. However, this image target detection method relies solely on the probability values ​​predicted by the transform network for target initialization, or directly initializes the target with static parameters, resulting in insufficient accuracy in the predicted location and category of the identified target. Summary of the Invention

[0004] This application provides a target detection method, an electronic device, and a storage medium thereof, which can improve the accuracy of target recognition in detected images.

[0005] To achieve the above objectives, a first aspect of this application provides a target detection method, comprising:

[0006] Multiple detection feature units of the detected image are obtained, and the multiple detection feature units are subjected to a first prediction process to obtain the prediction probability sequence and feature position sequence of each detection feature unit;

[0007] Multiple candidate locations are selected based on the predicted probability sequence and the feature location sequence;

[0008] The evaluation index corresponding to each candidate location is obtained, and the target location is selected from the candidate locations based on the evaluation index; the evaluation index is used to indicate the spatial location information between the candidate location and other candidate locations.

[0009] The target location and the detection feature unit are input into the first transformation network for target recognition, thereby obtaining the target detection result and classification recognition result of the detection image.

[0010] In some embodiments, the acquisition of multiple detection feature units of the detection image includes:

[0011] The detected image is input into the backbone network model for feature extraction to obtain multiple first feature layers;

[0012] After the first feature layer is flattened, it is input into the second transformation network to obtain the corresponding second feature layer of the detected image. The second feature layer includes multiple detection feature units.

[0013] In some embodiments, the first prediction processing of the plurality of detection feature units to obtain a predicted probability sequence and feature position sequence for each detection feature unit includes:

[0014] The second feature layer after flattening is dimensionally concatenated to obtain the concatenated data of the detection feature unit;

[0015] The concatenated data is linearly processed to obtain the predicted probability and feature position corresponding to each feature type of the detection feature unit. The predicted probability sequence is obtained based on the predicted probability, and the feature position sequence is obtained based on the feature position.

[0016] In some embodiments, selecting multiple candidate locations based on the predicted probability sequence and the feature location sequence includes:

[0017] The largest predicted probability in the predicted probability sequence is selected as the maximum classification probability value of the detection feature unit.

[0018] Obtain the sorting result of the maximum classification probability value, and select a preset number of detection feature units as candidate feature units based on the sorting result;

[0019] The feature position corresponding to the highest predicted probability among the candidate feature units is obtained as the candidate position.

[0020] In some embodiments, obtaining the evaluation index corresponding to each candidate position includes:

[0021] Obtain the feature distance between each candidate location and the other candidate locations;

[0022] Based on the feature distance, calculate the standard deviation and mean distance between each candidate location and other candidate locations;

[0023] The discrete coefficient of variation vector for each candidate location is obtained based on the ratio of the distance standard deviation to the distance mean.

[0024] The evaluation index corresponding to each candidate position is calculated based on the discrete coefficient of variation vector.

[0025] In some embodiments, the step of inputting the target location and the detection feature unit into a first transform network for target recognition to obtain the target detection result and classification recognition result of the detected image includes:

[0026] An initial position bias vector is obtained, and the initial position bias vector, the target position, and the second feature layer are input into a first transformation network for feature recognition to obtain output feature data;

[0027] The output feature data is input into a first feedforward neural network to perform target recognition and obtain the target detection result at the target location;

[0028] The output feature data is input into a second feedforward neural network for classification and recognition to obtain the classification and recognition result of the target location.

[0029] In some embodiments, the training process of the backbone network model includes:

[0030] Obtain the first sample dataset, which includes multiple first detection samples and first detection labels;

[0031] The first detected sample is input into the backbone network model for feature extraction to obtain the first sample feature layer;

[0032] Global pooling and dimension concatenation are performed on the first sample feature layer, and the result is input into a linear layer to obtain the first detection and classification result of the first sample dataset; the first detection and classification result is used to characterize all target categories in the first sample feature layer.

[0033] The first loss result of the first sample dataset is obtained based on multiple first detection classification results and the first detection label, and the backbone network model is updated based on the first loss result.

[0034] In some embodiments, the training process of the second transformation network includes:

[0035] The first sample feature layer is input into the second transformation network for feature extraction to obtain a second sample feature layer with the same feature dimension as the first sample feature layer.

[0036] Global pooling and dimension concatenation are performed on the second sample feature layer, and the result is input into a linear layer to obtain the second detection and classification result of the second sample dataset; the second detection and classification result is used to characterize all target categories in the second sample feature layer.

[0037] The second loss result of the second sample dataset is obtained based on multiple second detection classification results and the second detection label, and the second transformation network is updated based on the second loss result.

[0038] To achieve the above objectives, a second aspect of this application provides a target detection device, comprising:

[0039] The feature acquisition module is used to acquire multiple detection feature units of the detected image, and perform a first prediction process on the multiple detection feature units to obtain a prediction probability sequence and feature position sequence for each detection feature unit;

[0040] The candidate selection module is used to select multiple candidate positions based on the predicted probability sequence and the feature position sequence;

[0041] An evaluation acquisition module is used to acquire an evaluation index corresponding to each candidate location, and select a target location from the candidate locations based on the evaluation index; the evaluation index is used to indicate the spatial location information between the candidate location and other candidate locations.

[0042] The result processing module is used to input the target location and the detection feature unit into the first transformation network for target recognition, and obtain the target detection result and classification recognition result of the detection image.

[0043] To achieve the above objectives, a third aspect of this application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the target detection method as described in the first aspect.

[0044] To achieve the above objectives, a fourth aspect of the present application provides a storage medium, which is a computer-readable storage medium storing a computer program that, when executed by a processor, implements the target detection method described in the first aspect.

[0045] The target detection method, electronic device, and storage medium proposed in this application acquire multiple detection feature units of a detection image, perform a first prediction process on the multiple detection feature units to obtain a predicted probability sequence and a feature position sequence for each detection feature unit; then, select multiple candidate positions based on the predicted probability sequence and feature position sequence; next, acquire an evaluation index corresponding to each candidate position, and select a target position from the candidate positions based on the evaluation index; wherein, the evaluation index is used to indicate the spatial position information between the candidate positions and other candidate positions; finally, input the target position and the detection feature units into a first transformation network for target recognition, and obtain the target detection result and classification recognition result of the detection image. In the image target recognition process, this application first generates multiple candidate targets using the predicted probability and feature position of the detection feature units, and further selects the target position from the multiple candidate targets using the spatial position information of the feature positions between the multiple candidate targets, thereby considering the spatial distribution information between each candidate position to obtain a more accurate target position, and thus improving the accuracy of target recognition in the detection image by utilizing the target position.

[0046] Other features and advantages of this application will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the description, claims and drawings. Attached Figure Description

[0047] Figure 1 This is a schematic flowchart of an image target recognition and detection method provided in an embodiment of this application.

[0048] Figure 2 This is a flowchart of a target detection method provided in another embodiment of this application.

[0049] Figure 3 yes Figure 2 Flowchart of step S201.

[0050] Figure 4 yes Figure 2 Another flowchart for step S201.

[0051] Figure 5 yes Figure 2 Flowchart of step S202.

[0052] Figure 6 This is a schematic block diagram illustrating candidate position selection according to another embodiment of this application.

[0053] Figure 7 yes Figure 2 Flowchart of step S203.

[0054] Figure 8 This is a schematic block diagram illustrating the relative positional relationship provided in another embodiment of this application.

[0055] Figure 9 yes Figure 2 The flowchart for step S204.

[0056] Figure 10 This is a schematic flowchart of a target detection method provided in another embodiment of this application.

[0057] Figure 11 This is a flowchart of the training process of a backbone network model provided in one embodiment of this application.

[0058] Figure 12 This is a flowchart of the training process of the second transform network provided in an embodiment of this application.

[0059] Figure 13 This is yet another illustrative flowchart of a target detection method provided in another embodiment of this application.

[0060] Figure 14 This is a simulation diagram of the target detection result provided in another embodiment of this application.

[0061] Figure 15 This is a schematic diagram of the target detection device provided in an embodiment of this application.

[0062] Figure 16 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0063] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0064] It should be noted that although functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart.

[0065] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0066] First, let's analyze some of the terms used in this application:

[0067] A Convolutional Neural Network (CNN) is a deep learning model primarily used for computer vision tasks. When processing data such as images and speech, CNNs can automatically learn and extract features, overcoming the shortcomings of manual feature extraction in traditional methods. The core of a CNN is the convolutional layer, which uses convolution operations to extract local features from an image. The convolutional layer extracts features from local regions of the input image by applying a series of filters (or convolutional kernels). Each filter can learn different features, such as edges, textures, and colors. Through convolution operations, the convolutional layer can share parameters at different locations, reducing the number of parameters in the model and enhancing the model's ability to learn translation invariance.

[0068] In image recognition tasks, a backbone network model typically refers to the main structure used to extract image features. In deep learning, some classic backbone network models are widely used.

[0069] In image recognition tasks, a feature detection unit (FMU) is a component or algorithm used to extract key features from an image. These FMUs are commonly used in tasks such as object detection or image classification to identify and locate targets of interest or important features in an image.

[0070] The Transformer model is a neural network model based on self-attention. Compared to traditional recurrent neural networks (RNNs), the Transformer introduces self-attention to capture the dependencies between different positions in the input sequence, avoiding the order dependency problem inherent in RNNs. The Transformer consists of multiple encoders and decoders stacked together. In the Transformer, the encoder encodes the input sequence, and the decoder generates the target sequence based on the encoder's output. Each encoder and decoder has multiple layers, each consisting of a multi-head self-attention mechanism and a feedforward neural network.

[0071] In the Transformer model, the "query token" refers to the "query" part of the Transformer. The Transformer model is a sequence-to-sequence (seq2seq) model based on self-attention, used for Natural Language Processing (NLP) tasks such as machine translation and text generation. The input to the Transformer model consists of several tokens, each representing an element of the input sequence (such as a word or a character). In each layer of the Transformer model, the input tokens undergo three linear transformations to obtain three vectors, called the "query," "keys," and "values." These three vectors are used to calculate attention weights and complete the self-attention mechanism. The "query" is a vector describing the current position information, used in attention calculation to determine the correlation (weight) between each position and other positions. It is generated from the input tokens through a linear transformation and serves as key information in the attention mechanism. By multiplying the query vector by the transpose of the key vector, the attention weights are obtained, and then a weighted average is taken to obtain the final context representation.

[0072] Object detection and image recognition are among the most important research areas in computer vision. Object detection refers to automatically detecting objects of a specific category in a given image and accurately locating their positions. Image recognition refers to classifying or labeling a given input image, mapping the image to a fixed category or label. Object detection and image recognition are closely related and complementary fundamental research tasks in computer vision, with wide applications in fields such as robot navigation, autonomous driving, intelligent monitoring, human-computer interaction, and image retrieval.

[0073] In related technologies, for image target recognition, a CNN model is typically used to extract image features from the detection image. These features are then input into a transform network to obtain output features, which are then input into a neural network to obtain the predicted location and category of the target in the detection image. However, this image target detection method relies solely on the probability values ​​predicted by the transform network for target initialization, or directly initializes the target with static parameters, resulting in insufficient accuracy in the predicted location and category of the identified target.

[0074] Based on this, embodiments of this application provide a target detection method, an electronic device, and a storage medium thereof, which can improve the accuracy of target recognition in detected images. The target detection method proposed in this application mainly involves acquiring multiple detection feature units of the detected image, performing a first prediction process on these multiple detection feature units to obtain a predicted probability sequence and a feature position sequence for each detection feature unit; then selecting multiple candidate positions based on the predicted probability sequence and feature position sequence; next, obtaining an evaluation index corresponding to each candidate position, and selecting a target position from the candidate positions based on the evaluation index; wherein the evaluation index is used to indicate the spatial position information between the candidate positions and other candidate positions; finally, inputting the target position and the detection feature units into a first transformation network for target recognition, obtaining the target detection result and classification recognition result of the detected image. In the image target recognition process, embodiments of this application first generate multiple candidate targets using the predicted probability and feature position of the detection feature units, and then further select a target position from the multiple candidate targets using the spatial position information of the feature positions between the multiple candidate targets, thereby considering the spatial distribution information between each candidate position to obtain a more accurate target position, and thus improving the accuracy of target recognition in the detected image using the target position.

[0075] This application provides a target detection method, an electronic device, and a storage medium thereof, which are specifically described through the following embodiments. First, the target detection method in this application is described.

[0076] This application's embodiments can acquire and process relevant data based on artificial intelligence (AI) technology. AI is the theory, methods, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to obtain optimal results. In other words, AI is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce a new type of intelligent machine that can react in a way similar to human intelligence. AI also studies the design principles and implementation methods of various intelligent machines, enabling them to possess perception, reasoning, and decision-making capabilities.

[0077] The target detection method provided in this application relates to the field of artificial intelligence technology, and particularly to the field of data computing and processing. The target detection method provided in this application can be applied to a terminal, a server, or a computer program running on either a terminal or a server. For example, the computer program can be a native program or software module in an operating system; it can be a local application (APP), i.e., a program that needs to be installed in the operating system to run; it can also be a small program, i.e., a program that only needs to be downloaded to a browser environment to run; or it can be a small program that can be embedded in any APP. In short, the above-mentioned computer program can be any form of application, module, or plugin. The terminal communicates with the server via a network. The target detection method can be executed by the terminal or the server, or by the terminal and the server working together.

[0078] In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, or smartwatch, etc. Additionally, the terminal can also be a smart in-vehicle device. This smart in-vehicle device applies the target detection method of this embodiment to provide related services, enhancing the driving experience. The server can be a standalone server, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms; it can also be a service node in a blockchain system, where the service nodes form a peer-to-peer (P2P) network. The P2P protocol is an application layer protocol running on top of the Transmission Control Protocol (TCP). An image recognition system server can be installed on the server, allowing interaction with the terminal. For example, corresponding software can be installed on the server; the software can be an application implementing the target detection method, but is not limited to the above forms. The terminal and the server can be connected via Bluetooth, Universal Serial Bus (USB) or network, etc., and this embodiment does not impose any restrictions.

[0079] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers (PCs), minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0080] In some embodiments, the target detection method provided in this application is mainly aimed at improving image target recognition and detection in the prior art. Therefore, in order to better describe the target detection method provided in this application, the embodiments of this application first describe the process of image target recognition and detection in the prior art.

[0081] Reference Figure 1 The diagram shown is a schematic flowchart of an image target recognition and detection method provided in an embodiment of this application. The image recognition and detection device uses a CNN model to obtain an image feature layer containing multiple image features from the detection image. Then, the obtained image feature layer and positional encoding are input into a transform network encoder for encoding processing to obtain the target features output by the transform network encoder. The target features and target object query vectors (Queries) are then input into a transform network decoder and a feedforward network (FFN) to obtain the predicted location and category of the target in the detection image, thereby realizing the target recognition and detection process for the detection image. However, this image target recognition and detection method has some shortcomings, such as: 1. The initialization of the object query vector (query) in this method only relies on the probability value predicted by the model, or is directly initialized through static parameters, ignoring the spatial distribution information of the query, resulting in an unbalanced query distribution, i.e., lacking instance-level information in the image; 2. This method matches a single corresponding target detection box for each query. This process ignores the interrelationships between different target queries in the image and the overall relationship in the image, i.e., lacking image-level information, etc. Because of these shortcomings, the accuracy of the target recognition results obtained by this image target recognition and detection method is still relatively low.

[0082] Based on the image target recognition and detection method described above, the target detection method in the embodiments of this application is further described below. In this embodiment, the target detection method can be applied to a target detection device. (Refer to...) Figure 2 This is an optional flowchart of the target detection method provided in the embodiments of this application. Figure 2 The method may include, but is not limited to, steps S201 to S204. It is also understood that this embodiment... Figure 2 The order of steps S201 to S204 is not specifically limited, and the order of steps can be adjusted or some steps can be reduced or added according to actual needs.

[0083] Step S201: Obtain multiple detection feature units of the detection image, and perform first prediction processing on the multiple detection feature units to obtain the prediction probability sequence and feature position sequence of each detection feature unit.

[0084] In some embodiments, upon responding to a target recognition and detection requirement for a detected image, the target detection device first acquires multiple detection feature units of the detected image. This allows for a first prediction process using these multiple feature units to obtain a predicted probability sequence and a feature position sequence for each feature unit. This facilitates subsequent target recognition and detection of the detected image using the predicted probability sequence and feature position sequence of each feature unit. In this embodiment, the source of the detected image is not limited; it can be manually input, generated by a machine learning model, extracted from a database using a computer device, or crawled from the internet using a computer device, etc.

[0085] In some embodiments, to improve the accuracy and effectiveness of obtaining detection feature units from detection images, the obtained detection feature units need to be enhanced. The specific steps for obtaining detection feature units will be further described below.

[0086] Reference Figure 3 The process of acquiring multiple detection feature units of the detection image includes the following steps S301 to S302.

[0087] Step S301: Input the detected image into the backbone network model to extract features and obtain multiple first feature layers.

[0088] Step S302: After the first feature layer is flattened, it is input into the second transformation network to obtain the corresponding second feature layer of the detection image. The second feature layer includes multiple detection feature units.

[0089] In some embodiments, in response to the target recognition and detection requirement of a detected image, the target detection device first inputs the detected image into a backbone network model for feature extraction to obtain multiple first feature layers of the detected image. Then, after flattening these multiple feature layers, it inputs them into a second transform network for feature enhancement to obtain multiple second feature layers of the detected image. Each second feature layer includes multiple enhanced detection feature units, and the number of second feature layers is the same as the number of first feature layers. This facilitates subsequent target recognition and detection of the detected image using the enhanced detection feature units, thereby improving the accuracy of target recognition and detection. It can be understood that the flattening process of the Transformer flattens the input sequence into a two-dimensional matrix according to its dimensions (also known as channels or features), where each row corresponds to a position in the input sequence. This process is to facilitate the processing and calculation of the input matrix.

[0090] In some embodiments, a deep multilayer perceptron (MLP) model is used as the backbone network model. It can be understood that a deep multilayer perceptron (MLP) model is a forward propagation-based neural network model composed of multiple hidden layers (usually fully connected layers) stacked together. It is a memoryless model capable of learning complex features and representations in the input data through multiple nonlinear transformations. In a deep MLP model, each layer contains multiple neurons (nodes), and each neuron uses a nonlinear activation function (such as ReLU, sigmoid, etc.) to transform the input and uses its output as the input to the next layer. The output of each layer can also be viewed as a feature extraction of the input data by that layer.

[0091] Furthermore, a second transform network is used to enhance the features of the first feature layer. This second transform network can be a multi-layered Transformer encoder. It is understood that a Transformer encoder is part of a Transformer model used for encoding and feature extraction of the input sequence. It consists of multiple identical encoder layers, with each encoder layer processing the input sequence.

[0092] In some embodiments, after obtaining multiple detection feature units of the detection image, in order to improve the accuracy of target recognition and detection of the detection image, it is necessary to calculate the predicted probability sequence and feature position sequence of each detection feature unit. Therefore, the first prediction processing process will be further described in detail below.

[0093] Therefore, refer to Figure 4The first prediction process is performed on multiple detection feature units to obtain the prediction probability sequence and feature position sequence of each detection feature unit, including the following steps S401 to S402.

[0094] Step S401: Perform dimensional concatenation on the flattened second feature layer to obtain the concatenated data of the detection feature units.

[0095] Step S402: Perform linear processing on the spliced ​​data to obtain the predicted probability and feature position corresponding to each feature type of the detection feature unit. Based on the predicted probability, obtain the predicted probability sequence, and based on the feature position, obtain the feature position sequence.

[0096] In some embodiments, after obtaining multiple second feature layers of the detected image, the object detection device needs to perform a flattening operation (i.e., a flattening operation) and a concatenation operation (i.e., a concatenation operation) on the multiple second feature layers in spatial location to facilitate the interaction and computation of words at different positions in the sequence using the self-attention mechanism in the Transformer. This results in concatenated data of all detection feature units in all second feature layers. The concatenated data is then linearly processed to obtain the predicted probability and feature position corresponding to each feature type of each detection feature unit (i.e., token). Based on the predicted probabilities and feature positions corresponding to each feature type, a predicted probability sequence and a feature position sequence for each detection feature unit are obtained. This facilitates the subsequent selection of candidate positions using the predicted probability sequence and feature position sequence of each detection feature unit. It can be understood that dimensional concatenation refers to connecting two or more tensors with the same dimension (e.g., the same number of columns) along a certain dimension. In deep learning, dimensional concatenation is often used to merge multiple features or data representations into a larger feature vector.

[0097] In some embodiments, for each detection feature unit, the target detection device predicts the predicted probabilities of a specific number of feature categories. For example, if the COCO dataset has 80 feature categories, then for each detection feature unit, the predicted probabilities of the 80 feature categories are predicted, and then the predicted probability sequence of the detection feature unit is obtained based on the predicted probabilities of these 80 feature categories.

[0098] Step S202: Select multiple candidate positions based on the predicted probability sequence and the feature position sequence.

[0099] In some embodiments, after obtaining the predicted probability sequence of each detection feature unit, the target detection device will determine multiple candidate detection feature units by sorting the multiple predicted probability sequences, and determine the corresponding candidate positions based on the feature position sequences of the multiple candidate detection feature units. The selection process of the candidate positions will be further described below.

[0100] Reference Figure 5 Multiple candidate locations are selected based on the predicted probability sequence and the feature location sequence, including the following steps S501 to S503.

[0101] Step S501: Select the largest predicted probability in the predicted probability sequence as the maximum classification probability value of the detection feature unit.

[0102] Step S502: Obtain the ranking result of the maximum classification probability value, and select a preset number of detection feature units as candidate feature units based on the ranking result.

[0103] Step S503: Obtain the feature position corresponding to the highest predicted probability among the candidate feature units as the candidate position.

[0104] In some embodiments, after obtaining the predicted probability sequence of each detection feature unit, the target detection device selects the highest predicted probability from each predicted probability sequence as the maximum classification probability value of the corresponding detection feature unit (i.e., token). Then, all the maximum classification probability values ​​of the detection feature units are sorted from high to low, and a predetermined number of candidate detection feature units with the highest predicted probability values ​​are selected as candidate feature units based on the sorting result. This process can be represented as:

[0105]

[0106] Here, (e1,e2,e3,e4) refers to the second feature layer, Cat(e1,e2,e3,e4) refers to the concatenated data obtained by performing a dimensional concatenation operation on multiple second feature layers, Linear(Cat(e1,e2,e3,e4)) refers to performing a linear operation on the data to obtain a predicted probability sequence of multiple tokens, Max(Linear(Cat(e1,e2,e3,e4))) refers to determining the maximum classification probability value in each predicted probability sequence, and TopK(Max(Linear(Cat(e1,e2,e3,e4)))) is the value of the top preset number of detection feature units selected from multiple maximum classification probability values. This refers to multiple candidate feature units, where the preset number of candidates is K = λN. q λ≥1. Next, multiple candidate positions (i.e., candidate queries) are determined based on the feature positions corresponding to multiple candidate feature units.

[0107] In some embodiments, the multiple candidate positions obtained in steps S501 to S503 can be used to initially select relatively accurate candidate positions. (Refer to...) Figure 6The diagram shown is a schematic block diagram of candidate position selection provided in an embodiment of this application. The multiple candidate positions obtained using steps S501 to S503 can cover most of the detection feature units in the detected image, but not completely. That is, the candidate positions can only cover targets with larger areas, but cannot hit discrete targets or targets with smaller areas. This is because such candidate positions ignore the spatial distribution between queries, resulting in the inability to select candidate positions that cover all detection feature units. Therefore, the candidate positions need further processing as follows.

[0108] Step S203: Obtain the evaluation index corresponding to each candidate position, and select the target position from the candidate positions based on the evaluation index.

[0109] In some embodiments, since the above candidate location selection does not consider the spatial location distribution between queries, this embodiment needs to further consider the spatial location information between each selected candidate location and other candidate locations, and use evaluation indicators to evaluate the spatial correlation of each candidate location, so as to select a target location with higher confidence and more discreteness from multiple candidate locations according to the evaluation indicators. The process of selecting the target location will be further described in detail below.

[0110] Reference Figure 7 The evaluation index for each candidate position is obtained, including the following steps S701 to S704.

[0111] Step S701: Obtain the feature distance between each candidate location and other candidate locations.

[0112] Step S702: Based on the feature distance, calculate the standard deviation and mean distance between each candidate location and other candidate locations.

[0113] Step S703: Obtain the discrete coefficient of variation vector for each candidate location based on the ratio of the distance standard deviation to the distance mean.

[0114] Step S704: Calculate the evaluation index corresponding to each candidate position based on the discrete coefficient of variation vector.

[0115] In some embodiments, for each detection feature unit, each detection feature unit (token) corresponds to a specific location point in 2D space. Considering that the position of each candidate location in 2D space is arbitrary, to describe the relative positional relationships between candidate locations, this application constructs a graph for each image, labeled G, where the coordinates of each candidate location are treated as a node. For example... Figure 8The diagram shown is a schematic block diagram illustrating the relative positional relationships provided in an embodiment of this application. The edges between every two nodes in Figure G reflect the relative positional relationships between every two candidate locations. This application uses Euclidean distance (ED) as the metric for relative distance. Based on this distance, an adjacency matrix can be constructed. In this context, the i-th row and j-th column of the adjacency matrix A correspond to the i-th and j-th candidate positions, and the corresponding elements represent the feature distance between the i-th and j-th candidate positions. In other words, each element of A corresponds to the feature distance between every two candidate positions in graph G.

[0116] To distribute target locations as discretely as possible within a two-dimensional space including detection feature units, thus covering more potential targets, and considering the significant size differences between images (where absolute distance alone is insufficient to represent the relative positions of candidate locations across images of varying sizes), this application employs the Coefficient of Variation (CV) to measure the dispersion of each candidate location. The Coefficient of Variation C... V Defined by the ratio of the standard deviation to the mean:

[0117] C V =σ / μ (2)

[0118] Through the adjacency matrix Its standard deviation A can be calculated along its second dimension. σ and mean A μ Thus, the discrete coefficient of variation of the adjacency matrix is ​​obtained. Each value in the table represents the dispersion of each candidate position relative to other candidate positions. Lower values ​​indicate a more concentrated distribution of distances; that is, compared to the current candidate position, the distribution of other candidate positions is more concentrated, while the current candidate position is more dispersed. This application defines an evaluation metric Q for candidate positions, considering both the probability information predicted by the model and the dispersion information. The evaluation metric is defined as follows:

[0119]

[0120] In the formula, σ(*) is the sigmoid function. After acquiring evaluation indices for multiple candidate locations, the target detection device selects the candidate location with the highest evaluation index from a predetermined number of candidate locations as the target location, as follows:

[0121]

[0122] Unlike formula (1), the target preset quantity is K = N. qThat is, from λN q N candidate positions are selected. q Target position Q tar By using the evaluation metric Q, the predicted probability information and query distribution of each candidate location can be considered simultaneously. This allows for the selection of target locations with higher confidence and greater dispersion from multiple candidate locations, thereby effectively improving the detection accuracy of the target detection device in the detected image.

[0123] Step S204: Input the target location and detection feature unit into the first transform network for target analysis to obtain the target detection result and classification recognition result of the detected image.

[0124] In some embodiments, after acquiring the target location considering spatial location information, the target detection device inputs the target location and multiple second detection feature layers into a first transform network for target recognition, thereby obtaining more accurate target detection and classification results for the detected image. The first transform network can be a multi-layer Transformer decoder. It is understood that the Transformer decoder is an important component of the Transformer model, used to generate target sequence results. In sequence generation tasks such as machine translation, the decoder receives the encoder's output and gradually generates target sequence results based on this information. The specific process of target recognition will be further described below.

[0125] Therefore, refer to Figure 9 The target location and detection feature unit are input into the first transformation network for target recognition, and the target detection result and classification recognition result of the detection image are obtained, including the following steps S901 to S903.

[0126] Step S901: Obtain the initial position bias vector, and input the initial position bias vector, target position, and second feature layer into the first transformation network for feature recognition to obtain output feature data.

[0127] In some embodiments, to obtain more accurate target recognition results, in addition to acquiring the target position considering spatial location information, the target detection device also needs to acquire an initial position bias vector. Simultaneously, the initial position bias vector, the target position considering spatial location information, and the flattened second feature layer are input into the first transformation network for feature recognition to obtain output feature data. The initial position bias vector is a static variable initialized by the target detection device. This static variable is used to predict the offset of the target position. Adding the target position and the static variable allows for fine-tuning of the target position based on the corresponding offset in each dimension of the static variable, resulting in higher accuracy. The dimensions of the static variable and the target position are the same. Furthermore, the initial position bias vector is generated by the target detection device and is subsequently learned and optimized during image target recognition.

[0128] Step S902: Input the output feature data into the first feedforward neural network to perform target recognition and obtain the target detection result at the target location.

[0129] Step S903: Input the output feature data into the second feedforward neural network for classification and recognition to obtain the classification and recognition result of the target location.

[0130] In some embodiments, after obtaining the output feature data, the target detection device can accurately obtain the target detection result about the target location in the detection image by inputting the output feature data into a first feedforward neural network for target recognition, and can accurately obtain the target recognition result about the target location in the detection image by inputting the output feature data into a second feedforward neural network for classification recognition.

[0131] Reference Figure 10 This is a schematic flowchart of the target detection method provided in this application embodiment. The backbone network model obtains four first feature layers (b1, b2, b3, b4) from the detection image. Then, the flattened first feature layers are input into a second transform network to obtain four feature-enhanced second feature layers (e1, e2, e3, e4). These second feature layers are then concatenated and linearly processed to obtain multiple candidate positions. An evaluation metric is used to select the target position with high positional relevance from these candidate positions. Next, the target position, the initial position bias vector, and the flattened second feature layers are input into a first transform network for feature recognition to obtain output feature data. Finally, the output feature data is input into a first feedforward neural network and a second feedforward neural network to obtain the target detection result and classification result of the detection image regarding the target position.

[0132] In some embodiments, by acquiring the target location that takes into account spatial location information as described above, the problem of ignoring the spatial distribution information of queries in the prior art can be effectively solved, thereby improving the accuracy of target recognition and detection of the detected image. However, there is still the problem of ignoring the interrelationship and overall relationship between different target queries in the image. Therefore, in order to further improve the accuracy of target recognition and detection of the detected image, it is necessary to further improve the accuracy of acquiring detection feature units. It is necessary to train the backbone network model and the second transformation network. The training process of the backbone network model and the second transformation network will be described in detail below.

[0133] Reference Figure 11 The training process of the backbone network model includes the following steps S1101 to S1104.

[0134] Step S1101: Obtain the first sample dataset.

[0135] The sample dataset includes multiple first detection samples and first detection labels used to train the backbone network model and the second transformation network.

[0136] Step S1102: Input the first detection sample into the backbone network model for feature extraction to obtain the first sample feature layer.

[0137] Step S1103: Perform global pooling and dimension concatenation on the feature layer of the first sample and input it into the linear layer to obtain the first detection and classification result of the first sample dataset.

[0138] Step S1104: Obtain the first loss result of the first sample dataset based on multiple first detection classification results and first detection labels, and update the backbone network model based on the first loss result.

[0139] In some embodiments, the object detection device acquires a first sample dataset, which includes multiple first detection samples and first detection labels. These multiple first detection samples are then input into a backbone network model for feature extraction, resulting in multiple first sample feature layers. Next, a Global Classification Module (GCM) and a Global Classification Loss (GCL) are introduced to train the backbone network model, enabling it to identify all potential object categories in the detected image.

[0140] To reduce the computational cost and parameter count of the global classification module, pooling is first employed to reduce the spatial dimension of the first sample feature layer. Specifically, the global classification module mainly consists of a global average pooling layer and a linear layer. Using the global classification module, all target categories representing all potential feature types in the first sample feature layer can be obtained as follows:

[0141] GCM(X)=Linear(Cat(GAP(X1,X2,X3,X4))) (5)

[0142] In the formula, X represents the input feature; X1 to X4 represent features of different resolution sizes; and Linear represents the linear layer, specifically implemented through a fully connected layer, used to predict all target categories contained in the image. Since the first sample feature layers obtained by the backbone network model, except for the last first sample feature layer, mainly contain low-level feature information, i.e., lacking semantic information, this embodiment only uses the last layer feature (such as b4) of the first sample feature layer as the input of the global classification module.

[0143] The output of the global classification module yields the backbone network model's prediction of the categories contained in the first detected sample, thus enabling supervision and constraint through the global classification loss. In this application, the global classification loss employs a binary cross-entropy loss, and the first loss result for the first sample dataset is as follows:

[0144]

[0145] In the formula, y i This is a binary label (i.e., the first detection label), indicating whether each first detection sample contains the target of this category; 1 indicates it contains the target, and 0 indicates it does not. i This represents the prediction result of the global classification module; σ(*) represents the sigmoid function. Using the first loss result from the first sample dataset to adjust the backbone network model can effectively improve the accuracy of the first feature layer obtained by the backbone network model in the process of target recognition of detected images. This means it can identify more potential classification targets in the detected images, enabling the backbone network model to understand the image information from a global perspective.

[0146] Therefore, refer to Figure 12 The training process of the second transformation network includes the following steps S1201 to S1203.

[0147] Step S1201: Input the first sample feature layer into the second transformation network for feature extraction to obtain a second sample feature layer with the same feature dimension as the first sample feature layer.

[0148] Step S1202: Perform global pooling and dimension concatenation on the feature layer of the second sample and input it into the linear layer to obtain the second detection and classification result of the second sample dataset.

[0149] Step S1203: Obtain the second loss result of the second sample dataset based on multiple second detection classification results and second detection labels, and update the second transformation network based on the second loss result.

[0150] In some embodiments, similar to training the backbone network model, during the training of the second transformation network, the object detection device inputs the first sample feature layer output by the backbone network model into the second transformation network for feature extraction, so as to obtain a second sample feature layer with the same feature dimensions as the first sample feature layer. Then, the second transformation network is trained using the Global Classification Module (GCM) and the Global Classification Loss (GCL) to enhance the recognition of all potential object categories in the image.

[0151] Similar to formula (5), the global classification module can be used to obtain all target categories representing all potential feature types in the second sample feature layer, as shown below:

[0152] GCM(X)=Linear(Cat(GAP(X1,X2,X3,X4))) (7)

[0153] Where X represents the input feature; X1 to X4 represent input features at different resolutions; and Linear represents the linear layer, specifically implemented through a fully connected layer, used to predict all target categories contained in the image. Since the second transformation network enhances the features of the first feature layer, the resulting multi-layer second sample feature layers all contain semantic information. Therefore, in this embodiment, all second sample feature layers (such as e1 to e4) are used as input to the global classification module.

[0154] The output of the global classification module provides the backbone network model's prediction of the categories contained in the first detection sample, thus enabling supervision and constraint through the global classification loss. In this application, similar to equation (6), the global classification loss employs a binary cross-entropy loss to represent the second loss result for the second sample dataset, as follows:

[0155]

[0156] Among them, y iThis is a binary label (i.e., the second detection label), indicating whether each second detection sample contains the target of this category; 1 indicates it contains the target, and 0 indicates it does not. i This represents the prediction result of the global classification module; σ(*) represents the sigmoid function. By utilizing the second loss result from the second sample dataset to adjust the second transformation network, the accuracy of the second feature layer obtained by the second transformation network in enhancing the features of the detected image can be effectively improved during target recognition. This means that more potential classification targets in the detected image can be identified, enabling the second transformation network to understand the image information from a global perspective.

[0157] Reference Figure 13 This is another illustrative flowchart of the target detection method provided in the embodiments of this application. The target detection device performs, for example... Figure 10 While demonstrating the target detection method flow, the last layer (i.e., b4) in the first feature layer can be used to perform detection and classification results and calculate the first loss result to update the backbone network model. At the same time, the second feature layer (i.e., e1 to e4) can be used to perform detection and classification results and calculate the second loss result to update the second transformation network, thereby increasing the number of potential types identified by the first and second feature layers.

[0158] In some embodiments, this application pre-trains a deep MLP model on the ImageNet-1K dataset. The pre-trained model serves as part of the backbone network model for the detection model. The detection dataset uses the publicly available COCO2017 dataset, which contains 118k training images and 5k validation images. The evaluation metric used for the detection results is the average precision (AP) at different IoU thresholds. In this application example, a Strip-MLP model is used as the backbone network model. It is understood that the IoU threshold (Intersection over Union threshold) is a commonly used metric in object detection and image segmentation tasks, used to measure the degree of overlap between the predicted bounding box (or segmentation mask) and the ground truth bounding box (or segmentation mask).

[0159] like Figure 14 The diagram shown is a simulation of the target detection results of COCO2017. It can be seen that the method of this application improves the average accuracy by 3.4% compared with the original DINO method, while other indicators have also been significantly improved, which verifies the effectiveness of this application and has great significance and value for target detection applications and tasks.

[0160] The target detection method proposed in this application obtains a first feature layer from the detection image through a backbone network model, and enhances the first feature layer using a second transformation network to obtain a second feature layer. Simultaneously, the loss results of the first and second feature layers are calculated to update the training backbone network model and the second transformation network. Multiple detection feature units are then concatenated and linearly processed to obtain multiple candidate positions. A target position with high positional relevance is selected from these candidate positions using an evaluation metric corresponding to each candidate position. Next, the target position, initial position bias vector, and the flattened second feature layer are input into a first transformation network for feature recognition to obtain output feature data. Finally, the output feature data is input into a first feedforward neural network and a second feedforward neural network to obtain the target detection result and classification result of the detection image regarding the target position. In the image target recognition process, this application embodiment uses evaluation metrics to describe the spatial location information of the feature positions among multiple candidate targets, thereby selecting target positions with high positional correlation from multiple candidate positions. This takes into account the spatial distribution information of each candidate position to obtain more accurate target positions. Furthermore, the backbone network model and the second transformation network are trained using the first loss result and the second loss result, so that the backbone network model and the second transformation network can understand the image information of the detection breakthrough from a global perspective, thereby effectively improving the accuracy of target recognition in the detection image.

[0161] This application also provides a target detection device that can implement the above-described target detection method, see reference. Figure 14 The device 1500 includes:

[0162] The feature acquisition module 1510 is used to acquire multiple detection feature units of the detection image and perform a first prediction process on the multiple detection feature units to obtain the prediction probability sequence and feature position sequence of each detection feature unit.

[0163] The candidate selection module 1520 is used to select multiple candidate positions based on the predicted probability sequence and the feature position sequence;

[0164] The evaluation acquisition module 1530 is used to acquire the evaluation index corresponding to each candidate position and select the target position from the candidate positions based on the evaluation index; the evaluation index is used to indicate the spatial position information between the candidate position and other candidate positions.

[0165] The result processing module 1540 is used to input the target location and detection feature unit into the first transformation network for target recognition, and obtain the target detection result and classification recognition result of the detection image.

[0166] The specific implementation of the target detection device in this embodiment is basically the same as the specific implementation of the target detection method described above, and will not be repeated here.

[0167] This application also provides an electronic device, including:

[0168] At least one memory;

[0169] At least one processor;

[0170] At least one program;

[0171] The program is stored in a memory, and the processor executes the at least one program to implement the target detection method described above in this application. The electronic device can be any smart terminal, including mobile phones, tablets, personal digital assistants (PDAs), in-vehicle computers, etc.

[0172] Please see Figure 16 , Figure 16 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes:

[0173] The processor 1601 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application.

[0174] The memory 1602 can be implemented in the form of ROM (Read-Only Memory), static storage device, dynamic storage device, or RAM (Random Access Memory). The memory 1602 can store the operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 1602 and is called and executed by the processor 1601 using the target detection method of the embodiments of this application.

[0175] The input / output interface 1603 is used to implement information input and output;

[0176] The communication interface 1604 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).

[0177] Bus 1605 transmits information between various components of the device (e.g., processor 1601, memory 1602, input / output interface 1603, and communication interface 1604);

[0178] The processor 1601, memory 1602, input / output interface 1603 and communication interface 1604 are connected to each other within the device via bus 1605.

[0179] This application embodiment also provides a storage medium, which is a computer-readable storage medium, storing a computer program that, when executed by a processor, implements the above-described target detection method.

[0180] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0181] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.

[0182] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.

[0183] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0184] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.

[0185] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0186] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

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

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

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

[0190] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0191] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.

Claims

1. A target detection method, characterized in that, include: Multiple detection feature units of the detected image are obtained, and the multiple detection feature units are subjected to a first prediction process to obtain the prediction probability sequence and feature position sequence of each detection feature unit; Multiple candidate locations are selected based on the predicted probability sequence and the feature location sequence; The evaluation index corresponding to each candidate location is obtained, and the target location is selected from the candidate locations based on the evaluation index; the evaluation index is used to indicate the spatial location information between the candidate location and other candidate locations. The target location and the detection feature unit are input into the first transformation network for target recognition, thereby obtaining the target detection result and classification recognition result of the detected image; The step of obtaining the evaluation index corresponding to each candidate position includes: Obtain the feature distance between each candidate location and the other candidate locations; Based on the feature distance, calculate the standard deviation and mean distance between each candidate location and other candidate locations; The discrete coefficient of variation vector for each candidate location is obtained based on the ratio of the distance standard deviation to the distance mean. The evaluation index corresponding to each candidate position is calculated based on the discrete coefficient of variation vector.

2. The target detection method according to claim 1, characterized in that, The multiple detection feature units for acquiring the detection image include: The detected image is input into the backbone network model for feature extraction to obtain multiple first feature layers; After the first feature layer is flattened, it is input into the second transformation network to obtain the corresponding second feature layer of the detected image. The second feature layer includes multiple detection feature units.

3. The target detection method according to claim 2, characterized in that, The first prediction process, which involves performing a first prediction on multiple detection feature units to obtain a predicted probability sequence and a feature position sequence for each detection feature unit, includes: The second feature layer after flattening is dimensionally concatenated to obtain the concatenated data of the detection feature unit; The concatenated data is linearly processed to obtain the predicted probability and feature position corresponding to each feature type of the detection feature unit. The predicted probability sequence is obtained based on the predicted probability, and the feature position sequence is obtained based on the feature position.

4. The target detection method according to claim 3, characterized in that, The selection of multiple candidate locations based on the predicted probability sequence and the feature location sequence includes: The largest predicted probability in the predicted probability sequence is selected as the maximum classification probability value of the detection feature unit. Obtain the sorting result of the maximum classification probability value, and select a preset number of detection feature units as candidate feature units based on the sorting result; The feature position corresponding to the highest predicted probability among the candidate feature units is obtained as the candidate position.

5. The target detection method according to claim 2, characterized in that, The step of inputting the target location and the detection feature unit into the first transform network for target recognition, and obtaining the target detection result and classification recognition result of the detection image, includes: An initial position bias vector is obtained, and the initial position bias vector, the target position, and the second feature layer are input into a first transformation network for feature recognition to obtain output feature data; The output feature data is input into a first feedforward neural network to perform target recognition and obtain the target detection result at the target location; The output feature data is input into a second feedforward neural network for classification and recognition to obtain the classification and recognition result of the target location.

6. The target detection method according to claim 2, characterized in that, The training process of the backbone network model includes: Obtain the first sample dataset, which includes multiple first detection samples and first detection labels; The first detected sample is input into the backbone network model for feature extraction to obtain the first sample feature layer; Global pooling and dimension concatenation are performed on the first sample feature layer, and the result is input into a linear layer to obtain the first detection and classification result of the first sample dataset; the first detection and classification result is used to characterize all target categories in the first sample feature layer. The first loss result of the first sample dataset is obtained based on multiple first detection classification results and the first detection label, and the backbone network model is updated based on the first loss result.

7. The target detection method according to claim 6, characterized in that, The training process of the second transform network includes: The first sample feature layer is input into the second transformation network for feature extraction to obtain a second sample feature layer with the same feature dimension as the first sample feature layer. Global pooling and dimension concatenation are performed on the second sample feature layer, and the result is input into a linear layer to obtain the second detection and classification result of the second sample dataset; the second detection and classification result is used to characterize all target categories in the second sample feature layer. The second loss result of the second sample dataset is obtained based on multiple second detection classification results and second detection labels, and the second transformation network is updated based on the second loss result.

8. An electronic device, characterized in that, The device includes a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the target detection method according to any one of claims 1 to 7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the target detection method as described in any one of claims 1 to 7.