A multi-scene target detection method and system based on model parameter reconstruction

By reconstructing the parameters of multiple target detection models, a reconstructed multi-head model is constructed, which solves the problems of high resource consumption of edge equipment and feature conflicts in multi-scenario target detection, and achieves efficient multi-scenario target detection and increased inference speed.

CN118072154BActive Publication Date: 2024-09-17CHENGDU HENENG CHUANGYUE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410458440.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-17
Publication Date
2024-09-17
Estimated Expiration
2044-04-17

AI Technical Summary

Technical Problem

Existing multi-scenario target detection methods consume large amounts of resources on edge devices and have slow inference speeds. When using a single model, model feature conflicts and insufficient expression are caused by intra-class or inter-class targets, resulting in poor results.

Method used

By reconstructing the model neck parameters and backbone parameters of multiple target detection models, the basic structure and output structure are constructed to form a reconstructed multi-head model to achieve multi-scenario target detection, reduce edge device resource consumption and improve inference efficiency.

Benefits of technology

It achieves efficient multi-scenario target detection on edge devices with limited resources, reduces memory usage and accelerates the inference process, avoids model feature conflicts, and improves detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118072154B
    Figure CN118072154B
Patent Text Reader

Abstract

The present invention discloses a multi-scenario target detection method and system based on model parameter reconstruction. This technology uses multi-scenario parameter technology to reconstruct the same structure backbone (reconstruction of backbone structure) and neck (reconstruction of neck structure) of multiple model parameter values ​​in multiple scenarios, and designs ReHead (output structure) to retain multi-scenario task detection. We propose a multi-scenario model parameter reconstruction model, introduce parameter reconstruction methods for target detection for the first time, and realize multi-scenario target detection with a single model. We design a multi-model merge into edge arm (processor) device deployment architecture process to integrate multiple models into one model, and complete multiple model prediction tasks. At the same time, the model merging architecture of this technology effectively reduces the edge arm (processor) device resources and improves the overall reasoning time of the original multiple models. For the first time, multiple target detection models are merged, which can realize multiple model prediction tasks, reduce video memory usage and accelerate the reasoning process.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a multi-scenario target detection method and system based on model parameter reconstruction. Background Art

[0002] Based on the on-board edge AI detection system, the existing method is to train a target detection model (such as yolov5) for each scene in the multi-scene target detection task. Each model will detect the corresponding scene target to achieve the multi-scene target detection task. The use of multiple models to detect corresponding scene tasks will greatly consume edge device resources (such as video memory, computing power, etc.) and will also reduce the reasoning speed. Although the existing distillation method can alleviate the model's video memory occupancy and accelerate reasoning capabilities, it is still necessary to maintain a model for each scene for multi-scene detection tasks, and it does not significantly release edge device resources. Of course, the existing multiple scenes use one model for unified training, but the model feature conflicts and insufficient feature expression caused by targets within or between classes make its effect poor. Summary of the invention

[0003] The purpose of the present invention is to provide a multi-scenario target detection method and system based on model parameter reconstruction to solve the above-mentioned problems existing in the prior art.

[0004] In a first aspect, an embodiment of the present invention provides a multi-scenario target detection method based on model parameter reconstruction, comprising:

[0005] Obtain multiple target detection models and multiple scene target parameters; the scene target parameters include model head parameters, model neck parameters and model trunk parameters; the multiple scene target parameters are parameters of multiple target detection models when performing target detection in different scenes;

[0006] Based on the model neck parameters and the model trunk parameters in the multiple scene target parameters, parameter reconstruction is performed to obtain the reconstructed model neck parameters and the reconstructed model trunk parameters;

[0007] According to the reconstructed model neck parameters and the reconstructed model trunk parameters, a basic structure is constructed; the basic structure includes a reconstructed trunk structure and a reconstructed neck structure;

[0008] Assigning model head parameters in the multiple scene target parameters to a structure identical to output heads of multiple target detection models to obtain an output structure; the output structure includes multiple output heads with different parameters;

[0009] Reconstructing the target detection model according to the basic structure and the output structure to obtain a reconstructed multi-head model; the reconstructed multi-head model includes multiple output heads of multiple target detection models; one output head corresponds to one scene;

[0010] Detect objects in multiple scenes by reconstructing the multi-head model.

[0011] Optionally, the performing parameter reconstruction based on the model neck parameter and the model trunk parameter in the multiple scene target parameters to obtain the reconstructed model neck parameter and the reconstructed model trunk parameter includes:

[0012] Based on the model backbone parameters, a backbone fusion weight is obtained through the feature space; multiple backbone fusion weights are obtained corresponding to the model backbone parameters of multiple scenes;

[0013] The plurality of backbone fusion weights are multiplied by their respective coefficient weights and then added together to obtain backbone parameters of the reconstruction model;

[0014] The model neck parameters are passed through the feature space to obtain neck fusion weights; multiple neck fusion weights are obtained corresponding to the model neck parameters of multiple scenes;

[0015] The multiple neck fusion weights are multiplied by their respective coefficient weights and then added together to obtain the reconstructed model neck parameters.

[0016] Optionally, obtaining a backbone fusion weight based on the backbone parameters of the model through a feature space includes:

[0017] Obtain a first scene and a second scene; the first scene and the second scene represent two different scenes for target detection;

[0018] Obtaining parameters of the i-th layer in the model backbone parameters corresponding to the first scenario to obtain first model backbone parameters;

[0019] Obtaining parameters of the i-th layer in the model backbone parameters corresponding to the second scenario to obtain the second model backbone parameters;

[0020] The activation function corresponding to the backbone parameters of the first model and the activation function corresponding to the backbone parameters of the second model are matched with redundant features to obtain a merge matrix;

[0021] The features corresponding to the first model backbone parameters after passing through the activation function and the features corresponding to the second model backbone parameters after passing through the activation function form a shared feature space to obtain a first shared feature space;

[0022] The demerged matrix corresponding to the first shared feature space is used as an unmerged matrix; the demerged matrix is ​​a matrix corresponding to a merging operation capable of undoing the merging matrix;

[0023] Obtaining a first backbone fusion weight according to the merged matrix, the unmerged matrix, the first model backbone parameter, and the second model backbone parameter;

[0024] Adding the first model backbone parameter and the second model backbone parameter to obtain a second backbone fusion weight;

[0025] The product of multiplying the first trunk fusion weight by the first weight coefficient is added to the product of multiplying the second trunk fusion weight by the second weight coefficient to obtain the trunk fusion weight.

[0026] Optionally, obtaining the first backbone fusion weight according to the merged matrix, the unmerged matrix, the first model backbone parameter, and the second model backbone parameter includes:

[0027] Obtain a first merge matrix and a second merge matrix; the first merge matrix is ​​a merge matrix corresponding to the trunk parameters of the first model of the i-th layer; the second merge matrix is ​​a merge matrix corresponding to the trunk parameters of the second model of the i-th layer;

[0028] Obtain a first unmerged matrix and a second unmerged matrix; the first unmerged matrix is ​​an unmerged matrix of the i-1th layer corresponding to the backbone parameters of the first model; the second unmerged matrix is ​​an unmerged matrix of the i-1th layer corresponding to the backbone parameters of the second model;

[0029] Multiplying the first merged matrix by the first model backbone parameter and then by the first unmerged matrix to obtain a first weight to be fused;

[0030] Multiplying the second merged matrix by the second model backbone parameter and then by the second unmerged matrix to obtain a second weight to be fused;

[0031] The first weight to be fused is added to the first weight to be fused to obtain the first trunk fusion weight.

[0032] Optionally, detecting targets in multiple scenes by reconstructing a multi-head model includes:

[0033] Obtaining a detection image; the categories of the targets in the detection image include categories of targets that can be detected by multiple target detection models;

[0034] The detection image is sequentially input into the reconstructed trunk structure and the reconstructed neck structure, and image features are extracted to obtain multi-scene image features; the multi-scene image features are features of targets in multiple scenes contained in the detection image;

[0035] Input the multi-scene image features into the output structure, use multiple output heads to detect the features of the corresponding scenes in the multi-scene image features, and obtain multiple prediction output vectors; one prediction output vector corresponds to one scene;

[0036] The prediction output vector includes the category, confidence, and the center point, length, and width of the bounding box.

[0037] Optionally, detecting targets in multiple scenes by reconstructing the multi-head model further includes:

[0038] Calculating the intersection-and-union ratio of the bounding boxes in the plurality of predicted output vectors to obtain a plurality of intersection-and-union ratio values;

[0039] If the intersection-and-union ratio is higher than the set threshold, the two positions corresponding to the intersection-and-union ratio are set to the same position; multiple intersection-and-union ratios result in multiple same positions;

[0040] The categories whose corresponding confidences in multiple same positions are greater than the corresponding confidences in other same positions are taken as the location categories;

[0041] If the intersection ratio is lower than the set threshold, no processing is performed.

[0042] Optionally, the parameters in the target detection model are parameters trained in different scenarios; and the parameters of the reconstructed multi-head model are parameters that are not trained using the reconstructed multi-head model.

[0043] In a second aspect, an embodiment of the present invention provides a multi-scenario target detection system based on model parameter reconstruction, comprising:

[0044] The processor edge device deploys the constructed reconstructed multi-head model and loads the reconstructed model neck parameters, reconstructed model trunk parameters, and model head parameter assignments in multiple scene target parameters;

[0045] Run the reconstructed multi-head model on the processor edge device for object detection.

[0046] Optionally, run the reconstructed multi-head model on the processor edge device for object detection, including:

[0047] Acquisition module: obtains a detection image; the categories of the targets in the detection image include categories of targets that can be detected by multiple target detection models;

[0048] Feature extraction module: input the detection image into the reconstructed trunk structure and the reconstructed neck structure in sequence, extract image features, and obtain multi-scene image features; the multi-scene image features are features of targets in multiple scenes in the detection image;

[0049] Detection module: input the multi-scene image features into the output structure, use multiple output heads to detect the features of the corresponding scenes in the multi-scene image features, and obtain multiple prediction output vectors; one prediction output vector corresponds to one scene; the prediction output vector includes the category, confidence, and the center point, length, and width of the bounding box.

[0050] Compared with the prior art, the embodiments of the present invention achieve the following beneficial effects:

[0051] An embodiment of the present invention also provides a multi-scene target detection method and system based on model parameter reconstruction, the method comprising obtaining multiple target detection models and multiple scene target parameters; the scene target parameters comprising model head parameters, model neck parameters and model trunk parameters; the multiple scene target parameters are parameters of multiple target detection models when performing target detection in different scenes; based on the model neck parameters and model trunk parameters in the multiple scene target parameters, parameter reconstruction is performed to obtain reconstructed model neck parameters and reconstructed model trunk parameters; according to the reconstructed model neck parameters and reconstructed model trunk parameters, a basic structure is constructed; the basic structure comprises a reconstructed trunk structure and a reconstructed neck structure; according to the model head parameters in the multiple scene target parameters, the structure identical to the output heads of the multiple target detection models is assigned to obtain an output structure; the output structure comprises multiple output heads with different parameters; according to the basic structure and the output structure, the target detection model is reconstructed to obtain a reconstructed multi-head model; the reconstructed multi-head model comprises multiple output heads of the multiple target detection models; one output head corresponds to one scene; and targets of multiple scenes are detected by reconstructing the multi-head model.

[0052] This technology uses multi-scenario parameter technology to reconstruct the same structure backbone (reconstruct the backbone structure) and neck (reconstruct the neck structure) of multi-scenario multiple model parameter values, and designs ReHead (output structure) to retain multi-scenario task detection. We propose a multi-scenario model parameter reconstruction model, and for the first time introduce parameter reconstruction methods to target detection to achieve multi-scenario target detection with a single model. We designed a multi-model merge into edge arm (processor) device deployment architecture process to integrate multiple models into one model, and complete multiple model prediction tasks. At the same time, the model merging architecture of this technology effectively reduces the edge arm (processor) device resources, improves the overall reasoning time of the original multiple models, and provides ideas for edge arm (processor) devices with limited resources. For the first time, multiple target detection models are merged, which can achieve multiple model prediction tasks, reduce video memory usage and accelerate the reasoning process. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 It is a flow chart of a multi-scenario target detection method based on model parameter reconstruction provided by an embodiment of the present invention.

[0054] Figure 2 It is a schematic diagram of a multi-scenario target detection method based on model parameter reconstruction provided by an embodiment of the present invention.

[0055] Figure 3 It is a partial structural diagram of a reconstructed multi-head model in a multi-scene target detection method based on model parameter reconstruction provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0056] The present invention will be described in detail below in conjunction with the accompanying drawings.

[0057] Example 1

[0058] like Figure 1 As shown, an embodiment of the present invention provides a multi-scenario target detection method based on model parameter reconstruction, the method comprising:

[0059] S101: obtaining multiple target detection models and multiple scene target parameters; the scene target parameters include model head parameters, model neck parameters and model trunk parameters; the multiple scene target parameters are parameters of multiple target detection models when performing target detection in different scenes;

[0060] Among them, the target detection model in this embodiment is the yolov5 model.

[0061] Among them, in this embodiment, the structures of multiple target detection models are the same, and the parameters of the target detection models corresponding to different scenarios are different.

[0062] S102: reconstructing parameters based on the model neck parameters and the model trunk parameters in the multiple scene target parameters to obtain reconstructed model neck parameters and reconstructed model trunk parameters;

[0063] S103: constructing a basic structure according to the reconstructed model neck parameters and the reconstructed model trunk parameters; the basic structure includes a reconstructed trunk structure and a reconstructed neck structure;

[0064] S104: Assigning model head parameters in the multiple scene target parameters to a structure identical to output heads of multiple target detection models to obtain an output structure; the output structure includes multiple output heads with different parameters.

[0065] Among them, the ReBase structure (basic structure) has realized the reconstruction of the parameter values ​​of the backbone (reconstruction of the backbone structure) and the neck (reconstruction of the neck structure) of the multi-scenario model, and made the backbone (reconstruction of the backbone structure) and the neck (reconstruction of the neck structure) of the isomorphic yolo_zip model (reconstruction of the multi-head model) have the ability to express multi-scenario features. In order to enable the yolo_zip model (reconstruction of the multi-head model) to achieve multi-scenario detection tasks, we designed the ReHead model structure (output structure, such as Figure 3 ). ReHead (output structure) only needs to obtain the feature output of neck (reconstructed neck structure) by converting the original model structure and parameters of each scene to realize the respective scene detection tasks.

[0066] S105: reconstructing the target detection model according to the basic structure and the output structure to obtain a reconstructed multi-head model; the reconstructed multi-head model includes multiple output heads of multiple target detection models; one output head corresponds to one scene;

[0067] S106: Detect targets in multiple scenes by reconstructing the multi-head model.

[0068] Among them, in this embodiment, the computing platform with parameters of NvidiaNX, TX edge computing devices, memory and video memory of not less than 4G, and processor main frequency of not less than 2.3GHz is used for calculation.

[0069] The reconstructed multi-head model can detect all categories of targets corresponding to multiple target detection models. For example, suppose there are two models, both of which are yolov5s structures, model 1 predicts 5 categories, and model 2 predicts 9 categories. The present invention has only one model, and the extracted features are shared by two tasks, while the prediction weights are not shared, namely model 1 for 5 categories and model 2 for 9 categories.

[0070] Through the above method, for the Yolo prediction module, the present invention proposes not to merge, to construct multiple model prediction heads, and to assign their weights to the corresponding prediction heads respectively.

[0071] Optionally, the performing parameter reconstruction based on the model neck parameter and the model trunk parameter in the multiple scene target parameters to obtain the reconstructed model neck parameter and the reconstructed model trunk parameter includes:

[0072] Based on the model backbone parameters, a backbone fusion weight is obtained through the feature space; multiple backbone fusion weights are obtained corresponding to the model backbone parameters of multiple scenes;

[0073] The plurality of backbone fusion weights are multiplied by their respective coefficient weights and then added together to obtain backbone parameters of the reconstruction model;

[0074] The model neck parameters are passed through the feature space to obtain neck fusion weights; multiple neck fusion weights are obtained corresponding to the model neck parameters of multiple scenes;

[0075] The multiple neck fusion weights are multiplied by their respective coefficient weights and then added together to obtain the reconstructed model neck parameters.

[0076] Optionally, obtaining a backbone fusion weight based on the backbone parameters of the model through a feature space includes:

[0077] Obtain a first scene and a second scene; the first scene and the second scene represent two different scenes for target detection;

[0078] Obtaining parameters of the i-th layer in the model backbone parameters corresponding to the first scenario to obtain first model backbone parameters;

[0079] Obtaining parameters of the i-th layer in the model backbone parameters corresponding to the second scenario to obtain the second model backbone parameters;

[0080] The activation function corresponding to the backbone parameters of the first model and the activation function corresponding to the backbone parameters of the second model are matched with redundant features to obtain a merge matrix;

[0081] The features corresponding to the first model backbone parameters after passing through the activation function and the features corresponding to the second model backbone parameters after passing through the activation function form a shared feature space to obtain a first shared feature space;

[0082] The demerged matrix corresponding to the first shared feature space is used as an unmerged matrix; the demerged matrix is ​​a matrix corresponding to a merging operation capable of undoing the merging matrix;

[0083] Obtaining a first backbone fusion weight according to the merged matrix, the unmerged matrix, the first model backbone parameter, and the second model backbone parameter;

[0084] Adding the first model backbone parameter and the second model backbone parameter to obtain a second backbone fusion weight;

[0085] The product of multiplying the first trunk fusion weight by the first weight coefficient is added to the product of multiplying the second trunk fusion weight by the second weight coefficient to obtain the trunk fusion weight.

[0086] The calculation method of the backbone fusion weight is specifically obtained by the following method:

[0087]

[0088] Wherein, α and β are weight coefficients, and in the present invention, α=0.5 and β=1 have better effects.

[0089] in, represents the backbone fusion weight, represents the weight of the i-th layer in the fusion weight, Represents the weight of the i-th layer in the first backbone weight. Represents the weight of the i-th layer in the second backbone weight.

[0090] Among them, by comparison and The activation f A and f B To match redundant features. Use this match to generate a merge matrix (merge matrix, M), and convert f A and f B Combined into a shared feature space f *, and generates the corresponding unmerged matrix (unmerge matrix, U) of the unmerged operation. In order to align the input space of the next layer, the unmerged matrix (U) is propagated forward to the network, and a U matrix is ​​received from the previous layer at the same time. Once you have both the output merge matrix (M) and the input unmerged matrix (U), you can use the above formula for calculation.

[0091] in, is an uncombined matrix corresponding to the first backbone weight received by the i-th layer from the previous layer according to the above method, It is an uncombined matrix corresponding to the second backbone weight received by the i-th layer from the previous layer according to the above method. The merge matrix generated by the matching corresponding to the first backbone weight of the i-th layer according to the above method. The merge matrix generated for the matching corresponding to the second backbone weight of the i-th layer according to the above method.

[0092] The calculation method of the backbone fusion weight may also adopt a weight direct merging method, and the calculation formula is as follows:

[0093]

[0094] Or use the combined weight, the calculation formula is as follows:

[0095]

[0096] Among them, P represents The meanings of other parameters are as described above.

[0097] Through the above method, the reconstructed model neck parameters and the reconstructed model trunk parameters of multiple models will be merged using the above formula, and are obtained by combining the feature space and the weight coefficient of the target detection network corresponding to each scene.

[0098] Optionally, obtaining the first backbone fusion weight according to the merged matrix, the unmerged matrix, the first model backbone parameter, and the second model backbone parameter includes:

[0099] Obtain a first merge matrix and a second merge matrix; the first merge matrix is ​​a merge matrix corresponding to the trunk parameters of the first model of the current number of layers; the second merge matrix is ​​a merge matrix corresponding to the trunk parameters of the second model of the current number of layers;

[0100] Obtaining a first unmerged matrix and a second unmerged matrix; the first unmerged matrix is ​​an unmerged matrix of the previous layer corresponding to the backbone parameters of the first model; the second unmerged matrix is ​​an unmerged matrix of the previous layer corresponding to the backbone parameters of the second model;

[0101] Multiplying the first merged matrix by the first model backbone parameter and then by the first unmerged matrix to obtain a first weight to be fused;

[0102] Multiplying the second merged matrix by the second model backbone parameter and then by the second unmerged matrix to obtain a second weight to be fused;

[0103] The first weight to be fused is added to the first weight to be fused to obtain a first trunk fusion weight.

[0104] Optionally, reconstructing the target detection model according to the basic structure and the output structure to obtain a reconstructed multi-head model includes:

[0105] The input of the reconstructed trunk structure in the base structure is an image; the input of the reconstructed neck structure in the base structure is the output of the reconstructed trunk structure in the base structure; the input of the output structure is the output of the reconstructed neck structure in the base structure;

[0106] The number of output heads in the output structure is equal to the number of scenes set to be detected.

[0107] Among them, the model mainly consists of the reconstruction of the backbone structure (backbone), the reconstruction of the neck structure (neck) and the output structure (Rehead). Obviously, the smart city multi-scene detection task uses yolov5 as the benchmark model. Assuming there are two scene tasks, we need to train two yolov5 models with the same structure, and our goal is to use a model similar to yolov5 to achieve two scene detection tasks. Naturally, we think of the parameter reconstruction method to enable a model to have two scene detection functions. We use the parameter reconstruction method to reconstruct the parameter values ​​of the isomorphic multi-scene model and propose the ReBase structure (base structure) parameter reconstruction structure (such as Figure 2 ). The ReBase structure (basic structure) reconstructs the backbone (reconstructs the backbone structure) and neck (reconstructs the neck structure) of the yolov5 model. This part is the model parameter that carries the characteristic information of the scene task, and also has the same structure and parameters as the multi-scene model. Complete the parameter reconstruction to make it have the ability to express multi-scene features, and then give the reconstructed parameter value to a single model as the parameter value of inference

[0108] Optionally, detecting targets in multiple scenes by reconstructing a multi-head model includes:

[0109] Obtaining a detection image; the categories of the targets in the training image include categories of targets that can be detected by multiple target detection models;

[0110] The detection image is sequentially input into the reconstructed trunk structure and the reconstructed neck structure, and image features are extracted to obtain multi-scene image features; the multi-scene image features are features of targets in multiple scenes contained in the detection image;

[0111] Input the multi-scene image features into the output structure, use multiple output heads to detect the features of the corresponding scenes in the multi-scene image features, and obtain multiple prediction output vectors; one prediction output vector corresponds to one scene;

[0112] The prediction output vector includes the category, confidence, and the center point, length, and width of the bounding box.

[0113] Optionally, detecting targets in multiple scenes by reconstructing the multi-head model further includes:

[0114] Performing an intersection-and-union comparison on the multiple detection results to obtain multiple intersection-and-union ratio values;

[0115] The number of the intersection-over-union ratios and the number of the detection results may be in the range of 0 to n-1. The n represents the number of detection results.

[0116] If the intersection-and-union ratio is higher than the set threshold, the two positions corresponding to the intersection-and-union ratio are set to the same position; multiple intersection-and-union ratios result in multiple same positions.

[0117] In this embodiment, the intersection-over-union ratio is set to 0.8.

[0118] The category whose corresponding confidence in multiple same positions is greater than the corresponding confidence in other same positions is taken as the location category.

[0119] If the intersection ratio is lower than the set threshold, no processing is performed.

[0120] Among them, the IOU is mainly used to match the output results of multiple prediction heads at the same position. If it is higher than the set threshold, the category of multiple prediction heads at the same position is the one with the highest confidence as the category of the position. If it is lower than the set threshold, no processing is done.

[0121] Among them, for the method of multiple targets at the same location. Scene 1 detects the bike target and scene 2 detects the car target, and the bike and car targets appear at the same location. To solve this problem, the scene confidence priority principle is proposed, that is, for different scene targets at the same location, the scene target with a large confidence is selected as the final target.

[0122] Through the above method, although the multi-scene parameter reconstruction has the ability to express multi-scene targets, the stronger the expression of different scenes, the higher the confidence will be, which is also in line with the actual situation.

[0123] Optionally, the parameters in the target detection model are parameters trained in different scenarios; and the parameters of the reconstructed multi-head model are parameters that are not trained using the reconstructed multi-head model.

[0124] Optionally, the reconstructed model neck parameters, the reconstructed model and the model head parameters in the multiple scene target parameters are stored in a database.

[0125] in,

[0126] 1. Train multiple models of the same structure and multiple scenes to obtain the parameter values ​​of the detection models for different scene tasks;

[0127] 2. Use the ReZip method to reconstruct the parameter values ​​of the multi-scenario model, and realize the reconstruction of the backbone and neck parameter values ​​of the yolo_zip model, so that it has the ability to express multi-scenario features;

[0128] 3. Keep the multi-scene prediction head and build the multi-task head structure ReHead in the yolo_zip model to realize the multi-scene detection task;

[0129] 4. Assign the multi-scene reconstruction backbone and neck parameter values ​​to the backbone and neck layers of the yolo_zip model, assign the multi-scene head parameter values ​​to the ReHead layer of yolo_zip, and retain the parameter values;

[0130] 5. Deploy the multi-scenario yolo_zip model to the arm edge device, load the parameters, reconstruct and save the parameter values;

[0131] 6. Perform multi-scenario task detection and perform multi-target processing at the same location on the output results to obtain the final output results.

[0132] Example 2

[0133] Based on the above-mentioned multi-scenario target detection method based on model parameter reconstruction, an embodiment of the present invention further provides a multi-scenario target detection system based on model parameter reconstruction, the system comprising:

[0134] The processor edge device deploys the constructed reconstructed multi-head model and loads the reconstructed model neck parameters, reconstructed model trunk parameters, and model head parameter assignments in multiple scene target parameters;

[0135] Run the reconstructed multi-head model on the processor edge device for object detection.

[0136] Optionally, a reconstructed multi-head model is run on a processor edge device for target detection, including an acquisition module, a feature extraction module, and a detection module.

[0137] The acquisition module is used to obtain a detection image; the categories of the targets in the detection image include categories of targets that can be detected by multiple target detection models;

[0138] The feature extraction module is used to input the detection image into the reconstructed trunk structure and the reconstructed neck structure in sequence, extract image features, and obtain multi-scene image features; the multi-scene image features are features of targets in multiple scenes contained in the detection image;

[0139] The detection module is used to input the multi-scene image features into the output structure, use multiple output heads to detect the features of the corresponding scenes in the multi-scene image features, and obtain multiple prediction output vectors; one prediction output vector corresponds to one scene; the prediction output vector includes the category, confidence, and the center point, length, and width of the bounding box.

[0140] The algorithm and display provided herein are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages ​​can be utilized to realize the content of the present invention described herein, and the description of the above specific languages ​​is for disclosing the best mode of the present invention.

[0141] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0142] Similarly, it should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the intention that the claimed invention requires more features than those explicitly recited in each claim. More specifically, as reflected in the claims below, inventive aspects lie in less than all the features of the individual embodiments disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present invention.

[0143] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.

[0144] In addition, those skilled in the art will appreciate that, although some embodiments herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present invention and form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.

[0145] The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components in the apparatus according to an embodiment of the present invention. The present invention may also be implemented as a device or device program (e.g., a computer program and a computer program product) for executing part or all of the methods described herein. Such a program implementing the present invention may be stored on a computer-readable medium, or may have the form of one or more signals. Such a signal may be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

Claims

1. A multi-scene target detection method based on model parameter reconstruction, characterized in that: include: Obtain multiple target detection models and multiple scene target parameters; The scene target parameters include model head parameters, model neck parameters and model trunk parameters; the multiple scene target parameters are parameters of multiple target detection models when performing target detection in different scenes; Based on the model neck parameters and the model trunk parameters in the multiple scene target parameters, parameter reconstruction is performed to obtain the reconstructed model neck parameters and the reconstructed model trunk parameters; According to the reconstructed model neck parameters and the reconstructed model trunk parameters, a basic structure is constructed; the basic structure includes a reconstructed trunk structure and a reconstructed neck structure; Assigning model head parameters in the multiple scene target parameters to a structure identical to output heads of multiple target detection models to obtain an output structure; the output structure includes multiple output heads with different parameters; Reconstructing the target detection model according to the basic structure and the output structure to obtain a reconstructed multi-head model; the reconstructed multi-head model includes multiple output heads of multiple target detection models; one output head corresponds to one scene; Detect objects in multiple scenes by reconstructing a multi-head model; The step of reconstructing the model neck parameters and the model trunk parameters based on the multiple scene target parameters to obtain the reconstructed model neck parameters and the reconstructed model trunk parameters includes: Based on the model backbone parameters, a backbone fusion weight is obtained through the feature space; multiple backbone fusion weights are obtained corresponding to the model backbone parameters of multiple scenes; The plurality of backbone fusion weights are multiplied by their respective coefficient weights and then added together to obtain backbone parameters of the reconstruction model; The model neck parameters are passed through the feature space to obtain neck fusion weights; multiple neck fusion weights are obtained corresponding to the model neck parameters of multiple scenes; The plurality of neck fusion weights are multiplied by their respective coefficient weights and then added together to obtain the neck parameters of the reconstructed model; The step of obtaining the backbone fusion weight based on the backbone parameters of the model through the feature space includes: Obtain a first scene and a second scene; the first scene and the second scene represent two different scenes for target detection; Obtaining parameters of the i-th layer in the model backbone parameters corresponding to the first scenario to obtain first model backbone parameters; Obtaining parameters of the i-th layer in the model backbone parameters corresponding to the second scenario to obtain the second model backbone parameters; The activation function corresponding to the backbone parameters of the first model and the activation function corresponding to the backbone parameters of the second model are matched with redundant features to obtain a merge matrix; The activation function corresponding to the first model backbone parameter and the activation function corresponding to the second model backbone parameter form a shared feature space to obtain a first shared feature space; The demerged matrix corresponding to the first shared feature space is used as an unmerged matrix; the demerged matrix is ​​a matrix corresponding to a merging operation capable of undoing the merging matrix; Obtaining a first backbone fusion weight according to the merged matrix, the unmerged matrix, the first model backbone parameter, and the second model backbone parameter; Adding the first model backbone parameter and the second model backbone parameter to obtain a second backbone fusion weight; The product of multiplying the first trunk fusion weight by the first weight coefficient is added to the product of multiplying the second trunk fusion weight by the second weight coefficient to obtain a trunk fusion weight; The step of obtaining the first backbone fusion weight according to the merged matrix, the unmerged matrix, the first model backbone parameter and the second model backbone parameter comprises: Obtain a first merge matrix and a second merge matrix; the first merge matrix is ​​a merge matrix corresponding to the trunk parameters of the first model of the i-th layer; the second merge matrix is ​​a merge matrix corresponding to the trunk parameters of the second model of the i-th layer; Obtain a first unmerged matrix and a second unmerged matrix; the first unmerged matrix is ​​an unmerged matrix of the i-1th layer corresponding to the backbone parameters of the first model; the second unmerged matrix is ​​an unmerged matrix of the i-1th layer corresponding to the backbone parameters of the second model; Multiplying the first merged matrix by the first model backbone parameter and then by the first unmerged matrix to obtain a first weight to be fused; Multiplying the second merged matrix by the second model backbone parameter and then by the second unmerged matrix to obtain a second weight to be fused; Adding the first weight to be fused and the first weight to be fused to obtain a first trunk fusion weight; The method of detecting targets in multiple scenes by reconstructing a multi-head model includes: Obtaining a detection image; the categories of the targets in the detection image include categories of targets that can be detected by multiple target detection models; The detection image is sequentially input into the reconstructed trunk structure and the reconstructed neck structure, and image features are extracted to obtain multi-scene image features; the multi-scene image features are features of targets in multiple scenes contained in the detection image; Input the multi-scene image features into the output structure, use multiple output heads to detect the features of the corresponding scenes in the multi-scene image features, and obtain multiple prediction output vectors; one prediction output vector corresponds to one scene; The prediction output vector includes the category, confidence, and the center point, length, and width of the bounding box.

2. The multi-scenario target detection method based on model parameter reconstruction according to claim 1, characterized in that: The method of reconstructing the target detection model according to the basic structure and the output structure to obtain a reconstructed multi-head model includes: The input of the reconstructed trunk structure in the base structure is an image; the input of the reconstructed neck structure in the base structure is the output of the reconstructed trunk structure in the base structure; the input of the output structure is the output of the reconstructed neck structure in the base structure; The number of output heads in the output structure is equal to the number of scenes set to be detected.

3. The multi-scenario target detection method based on model parameter reconstruction according to claim 1, characterized in that: The detecting of targets in multiple scenes by reconstructing the multi-head model also includes: Calculating the intersection-and-union ratio of the bounding boxes in the plurality of predicted output vectors to obtain a plurality of intersection-and-union ratio values; If the intersection-and-union ratio is higher than the set threshold, the two positions corresponding to the intersection-and-union ratio are set to the same position; multiple intersection-and-union ratios result in multiple same positions; The categories whose corresponding confidences in multiple same positions are greater than the corresponding confidences in other same positions are taken as the location categories; If the intersection ratio is lower than the set threshold, no processing is performed.

4. The multi-scenario target detection method based on model parameter reconstruction according to claim 1, characterized in that: The parameters in the target detection model are the parameters trained in different scenarios; the parameters of the reconstructed multi-head model are the parameters that are not trained using the reconstructed multi-head model.

5. A multi-scenario target detection system based on model parameter reconstruction, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method according to any one of claims 1 to 4 when executing the program.