Lightweight target detection method and device based on task interaction
Through a lightweight target detection method based on task interaction, the backbone network, neck network and task interaction lightweight structure are utilized to extract lightweight task feature data for target detection, which solves the problems of large model parameters and high computational complexity and achieves efficient target detection.
Patent Information
- Application Number
- CN202411587471.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-08
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2044-11-08
AI Technical Summary
Existing open source target detection models have large parameters and high computational complexity, which requires hardware devices to have larger video memory and faster computing speeds, increasing the actual application cost.
A lightweight target detection method based on task interaction is adopted. Through a lightweight target detection model composed of a backbone network, a neck network, a task interaction lightweight structure and a detection head, the task interaction lightweight structure is used to extract lightweight task feature data for target detection.
While reducing the number of model parameters, it maintains high target detection accuracy, reduces computational complexity and memory usage, improves model inference speed, and reduces hardware requirements and training costs.
Smart Images

Figure CN119723151B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a lightweight target detection method and device based on task interaction. Background Art
[0002] In related technologies, open-source object detection models often focus on improving detection accuracy. To this end, these models directly use the output of the feature pyramid or the upper-level features of the classification branch or localization branch as the input of the auxiliary branch. However, these features have a large number of channels and have not yet undergone deep processing, resulting in a large number of model parameters and an increased computational workload. Consequently, hardware devices require larger video memory to store the model and faster computing speeds to perform inference, increasing actual application costs.
[0003] In summary, the technical problems existing in the relevant technologies need to be improved. Summary of the Invention
[0004] The embodiments of the present application aim to solve at least one of the technical problems in the related art to a certain extent. To this end, the main purpose of the embodiments of the present application is to propose a lightweight target detection method and device based on task interaction, which can reduce the number of model parameters while maintaining high target detection accuracy.
[0005] To achieve the above objectives, one aspect of an embodiment of the present application proposes a lightweight target detection method based on task interaction, which is applied to a lightweight target detection model. The lightweight target detection model consists of a backbone network, a neck network, a task interaction lightweight structure, and a detection head. The method includes the following steps:
[0006] Get image data;
[0007] Inputting the image data into the backbone network for feature extraction processing to obtain basic image feature data;
[0008] Inputting the basic feature data of the image into the neck network for feature fusion processing to obtain image fusion feature data;
[0009] Inputting the image fusion feature data into the task interaction lightweight structure for task interaction processing to obtain lightweight task feature data; wherein the lightweight task feature data includes classification task features and positioning task features;
[0010] The lightweight task feature data is input into the detection head for prediction to obtain a lightweight target detection result.
[0011] In some embodiments, the task interaction lightweight structure includes a task primary interaction layer, a task decoupling layer, and a task secondary interactor, and inputting the image fusion feature data into the task interaction lightweight structure for task interaction processing to obtain lightweight task feature data includes:
[0012] Inputting the image fusion feature data into the task interaction lightweight structure, performing feature extraction processing on the image fusion feature data through the task initial interaction layer in the task interaction lightweight structure to obtain task common feature data;
[0013] Inputting the task common feature data into the task decoupling layer for feature extraction processing to obtain task specific feature data;
[0014] The task-specific feature data is input into the task secondary interactor for task supervision processing, and the lightweight task feature data is output.
[0015] In some embodiments, the task decoupling layer includes a classification task decoupling layer and a positioning task decoupling layer, the task-specific feature data includes classification task-specific features and positioning task-specific features, and the task-common feature data is input into the task decoupling layer for feature extraction processing to obtain task-specific feature data, including:
[0016] Inputting the task common feature data into the classification task decoupling layer, performing feature extraction processing on the task common feature data through the classification task decoupling layer to obtain the classification task specific features;
[0017] The task common feature data is input into the positioning task decoupling layer, and the positioning task decoupling layer performs feature extraction processing on the task common feature data to obtain the positioning task specific feature.
[0018] In some embodiments, inputting the task-specific feature data into the task secondary interactor for task supervision processing and outputting the lightweight task feature data includes:
[0019] inputting the classification task-specific features in the task-specific feature data into the task secondary interactor;
[0020] Multiplying the task quadratic interactor by the classification task specific feature point by point to obtain a classification task supervision mask;
[0021] The classification task supervision mask and the classification task specific feature are subjected to matrix multiplication processing to obtain the classification task feature in the lightweight task feature data.
[0022] In some embodiments, inputting the task-specific feature data into the task secondary interactor for task supervision processing and outputting the lightweight task feature data includes:
[0023] inputting the positioning task specific feature in the task specific feature data into the task secondary interactor;
[0024] Multiplying the task secondary interactor and the positioning task specific feature point by point to obtain a positioning task supervision mask;
[0025] The positioning task supervision mask and the positioning task specific feature are subjected to matrix multiplication processing to obtain the positioning task feature in the lightweight task feature data.
[0026] In some embodiments, the lightweight target detection result includes a lightweight target classification prediction score and a lightweight target positioning prediction value. The detection head includes a classification task auxiliary branch, a classification task prediction branch, a positioning task auxiliary branch, and a positioning task prediction branch. The lightweight task feature data is input into the detection head for prediction to obtain a lightweight target detection result, including:
[0027] Inputting the classification task features in the lightweight task feature data into the classification task auxiliary branch in the detection head for prediction to obtain classification prediction confidence;
[0028] Inputting the classification task features in the lightweight task feature data into the classification task prediction branch in the detection head for prediction to obtain a classification prediction score;
[0029] Inputting the positioning task features in the lightweight task feature data into the positioning task auxiliary branch in the detection head for prediction to obtain positioning prediction coordinates;
[0030] Inputting the positioning task feature in the lightweight task feature data into the positioning task prediction branch in the detection head for prediction to obtain a positioning prediction bias;
[0031] Obtaining a target classification prediction score based on the classification prediction confidence and the classification prediction score;
[0032] Obtaining a target positioning prediction value based on the positioning prediction coordinates and the positioning prediction offset;
[0033] Performing non-maximum suppression processing on the target classification prediction score to obtain the lightweight target classification prediction score;
[0034] Non-maximum suppression processing is performed on the target positioning prediction value to obtain the lightweight target positioning prediction value.
[0035] In some embodiments, obtaining a target classification prediction score based on the classification prediction confidence and the classification prediction score includes:
[0036] The classification prediction confidence and the classification prediction score are multiplied to obtain the target classification prediction score.
[0037] To achieve the above objectives, another aspect of the present invention proposes a lightweight target detection device based on task interaction, which is applied to a lightweight target detection model. The lightweight target detection model consists of a backbone network, a neck network, a task interaction lightweight structure, and a detection head. The device includes the following modules:
[0038] An image data acquisition module, used for acquiring image data;
[0039] An image feature extraction module is used to input the image data into the backbone network for feature extraction processing to obtain basic image feature data;
[0040] An image feature fusion module, configured to input the basic image feature data into the neck network for feature fusion processing to obtain image fusion feature data;
[0041] A task interaction module, configured to input the image fusion feature data into the task interaction lightweight structure for task interaction processing to obtain lightweight task feature data; wherein the lightweight task feature data includes classification task features and positioning task features;
[0042] The lightweight target detection module is used to input the lightweight task feature data into the detection head for prediction to obtain a lightweight target detection result.
[0043] To achieve the above-mentioned purpose, another aspect of an embodiment of the present application provides an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the above-mentioned method when executing the computer program.
[0044] To achieve the above objectives, another aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described above is implemented.
[0045] The embodiments of the present application include at least the following beneficial effects: The present application provides a lightweight target detection method and device based on task interaction, which is applied to a lightweight target detection model. The lightweight target detection model consists of a backbone network, a neck network, a task interaction lightweight structure and a detection head. The scheme obtains image data; inputs the image data into the backbone network for feature extraction processing to obtain basic image feature data; inputs the basic image feature data into the neck network for feature fusion processing to obtain image fusion feature data; inputs the image fusion feature data into the task interaction lightweight structure for task interaction processing to obtain lightweight task feature data; wherein, the lightweight task feature data includes classification task features and positioning task features; inputs the lightweight task feature data into the detection head for prediction to obtain lightweight target detection results. The embodiment of the present application uses the lightweight task feature data with common characteristics of two tasks obtained by using the task interaction lightweight structure as the input feature of the detection head, so that the overall parameter amount of the lightweight target detection model is greatly reduced, the computational complexity and memory usage are reduced, the inference speed of the model is improved, the hardware requirements for model deployment are reduced, and the training cost of the model is reduced to a certain extent. At the same time, the detection head uses the highly adaptable lightweight task feature data for prediction, while reducing the amount of model parameters, it can still maintain a high target detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 This is a flowchart of the steps of a lightweight target detection method based on task interaction provided by an embodiment of the present application;
[0047] Figure 2 This is a flow chart of a lightweight target detection method based on task interaction provided by an embodiment of the present application;
[0048] Figure 3 This is an algorithm flow chart of a lightweight target detection method based on task interaction provided in an embodiment of the present application;
[0049] Figure 4 Schematic diagram of the structure of a lightweight target detection device based on task interaction provided in an embodiment of the present application;
[0050] Figure 5 This is a schematic diagram of the hardware structure of the electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present application. They are merely examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the appended claims.
[0052] It will be understood that the terms "first", "second", etc. used in this application may be used herein to describe various concepts, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of the embodiments of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0053] The terms "at least one", "plurality", "each", "any", etc. used in this application include "at least one", "two" or more, "plurality" or "each", "any" or "any one", "each" or "any one" as used herein.
[0054] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.
[0055] In related technologies, open-source object detection models often focus on improving detection accuracy. To this end, these models directly use the output of the feature pyramid or the upper-level features of the classification branch or localization branch as the input of the auxiliary branch. However, these features have a large number of channels and have not yet undergone deep processing, resulting in a large number of model parameters and an increased computational workload. Consequently, hardware devices require larger video memory to store the model and faster computing speeds to perform inference, increasing actual application costs.
[0056] In view of this, the embodiments of the present application provide a lightweight target detection method and device based on task interaction, which are applied to a lightweight target detection model. The lightweight target detection model consists of a backbone network, a neck network, a task interaction lightweight structure and a detection head. The scheme obtains image data; inputs the image data into the backbone network for feature extraction processing to obtain basic image feature data; inputs the basic image feature data into the neck network for feature fusion processing to obtain image fusion feature data; inputs the image fusion feature data into the task interaction lightweight structure for task interaction processing to obtain lightweight task feature data; wherein, the lightweight task feature data includes classification task features and positioning task features; inputs the lightweight task feature data into the detection head for prediction to obtain lightweight target detection results. The embodiment of the present application uses the lightweight task feature data with common characteristics of two tasks obtained by using the task interaction lightweight structure as the input feature of the detection head, so that the overall parameter amount of the lightweight target detection model is greatly reduced, the computational complexity and memory usage are reduced, the inference speed of the model is improved, the hardware requirements for model deployment are reduced, and the training cost of the model is reduced to a certain extent. At the same time, the detection head uses the highly adaptable lightweight task feature data for prediction, while reducing the amount of model parameters, it can still maintain a high target detection accuracy.
[0057] The lightweight target detection method based on task interaction provided in the embodiments of the present application relates to the field of data processing technology. The lightweight target detection method based on task interaction provided in the embodiments of the present application can be applied to a terminal or a server, or can be software running on the terminal or server. In some embodiments, the terminal can be a smartphone, tablet computer, laptop computer, desktop computer, smart speaker, smart watch, or in-vehicle terminal, etc., but is not limited to these. The server can be configured as an independent physical server, or as a server cluster or distributed system consisting of multiple physical servers. It can also be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. The server can also be a node server in a blockchain network. The software can be an application that implements the lightweight target detection method based on task interaction, etc., but is not limited to the above forms.
[0058] The present application can be used in numerous general or special computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs (Personal Computers, personal computers), minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present 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. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0059] See also Figure 1 , Figure 1 This is an optional step flow chart of the lightweight target detection method based on task interaction provided by the embodiment of the present application, which is applied to the lightweight target detection model. The lightweight target detection model consists of a backbone network, a neck network, a task interaction lightweight structure and a detection head. Figure 1 The method may include but is not limited to steps S101 to S105.
[0060] Step S101, acquiring image data;
[0061] Optionally, the lightweight target detection model is a model used in an embodiment of the present application to detect image data to obtain lightweight target detection results. The lightweight target detection model consists of a backbone network, a neck network, a task interaction lightweight structure and a detection head.
[0062] Step S102: inputting the image data into the backbone network for feature extraction to obtain basic image feature data;
[0063] Among them, the basic image feature data is the basic features that are valuable for subsequent tasks (such as classification, positioning, etc.) extracted from the original image through the backbone network. It may include but is not limited to low-level information such as the edges, textures, and shapes of objects in the image, as well as more advanced semantic information (such as the parts of the object, the overall structure, etc.).
[0064] It should be noted that the backbone network used in the embodiment of the present application is ResNet50. The embodiment of the present application does not limit the selection of the backbone network. Those skilled in the art can choose other backbone networks according to actual application conditions, such as convolutional neural network architectures such as VGG and MobileNet, but they need to adjust the parameter settings of the task interaction lightweight structure accordingly to adapt to different backbone networks.
[0065] Step S103, inputting the basic image feature data into the neck network for feature fusion processing to obtain image fusion feature data;
[0066] Optionally, after obtaining the basic feature data of the image, the basic features from the backbone network are fused and enhanced through the neck network to generate a more robust and discriminative feature representation. The neck network outputs the fused image feature data, which contains richer and more comprehensive image information, providing data support for subsequent classification, positioning and other tasks.
[0067] It should be noted that the neck network of the embodiment of the present application adopts a 5-layer FPN (Feature Pyramid Network). The embodiment of the present application does not limit the selection of the neck network. Those skilled in the art can choose other neck networks according to actual application conditions, such as PAN (Pyramid Attention Network), BiFPN (Bidirectional Feature Pyramid Network), etc., but it is also necessary to adjust the parameter settings of the task interaction lightweight structure accordingly to adapt to different neck networks.
[0068] Step S104: inputting the image fusion feature data into the task interaction lightweight structure for task interaction processing to obtain lightweight task feature data; wherein the lightweight task feature data includes classification task features and positioning task features;
[0069] Optionally, the task interaction lightweight structure includes a task primary interaction layer, a task decoupling layer, and a task secondary interactor. Among them, the task primary interaction layer is used to extract general task common features; the task decoupling layer is used to further extract the task common features to obtain task-specific features for classification or positioning; the task secondary interactor performs inter-task supervision on the task-specific features of classification or positioning to enhance the complementarity and consistency of classification features and positioning features, and the task adaptability of features can be enhanced through inter-task supervision. It is worth mentioning that each module in the task interaction lightweight structure of the embodiment of the present application uses a smaller number of parameters, which greatly reduces the computational cost while retaining key information.
[0070] The task-specific feature data includes classification task-specific features and positioning task-specific features, and the task decoupling layer includes a classification task decoupling layer and a positioning task decoupling layer. The classification task decoupling layer is used to obtain classification task-specific features, while the positioning task decoupling layer is used to obtain positioning task-specific features.
[0071] It should be noted that in the lightweight structure of task interaction, the initial task interaction layer can also adopt other structures such as pyramid convolution, as long as it can effectively extract the common features of the task; in addition to the layer attention mechanism, the task decoupling layer can also use channel attention, spatial attention and other mechanisms to adjust the feature weights; the task secondary interactor can be simplified to a scalar weight, using the same supervision strength for all channels.
[0072] In some embodiments, step S104 may include: inputting the image fusion feature data into the task interaction lightweight structure, performing feature extraction processing on the image fusion feature data through the task primary interaction layer in the task interaction lightweight structure to obtain task common feature data; inputting the task common feature data into the task decoupling layer for feature extraction processing to obtain task specific feature data; inputting the task specific feature data into the task secondary interactor for task supervision processing, and outputting lightweight task feature data.
[0073] In some specific embodiments, inputting the task common feature data into the task decoupling layer for feature extraction processing to obtain task-specific feature data can include: inputting the task common feature data into the classification task decoupling layer, performing feature extraction processing on the task common feature data through the classification task decoupling layer to obtain classification task-specific features; inputting the task common feature data into the positioning task decoupling layer, performing feature extraction processing on the task common feature data through the positioning task decoupling layer to obtain positioning task-specific features.
[0074] In some specific embodiments, the task-specific feature data is input into the task secondary interactor for task supervision processing, and the lightweight task feature data is output, which may include: inputting the classification task-specific features in the task-specific feature data into the task secondary interactor; performing point-by-point multiplication processing on the task secondary interactor and the classification task-specific features to obtain a classification task supervision mask; performing matrix multiplication processing on the classification task supervision mask and the classification task-specific features to obtain the classification task features in the lightweight task feature data.
[0075] In some specific embodiments, the task-specific feature data is input into the task secondary interactor for task supervision processing, and the lightweight task feature data is output, which may include: inputting the positioning task-specific feature in the task-specific feature data into the task secondary interactor; performing point-by-point multiplication processing on the task secondary interactor and the positioning task-specific feature to obtain a positioning task supervision mask; performing matrix multiplication processing on the positioning task supervision mask and the positioning task-specific feature to obtain the positioning task feature in the lightweight task feature data.
[0076] In the specific implementation, the image fusion feature data is input into the task interaction lightweight structure for task interaction processing to obtain the lightweight task feature data. The process is as follows: input the image fusion feature data into the task interaction lightweight structure, perform feature extraction processing on the image fusion feature data through the task initial interaction layer in the task interaction lightweight structure, and obtain task common feature data; input the task common feature data into the classification task decoupling layer, perform feature extraction processing on the task common feature data through the classification task decoupling layer, and obtain classification task specific features; input the task common feature data into the positioning task decoupling layer, perform feature extraction processing on the task common feature data through the positioning task decoupling layer, and obtain positioning task specific features. Features; input the classification task-specific features in the task-specific feature data into the task secondary interactor; perform point-by-point multiplication of the task secondary interactor and the classification task-specific features to obtain the classification task supervision mask; perform matrix multiplication of the classification task supervision mask and the classification task-specific features to obtain the classification task features in the lightweight task feature data; input the positioning task-specific features in the task-specific feature data into the task secondary interactor; perform point-by-point multiplication of the task secondary interactor and the positioning task-specific features to obtain the positioning task supervision mask; perform matrix multiplication of the positioning task supervision mask and the positioning task-specific features to obtain the positioning task features in the lightweight task feature data.
[0077] Step S105 : inputting the lightweight task feature data into the detection head for prediction to obtain a lightweight target detection result.
[0078] Optionally, the lightweight target detection result includes a lightweight target classification prediction score and a lightweight target positioning prediction value.
[0079] The detection head includes a classification task auxiliary branch, a classification task prediction branch, a localization task auxiliary branch, and a localization task prediction branch. Optionally, the auxiliary branch uses the highly adaptable lightweight features output by the task interaction lightweight structure for prediction, significantly reducing the number of model parameters.
[0080] In some embodiments, step S105 may include: inputting the classification task features in the lightweight task feature data into the classification task auxiliary branch in the detection head for prediction to obtain the classification prediction confidence; inputting the classification task features in the lightweight task feature data into the classification task prediction branch in the detection head for prediction to obtain the classification prediction score; inputting the positioning task features in the lightweight task feature data into the positioning task auxiliary branch in the detection head for prediction to obtain the positioning prediction coordinates; inputting the positioning task features in the lightweight task feature data into the positioning task prediction branch in the detection head for prediction to obtain the positioning prediction bias; based on the classification prediction confidence and the classification prediction score, obtaining the target classification prediction score; based on the positioning prediction coordinates and the positioning prediction bias, obtaining the target positioning prediction value; performing non-maximum suppression processing on the target classification prediction score to obtain a lightweight target classification prediction score; performing non-maximum suppression processing on the target positioning prediction value to obtain a lightweight target positioning prediction value.
[0081] In some specific embodiments, obtaining a target classification prediction score based on the classification prediction confidence and the classification prediction score may include: multiplying the classification prediction confidence and the classification prediction score to obtain the target classification prediction score.
[0082] The target positioning prediction value is obtained by adding the positioning prediction bias and the positioning prediction coordinates. It should be noted that, in order to obtain the target positioning prediction value, the positioning prediction bias can also be used to perform deformable convolution sampling on the positioning prediction coordinates to generate more accurate target positioning coordinates, that is, the target positioning prediction value. The embodiment of the present application mainly uses the positioning prediction value obtained by adding the positioning prediction bias and the positioning prediction coordinates as an example to illustrate the target positioning prediction value.
[0083] In the steps S101 to S105 shown in the embodiment of the present application, image data is obtained; the image data is input into the backbone network for feature extraction processing to obtain basic image feature data; the basic image feature data is input into the neck network for feature fusion processing to obtain image fusion feature data; the image fusion feature data is input into the task interaction lightweight structure for task interaction processing to obtain lightweight task feature data; wherein the lightweight task feature data includes classification task features and positioning task features; the lightweight task feature data is input into the detection head for prediction to obtain lightweight target detection results. In the embodiment of the present application, the lightweight task feature data with two tasks in common obtained by the task interaction lightweight structure is used as the input feature of the detection head, so that the overall number of parameters of the lightweight target detection model is greatly reduced, the computational complexity and memory usage are reduced, the inference speed of the model is improved, the hardware requirements for model deployment are reduced, and the training cost of the model is reduced to a certain extent. At the same time, the detection head uses the highly adaptable lightweight task feature data for prediction, which can reduce the number of model parameters while still maintaining a high target detection accuracy.
[0084] In order to explain the principle of the technical solution of the present invention in detail, the overall process of the present invention is described below in combination with some specific embodiments. It is easy to understand that the following is an explanation of the technical principle of the present invention and cannot be regarded as a limitation of the present invention.
[0085] In an embodiment of the present application, in order to solve the problem that the target detection model in the related art is difficult to balance detection accuracy and model inference overhead, an embodiment of the present application proposes a lightweight target detection method based on task interaction, so that a higher accuracy rate can be obtained with fewer parameters. Among them, the task interaction lightweight structure is the core part of the embodiment of the present application. The task interaction lightweight structure can be understood as simulating the functional division and interaction of different ganglion cells in the retina. The task interaction lightweight structure contains a task primary interaction layer, a task decoupling layer, and a task secondary interactor. The detection head can generate the final target classification prediction and target positioning prediction based on the features processed by the neck network and the task interaction lightweight structure.
[0086] See also Figure 2 , Figure 2 is a flow chart of a lightweight target detection method based on task interaction provided in an embodiment of the present application; Figure 2As shown, the overall process steps of the lightweight target detection method based on task interaction provided by the embodiment of the present application are: first, the image data is input into the backbone network for feature extraction processing to obtain basic image feature data; then, the basic image feature data obtained by the backbone network is input into the neck network for feature fusion processing to obtain image fusion feature data; then, the image fusion feature data obtained by the neck network is input into the task interaction lightweight structure for task interaction processing to obtain lightweight task feature data, wherein the lightweight task feature data includes classification task features and positioning task features; further, the lightweight task feature data obtained by the task interaction lightweight structure is input into the detection head for prediction to obtain a target prediction result, wherein the target prediction result includes a target classification prediction score and a target positioning prediction value; finally, the target prediction result is subjected to non-maximum suppression processing to obtain a lightweight target detection result, wherein the lightweight target detection result includes a lightweight target classification prediction score and a lightweight target positioning prediction value.
[0087] In the embodiment of the present application, ResNet50 is used as the backbone network and a 5-layer FPN is used as the neck network. On this basis, a task interaction lightweight structure and detection head are designed. Specifically, the specific implementation process of the lightweight target detection method based on task interaction provided in the embodiment of the present application includes the following steps 1 to 5:
[0088] Step 1: Input the original image into the backbone network for feature extraction and processing to obtain the basic feature data of the image.
[0089] In the specific implementation, the original image is input into ResNet50 (backbone network), and ResNet50 extracts the basic features of the original image.
[0090] ResNet50 consists of five stages, each composed of multiple residual blocks. The output features of the first stage are denoted as C1, with a feature size of 1 / 4 the input image size; the output features of the second stage are denoted as C2, with a feature size of 1 / 8 the input image size; the output features of the third stage are denoted as C3, with a feature size of 1 / 16 the input image size; the output features of the fourth stage are denoted as C4, with a feature size of 1 / 32 the input image size; and the output features of the fifth stage are denoted as C5, with a feature size of 1 / 32 the input image size. It is easy to understand that C2 is derived from feature extraction based on the output of C1, C3 is derived from feature extraction based on the output of C2, C4 is derived from feature extraction based on the output of C3, and C5 is derived from feature extraction based on the output of C4.
[0091] Exemplarily, in step 1, the basic image feature data obtained by the backbone network performing feature extraction processing on the original image are C1 to C5 (the above-mentioned “basic image feature data”).
[0092] Step 2: Input the basic feature data of the image obtained by the backbone network into the neck network for feature fusion processing to obtain image fusion feature data.
[0093] Among them, the basic feature data of the image obtained in step 1 are C1 to C5. From the basic features C2 to C5, the features gradually become more abstract and semantic, which is more helpful for target detection. The features of the basic feature C1 may be too specific and not conducive to detecting larger objects or complex scenes. Therefore, there is no need to input C1 as a feature into the neck network.
[0094] In the implementation, the basic features C2 to C5 obtained in step 1 are used as input to the FPN (Front Pulse Network). Specifically, the FPN fuses multi-scale features from top to bottom, maintaining the same number of channels across each layer through upsampling and 1x1 convolution. Ultimately, the resulting features are P2, P3, P4, P5, and P6 at five scales. The feature sizes of P2, P3, and P4 are 1 / 4, 1 / 8, and 1 / 16 of the input image, respectively. The feature sizes of P5 and P6 are both 1 / 32 of the input image.
[0095] Optionally, features P2 to P6 obtained in step 2 are input to the interactive lightweight structure of subsequent tasks, namely, feature X1 (the above-mentioned "image fusion feature data").
[0096] Step 3: Input the image fusion feature data obtained by the neck network into the task interaction lightweight structure for task interaction processing to obtain lightweight task feature data;
[0097] In the specific implementation, after the original image passes through the feature processing of the backbone network and the neck network, the feature X1 can be obtained as the input of the task interaction lightweight structure, see Figure 3 , Figure 3 This is an algorithm flow chart of a lightweight target detection method based on task interaction provided by an embodiment of the present application, such as Figure 3 As shown, the feature X1 output by the neck network is input into the task interaction lightweight structure for processing, and the classification task feature X5cls and the positioning task feature X5loc can be obtained.
[0098] It's worth noting that object detection models in related technologies lack a primary interaction layer. These technologies typically directly input features from the neck output into the classification and localization branches. Therefore, the primary interaction layer introduced in this embodiment enhances the depth of information extraction from the input features of both branches.
[0099] Specifically, assuming that the features P2 to P6 obtained in step 2 are processed using the task interaction lightweight structure, this embodiment takes feature P3 as an example. First, feature P3 is used as feature X1 output by the neck network, such as Figure 3 As shown, the feature X1 is then input into the task interaction lightweight structure, as Figure 3 As shown in the figure, the task interaction lightweight structure includes the task initial interaction layer, the task decoupling layer (including the classification task decoupling layer and the positioning task decoupling layer), and the task secondary interactor. The processing flow of the task interaction lightweight structure is as follows:
[0100] 1) First, the task common features of feature X1 are extracted through the task initial interaction layer. Since the task initial interaction layer contains 6 series-connected 3x3 convolutional layers and a residual connection, the feature X2 output by the task initial interaction layer ( Figure 3 The number of channels of the “first interaction feature X2” is 6 times that of feature X1. Feature X2 is the common feature of the task extracted from the first interaction layer.
[0101] 2) Then, feature X2 is input into the classification task decoupling layer and the localization task decoupling layer respectively to extract task-specific features. Specifically, the classification task decoupling layer and the localization task decoupling layer have the same structure, and both use the same number of input channels and output channels as feature X2. The convolutional channel attention mechanism adjusts the channel level of feature X2, and then Convolution reduces the number of channels to 1 / 6 of the original, and obtains the feature X3cls (i.e., the "classification task-specific feature" mentioned above) and the feature X3loc (i.e., the "localization task-specific feature" mentioned above). The shapes of the features X3cls and X3loc are both , where H is the height, W is the width, and C is the number of channels.
[0102] 3) Subsequently, the task secondary interactor (a learnable parameter with the same number of channels C as the features X3cls and X3loc, with a shape of 1x1xC) is point-wise multiplied with the features X3cls and X3loc, respectively, to obtain the classification task supervision mask X4cls and the localization task supervision mask X4loc (both with a shape of HxWx1). Next, the classification task supervision mask X4cls and the localization task supervision mask X4loc are matrix-multiplied with the features X3cls and X3loc, respectively, to obtain the classification task features X5cls and the localization task features X5loc after task commonality supervision. It should be noted that the processing of features at the remaining levels (P2, P4, P5, and P6) is similar to that of P3 and is not further described in this embodiment of the present application.
[0103] In a specific implementation, the classification task features X5cls and positioning task features X5loc obtained through the task interaction lightweight structure processing of the embodiment of the present application have high task adaptability and can not only be directly used for task prediction, but also serve as input for the auxiliary branch. In the embodiment of the present application, the number of channels of the classification task features X5cls and the positioning task features X5loc is smaller than the number of channels of the input features corresponding to the auxiliary branch of the relevant detection model, which enables the auxiliary branch to process predictions with fewer parameters.
[0104] Step 4: Input the lightweight task feature data obtained by the task interaction lightweight structure into the detection head for prediction to obtain the target prediction result, where the target prediction result includes the target classification prediction score and the target positioning prediction value;
[0105] Among them, the detection head includes four branches: classification task auxiliary branch, classification task prediction branch, positioning task auxiliary branch, and positioning task prediction branch.
[0106] In the specific implementation, the classification task feature X5cls of each level is input into the classification task auxiliary branch for prediction, and the shape is obtained. The confidence of the classification prediction ( Figure 3 At the same time, the classification task feature X5cls of each level is input into the classification task prediction branch for prediction, and the shape is obtained. The classification prediction score of Figure 3 In the example, the classification prediction score is expressed as "class prediction score", where K is the number of categories. After obtaining the classification prediction confidence and classification prediction score, the classification prediction confidence and classification prediction score are respectively applied with the Sigmoid function, and then multiplied and squared to obtain the final classification prediction score (i.e., the "target classification prediction score" mentioned above). This process is the classification score correction process. Similarly, the positioning task feature X5loc of each level is input into the positioning task auxiliary branch to obtain the shape of The positioning prediction bias (i.e. the above-mentioned "positioning prediction bias") is the bias in the vertical and horizontal directions predicted for the four points of the positioning frame. At the same time, the positioning task feature X5loc of each level is input into the positioning task prediction branch to obtain The positioning prediction coordinates represent the vertical and horizontal coordinates of the four points. After obtaining the positioning prediction bias and positioning prediction coordinates, the positioning prediction bias and positioning prediction coordinates are added together to obtain the final positioning prediction value (i.e., the "target positioning prediction value" mentioned above). This process is the positioning coordinate correction process.
[0107] Step 5: Perform non-maximum suppression processing on the target prediction result obtained in step 4 to obtain a lightweight target detection result, wherein the lightweight target detection result includes a lightweight target classification prediction score and a lightweight target positioning prediction value.
[0108] In a specific implementation, non-maximum suppression processing is performed on the target classification prediction score and target positioning prediction value obtained in step 4, respectively, to obtain the category (i.e., "lightweight target classification prediction score") and position (i.e., "lightweight target positioning prediction value") of the target in the image. It should be noted that for the specific implementation principle of non-maximum suppression processing, those skilled in the art can refer to the technical content in the relevant technology for practical application, and the embodiments of this application will not be elaborated here.
[0109] In the embodiment of the present application, the backbone network (ResNet50) is used to extract basic image features, and the neck network (FPN) is used to fuse multi-scale feature information; the task interaction lightweight structure is used to extract common and task-specific features, and enhance the task adaptability of the features through inter-task supervision; the auxiliary branch of the detection head uses these highly adaptable lightweight features for prediction, while reducing the number of model parameters and still maintaining a high target detection accuracy.
[0110] It should be pointed out that this embodiment only provides a brief schematic illustration of the general process of the lightweight target detection method based on task interaction. The detailed description of each step can refer to the relevant content in the aforementioned embodiment and will not be repeated here. It can be understood that the present invention is not limited to this.
[0111] The embodiments of the present application provide a lightweight target detection method and device based on task interaction, which are applied to a lightweight target detection model. The lightweight target detection model consists of a backbone network, a neck network, a task interaction lightweight structure and a detection head. The scheme obtains image data; inputs the image data into the backbone network for feature extraction processing to obtain basic image feature data; inputs the basic image feature data into the neck network for feature fusion processing to obtain image fusion feature data; inputs the image fusion feature data into the task interaction lightweight structure for task interaction processing to obtain lightweight task feature data; wherein the lightweight task feature data includes classification task features and positioning task features; and inputs the lightweight task feature data into the detection head for prediction to obtain a lightweight target detection result. The embodiment of the present application uses the lightweight task feature data with common characteristics of two tasks obtained by using the task interaction lightweight structure as the input feature of the detection head, so that the overall parameter amount of the lightweight target detection model is greatly reduced, the computational complexity and memory usage are reduced, the inference speed of the model is improved, the hardware requirements for model deployment are reduced, and the training cost of the model is reduced to a certain extent. At the same time, the detection head uses the highly adaptable lightweight task feature data for prediction, while reducing the amount of model parameters, it can still maintain a high target detection accuracy.
[0112] In summary, the embodiments of the present application aim to resolve the contradiction between model accuracy and computing resource overhead by constructing a more efficient network structure, moderately reducing the accuracy within an acceptable range in exchange for fewer parameters and fewer operations, thereby effectively reducing the cost of using the target detection model. Specifically, the embodiments of the present application adopt a task interaction lightweight structure to make the features output by the neck network more suitable for the prediction of classification tasks and positioning tasks, while reducing the number of parameters of the auxiliary branch, which is of great significance for engineering applications in resource-constrained scenarios. The embodiments of the present application use the features common to the two tasks output by the task interaction structure as the input features of the auxiliary branch, which greatly reduces the overall number of parameters of the model, improves the reasoning speed of the model, reduces the hardware requirements for model deployment, and thus reduces the training cost of the model.
[0113] The application scenarios of the embodiments of the present application may include at least one of the following:
[0114] (1) In intelligent transportation systems, the model's lightweight nature enables it to run efficiently on resource-constrained roadside equipment, enabling real-time vehicle detection and positioning. Due to the significant reduction in parameters, the model can quickly process video streams from multiple cameras, accurately identifying and tracking vehicles while reducing hardware costs and energy consumption. This not only improves the efficiency of traffic monitoring but also provides more reliable and timely data support for intelligent traffic management systems.
[0115] (2) In terms of industrial quality control, the model's efficient reasoning capabilities enable its application to real-time defect detection on high-speed production lines. The lightweight structure means that the model can be deployed at multiple inspection points on the production line without significantly increasing the complexity and cost of the overall system. This enables manufacturers to achieve more comprehensive and precise quality control, detect and address product defects in a timely manner, and thus significantly improve product quality and production efficiency.
[0116] See also Figure 4 The embodiment of the present application further provides a task-interaction-based lightweight target detection device 400, which can implement the above-mentioned task-interaction-based lightweight target detection method and be applied to a lightweight target detection model. The lightweight target detection model is composed of a backbone network, a neck network, a task-interaction lightweight structure, and a detection head. The device includes the following modules:
[0117] Image data acquisition module 401, used to acquire image data;
[0118] An image feature extraction module 402 is configured to input the image data into the backbone network for feature extraction processing to obtain basic image feature data;
[0119] An image feature fusion module 403 is configured to input the basic image feature data into the neck network for feature fusion processing to obtain image fusion feature data;
[0120] The task interaction module 404 is configured to input the image fusion feature data into the task interaction lightweight structure for task interaction processing to obtain lightweight task feature data; wherein the lightweight task feature data includes classification task features and positioning task features;
[0121] The lightweight target detection module 405 is configured to input the lightweight task feature data into the detection head for prediction to obtain a lightweight target detection result.
[0122] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0123] The present application also provides an electronic device comprising a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the aforementioned lightweight target detection method based on task interaction. The electronic device can be any intelligent terminal, including a tablet computer and an in-vehicle computer.
[0124] It can be understood that the contents of the above method embodiments are applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0125] See also Figure 5 , Figure 5 The hardware structure of an electronic device according to another embodiment is shown. The electronic device includes:
[0126] The processor 501 may be implemented as a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is configured to execute relevant programs to implement the technical solutions provided in the embodiments of the present application.
[0127] The memory 502 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 502 can store an 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 502 and is called by the processor 501 to execute the lightweight target detection method based on task interaction in the embodiments of this application.
[0128] Input / output interface 503, used to implement information input and output;
[0129] Communication interface 504, used to implement communication interaction between this device and other devices, which can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WiFi, Bluetooth, etc.);
[0130] Bus 505 , which transmits information between various components of the device (e.g., processor 501 , memory 502 , input / output interface 503 , and communication interface 504 );
[0131] The processor 501 , the memory 502 , the input / output interface 503 and the communication interface 504 are connected to each other in communication within the device via a bus 505 .
[0132] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the above-mentioned lightweight target detection method based on task interaction.
[0133] It can be understood that the contents of the above method embodiments are all applicable to the present storage medium embodiment, the functions specifically implemented by the present storage medium embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0134] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0135] The embodiment of the present application provides a lightweight target detection method based on task interaction and a lightweight target detection device based on task interaction, which obtains image data; inputs the image data into the backbone network for feature extraction processing to obtain basic image feature data; inputs the basic image feature data into the neck network for feature fusion processing to obtain image fusion feature data; inputs the image fusion feature data into the task interaction lightweight structure for task interaction processing to obtain lightweight task feature data; wherein the lightweight task feature data includes classification task features and positioning task features; and inputs the lightweight task feature data into the detection head for prediction to obtain lightweight target detection results. The embodiment of the present application uses the lightweight task feature data with two tasks common to the task obtained by the task interaction lightweight structure as the input feature of the detection head, so that the overall number of parameters of the lightweight target detection model is greatly reduced, the computational complexity and memory usage are reduced, the inference speed of the model is improved, the hardware requirements for model deployment are reduced, and the training cost of the model is reduced to a certain extent. At the same time, the detection head uses the highly adaptable lightweight task feature data for prediction, which can reduce the number of model parameters while still maintaining a high target detection accuracy.
[0136] The embodiments described in the embodiments of this application are intended to more clearly illustrate 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. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0137] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0138] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, i.e., they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.
[0139] Those skilled in the art will appreciate that all or some of the steps in the methods, systems, and functional modules / units in the devices disclosed above may be implemented as software, firmware, hardware, or appropriate combinations thereof.
[0140] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0141] It should be understood that in this application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0142] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the above-mentioned units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0143] The units described above as separate components may or may not be physically separate, and 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 these units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0144] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0145] If the integrated unit is implemented in the form of 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 the present application, 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, which is stored in a storage medium and includes multiple instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: various media that can store programs, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0146] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but are not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and essence of the present invention should be within the scope of the present invention.
Claims
1. A lightweight target detection method based on task interaction, characterized by: Applied to a lightweight target detection model, the lightweight target detection model consists of a backbone network, a neck network, a task interaction lightweight structure and a detection head. The method includes the following steps: Get image data; Inputting the image data into the backbone network for feature extraction processing to obtain basic image feature data; Inputting the basic feature data of the image into the neck network for feature fusion processing to obtain image fusion feature data; Inputting the image fusion feature data into the task interaction lightweight structure for task interaction processing to obtain lightweight task feature data; wherein the lightweight task feature data includes classification task features and positioning task features; Inputting the lightweight task feature data into the detection head for prediction to obtain a lightweight target detection result; The task interaction lightweight structure includes a task primary interaction layer, a task decoupling layer, and a task secondary interactor. The image fusion feature data is input into the task interaction lightweight structure for task interaction processing to obtain lightweight task feature data, including: Inputting the image fusion feature data into the task interaction lightweight structure, performing feature extraction processing on the image fusion feature data through the task initial interaction layer in the task interaction lightweight structure to obtain task common feature data; Inputting the task common feature data into the task decoupling layer for feature extraction processing to obtain task specific feature data; The task-specific feature data is input into the task secondary interactor for task supervision processing, and the lightweight task feature data is output.
2. The method according to claim 1, characterized in that The task decoupling layer includes a classification task decoupling layer and a positioning task decoupling layer, the task-specific feature data includes classification task-specific features and positioning task-specific features, and the task-common feature data is input into the task decoupling layer for feature extraction processing to obtain task-specific feature data, including: Inputting the task common feature data into the classification task decoupling layer, performing feature extraction processing on the task common feature data through the classification task decoupling layer to obtain the classification task specific features; The task common feature data is input into the positioning task decoupling layer, and the positioning task decoupling layer performs feature extraction processing on the task common feature data to obtain the positioning task specific feature.
3. The method according to claim 2, characterized in that The step of inputting the task-specific feature data into the task secondary interactor for task supervision processing and outputting the lightweight task feature data comprises: inputting the classification task-specific features in the task-specific feature data into the task secondary interactor; Multiplying the task quadratic interactor by the classification task specific feature point by point to obtain a classification task supervision mask; The classification task supervision mask and the classification task specific feature are subjected to matrix multiplication processing to obtain the classification task feature in the lightweight task feature data.
4. The method according to claim 2, characterized in that The step of inputting the task-specific feature data into the task secondary interactor for task supervision processing and outputting the lightweight task feature data comprises: inputting the positioning task specific feature in the task specific feature data into the task secondary interactor; Multiplying the task secondary interactor and the positioning task specific feature point by point to obtain a positioning task supervision mask; The positioning task supervision mask and the positioning task specific feature are subjected to matrix multiplication processing to obtain the positioning task feature in the lightweight task feature data.
5. The method according to claim 1, wherein The lightweight target detection result includes a lightweight target classification prediction score and a lightweight target positioning prediction value. The detection head includes a classification task auxiliary branch, a classification task prediction branch, a positioning task auxiliary branch, and a positioning task prediction branch. The lightweight task feature data is input into the detection head for prediction to obtain a lightweight target detection result, including: Inputting the classification task features in the lightweight task feature data into the classification task auxiliary branch in the detection head for prediction to obtain classification prediction confidence; Inputting the classification task features in the lightweight task feature data into the classification task prediction branch in the detection head for prediction to obtain a classification prediction score; Inputting the positioning task features in the lightweight task feature data into the positioning task auxiliary branch in the detection head for prediction to obtain positioning prediction coordinates; Inputting the positioning task feature in the lightweight task feature data into the positioning task prediction branch in the detection head for prediction to obtain a positioning prediction bias; Obtaining a target classification prediction score based on the classification prediction confidence and the classification prediction score; Obtaining a target positioning prediction value based on the positioning prediction coordinates and the positioning prediction offset; Performing non-maximum suppression processing on the target classification prediction score to obtain the lightweight target classification prediction score; Non-maximum suppression processing is performed on the target positioning prediction value to obtain the lightweight target positioning prediction value.
6. The method according to claim 5, characterized in that Obtaining a target classification prediction score based on the classification prediction confidence and the classification prediction score includes: The classification prediction confidence and the classification prediction score are multiplied to obtain the target classification prediction score.
7. A lightweight target detection device based on task interaction, characterized in that: Applied to a lightweight target detection model, the lightweight target detection model consists of a backbone network, a neck network, a task interaction lightweight structure and a detection head. The device includes the following modules: An image data acquisition module, used for acquiring image data; An image feature extraction module is used to input the image data into the backbone network for feature extraction processing to obtain basic image feature data; An image feature fusion module, configured to input the basic image feature data into the neck network for feature fusion processing to obtain image fusion feature data; A task interaction module, configured to input the image fusion feature data into the task interaction lightweight structure for task interaction processing to obtain lightweight task feature data; wherein the lightweight task feature data includes classification task features and positioning task features; A lightweight target detection module is used to input the lightweight task feature data into the detection head for prediction to obtain a lightweight target detection result; The task interaction lightweight structure includes a task primary interaction layer, a task decoupling layer, and a task secondary interactor. The task interaction module is specifically used to: Inputting the image fusion feature data into the task interaction lightweight structure, performing feature extraction processing on the image fusion feature data through the task initial interaction layer in the task interaction lightweight structure to obtain task common feature data; Inputting the task common feature data into the task decoupling layer for feature extraction processing to obtain task specific feature data; The task-specific feature data is input into the task secondary interactor for task supervision processing, and the lightweight task feature data is output.
8. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Handheld call detection method based on lightweight target detection network
AU2020103494A4
Target detection method and moving target tracking method using same
CN114092820A