Training method of multi-task target detection model and multi-task target detection method

By introducing a shared backbone network and bottleneck layer into the object detection model, and connecting multiple detection heads in parallel, the model optimization problem when the training set categories change is solved by using multi-task loss values ​​to optimize parameters, thus achieving efficient training and improved detection capabilities for multi-task object detection.

CN116543262BActive Publication Date: 2025-11-25ZHEJIANG PECKERAI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310542881.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-11
Publication Date
2025-11-25
Estimated Expiration
2043-05-11

AI Technical Summary

Technical Problem

Existing object detection models use training sets that are only applied to a single task, which means that the training set needs to be recalibrated when the category changes, and cannot effectively optimize other training sets.

Method used

A multi-task object detection model is adopted, which shares a backbone network layer and a bottleneck layer, connects the first and second detection heads in parallel, constructs them for different training sets, and uses the first and second loss values ​​to backpropagate and adjust the model parameters to achieve multi-task object detection.

Benefits of technology

Without recalibration, new object detection models can be trained, the detection capabilities of old models can be optimized, the detection accuracy and localization precision for multiple tasks can be improved, and the robustness and generalization ability of the models can be enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116543262B_ABST
    Figure CN116543262B_ABST
Patent Text Reader

Abstract

The application provides a training method of a multi-task target detection model and a multi-task target detection method. The method comprises the following steps: obtaining a training sample image; constructing a target detection model, wherein the target detection model comprises a shared backbone network layer and a shared bottleneck layer connected in sequence, and a first detection head and a second detection head connected in parallel after the shared bottleneck layer, the training sets used when the first detection head and the second detection head are constructed are different; inputting the training sample image into the target detection model, outputting a first detection result by the first detection head, and outputting a second detection result by the second detection head; determining a first loss value of the first detection head according to the first detection result, and determining a second loss value of the second detection head according to the second detection result; performing back propagation by using the first loss value and the second loss value to adjust parameters of the target detection model, and obtaining a trained target detection model. The target detection model can perform multi-task target detection, and the detection capability of the target detection model is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of artificial intelligence, in particular, to a multi-task target detection model training method and device, a multi-task target detection method, an electronic device and a computer readable storage medium. BACKGROUND

[0002] At present, with the wide application of deep learning target detection methods in security inspection, medical images, industrial quality inspection and other fields, target detection models have also been developed accordingly. The training set is an important participant in the training stage of the deep learning target detection model. With the development of business, the categories of target detection images are continuously expanding and refining, which brings the following challenges to target detection model training: first, the training set only acts on the first target detection model, and the second training set only acts on the second target detection model. When the new category different from the first training set changes, the first training set needs to be re-labeled, and the second training set cannot optimize the first target detection model. SUMMARY

[0003] The main purpose of the present application is to provide a multi-task target detection model training method and device, a multi-task target detection method, an electronic device and a computer readable storage medium, to at least solve the problem that one training set only acts on one target detection model in the existing model training method.

[0004] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a multi-task target detection model training method is provided, the target detection model is applied to identify the category of target object, comprising: acquiring a training sample image; constructing a target detection model, the target detection model includes a common backbone network layer and a common bottleneck layer connected in sequence, and a first detection head and a second detection head connected in parallel after the common bottleneck layer, the first detection head is a detection head constructed for a first training set, and the second detection head is a detection head constructed for a second training set; inputting the training sample image into the target detection model, the first detection head outputs a first detection result, and the second detection head outputs a second detection result; determining a first loss value of the first detection head according to the first detection result, and determining a second loss value of the second detection head according to the second detection result; using the first loss value and the second loss value for back propagation to adjust the parameters of the target detection model, and obtaining a trained target detection model.

[0005] Optionally, the first loss value of the first detection head is determined according to the first detection result, comprising: if the classification result of the first detection result is contained in the classification label of the first training set, then the first regression loss value and the first classification loss value are obtained based on the first detection result, and the first loss value is determined according to the first regression loss value and the first classification loss value.

[0006] Optionally, the second loss value of the second detection head is determined according to the second detection result, including: if the classification label of the second training set is contained in the classification label of the first training set, a second regression loss value and a second classification loss value are obtained based on the second detection result, and the second loss value is determined according to the second regression loss value and the second classification loss value; if the classification label of the second training set is not contained in the classification label of the first training set, a third regression loss value, a third classification loss value, a first regression loss weight and a first classification loss weight are obtained based on the second detection result, and the second loss value is determined according to the third regression loss value, the third classification loss value, the first regression loss weight and the first classification loss weight.

[0007] Optionally, the third regression loss value, the third classification loss value, the first regression loss weight and the first classification loss weight are obtained based on the second detection result, and the second loss value is determined according to the third regression loss value, the third classification loss value, the first regression loss weight and the first classification loss weight, including: the first classification loss weight is obtained based on the confidence of the prediction box; the first regression loss weight is obtained based on the intersection over union of the two prediction boxes; the second detection result includes a classification result and a regression position, the third classification loss value is obtained according to the classification result of the prediction box and the pseudo label, and the third regression loss value is obtained according to the regression position of the prediction box and the pseudo label; and the second loss value is determined according to the third regression loss value, the third classification loss value, the first regression loss weight and the first classification loss weight.

[0008] Optionally, the second loss value of the second detection head is determined according to the second detection result, including: if the classification result of the second detection result is contained in the classification label of the second training set, a fourth regression loss value and a fourth classification loss value are obtained based on the second detection result, and the second loss value is determined according to the fourth regression loss value and the fourth classification loss value.

[0009] Optionally, the first loss value of the first detection head is determined according to the first detection result, including: if the classification label of the first training set is contained in the classification label of the second training set, a fifth regression loss value and a fifth classification loss value are obtained based on the first detection result, and the first loss value is determined according to the fifth regression loss value and the fifth classification loss value; if the classification label of the first training set is not contained in the classification label of the second training set, a sixth regression loss value, a sixth classification loss value, a second regression loss weight and a second classification loss weight are obtained based on the first detection result, and the first loss value is determined according to the sixth regression loss value, the sixth classification loss value, the second regression loss weight and the second classification loss weight.

[0010] Optionally, the sixth regression loss value, the sixth classification loss value, the second regression loss weight and the second classification loss weight are obtained based on the first detection result, and the first loss value is determined according to the sixth regression loss value, the sixth classification loss value, the second regression loss weight and the second classification loss weight, including: obtaining the second classification loss weight based on the confidence of the prediction box; obtaining the second regression loss weight based on the intersection over union of the two prediction boxes; the first detection result includes a classification result and a regression position, the sixth classification loss value is obtained according to the classification result of the prediction box and the pseudo label, and the sixth regression loss value is obtained according to the regression position of the prediction box and the pseudo label; the first loss value is determined according to the sixth regression loss value, the sixth classification loss value, the second regression loss weight and the second classification loss weight.

[0011] Optionally, the first loss value and the second loss value are used for back propagation to adjust the parameters of the target detection model to obtain a trained target detection model, including: the parameters of the target detection model include the parameters in the shared backbone network layer and the shared bottleneck layer, the parameters in the first detection head and the parameters in the second detection head; the first loss value is used for back propagation to the first detection head to adjust the parameters in the first detection head; the second loss value is used for back propagation to the first detection head to adjust the parameters in the second detection head; the first loss value and the second loss value are used for back propagation to the shared backbone network layer and the shared bottleneck layer to adjust the parameters in the shared backbone network layer and the parameters in the shared bottleneck layer.

[0012] Optionally, the first loss value and the second loss value are used for back propagation to the shared backbone network layer and the shared bottleneck layer to adjust the parameters in the shared backbone network layer and the parameters in the shared bottleneck layer, including: obtaining a first influence factor and a second influence factor according to the first loss value and the second loss value; obtaining a third loss value according to the first influence factor, the second influence factor, the first loss value and the second loss value; and back propagating the third loss value to the shared backbone network layer and the shared bottleneck layer to adjust the parameters in the shared backbone network layer and the parameters in the shared bottleneck layer.

[0013] According to another aspect of the present application, a multi-task target detection method is provided, including: obtaining a to-be-detected image; inputting the to-be-detected image into any one of the trained target detection models to obtain a target detection result of a target object of the to-be-detected image, wherein the to-be-detected image is an image containing the target object.

[0014] According to another aspect of the present application, a training device of a multi-task target detection model is provided, the target detection model being applied to identify a category of a target object, comprising: an acquisition unit configured to acquire a training sample image; a construction unit configured to construct a target detection model, the target detection model comprising a common backbone network layer and a common bottleneck layer connected in sequence, and a first detection head and a second detection head connected in parallel after the common bottleneck layer, the first detection head being a detection head constructed for a first training set, and the second detection head being a detection head constructed for a second training set; a detection unit configured to input the training sample image into the target detection model, the first detection head outputting a first detection result, and the second detection head outputting a second detection result; a determination unit configured to determine a first loss value of the first detection head according to the first detection result, and determine a second loss value of the second detection head according to the second detection result; and a back propagation unit configured to perform back propagation using the first loss value and the second loss value to adjust parameters of the target detection model, and obtain a trained target detection model.

[0015] According to yet another aspect of the present application, an electronic device is provided, comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs comprise a program for performing any one of the training methods of the multi-task target detection model.

[0016] According to still another aspect of the present application, a computer readable storage medium is provided, having a computer program stored thereon, the computer program being executed by a processor to implement any one of the training methods of the multi-task target detection model.

[0017] By applying the technical solution of the present application, when the category of the training sample image is changed, a new second target detection model can be trained, an old first target detection model can be optimized, and the detection capability of the first target detection model can be improved, without re-labeling the second training set; and the first training set can also act on the new second target detection model together with the second training set, without re-labeling by human.

[0018] The present application adds a detection head to an existing target detection model, can perform multi-task target detection, and optimizes the model according to the first loss value and the second loss value, thereby improving the detection capability of the target detection model. BRIEF DESCRIPTION OF DRAWINGS

[0019] The accompanying drawings, which form a part of the present application, are intended to provide further understanding of the present application, and the illustrative embodiments of the present application and their description serve the purpose of explaining the present application. The accompanying drawings should not be regarded as an inappropriate limitation of the present application. In the drawings:

[0020] Figure 1 A hardware structure block diagram of a mobile terminal for performing a training method of a multi-task target detection model is shown according to an embodiment of the present application;

[0021] Figure 2 A flowchart of a training method of a multi-task target detection model is shown according to an embodiment of the present application;

[0022] Figure 3 A connection block diagram of a detection model is shown according to an embodiment of the present application;

[0023] Figure 4 A flowchart of a multi-task target detection method is shown according to an embodiment of the present application;

[0024] Figure 5 A structure block diagram of a training device of a detection model is shown according to an embodiment of the present application. DETAILED DESCRIPTION

[0025] It should be noted that the embodiments and features of the embodiments in the present application can be combined with each other without conflict. The technical solutions in the embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0026] In order to enable persons skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by persons skilled in the art without creative labor should belong to the scope of protection of the present application.

[0027] It should be noted that the terms "first", "second" and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily limit to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0028] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present application.

[0029] The methods and embodiments provided in this application can be executed on a mobile terminal, computer terminal, or similar computing device. Taking running on a mobile terminal as an example, Figure 1 This is a hardware structure block diagram of a mobile terminal for a training method of a multi-task object detection model according to an embodiment of the present invention. Figure 1 As shown, a mobile terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. The mobile terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0030] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the training method of the multi-task target detection model in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the aforementioned networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. The transmission device 106 is used to receive or send data via a network. Specific examples of the aforementioned networks may include wireless networks provided by the mobile terminal's communication provider. In one example, the transmission device 106 includes a network interface controller (NIC), which can be connected to other network devices via a base station to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0031] A training method of a multi-task object detection model running on a mobile terminal, a computer terminal or the like computing device is provided in the embodiment. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described herein can be executed in an order different from that shown.

[0032] Figure 2 is a flowchart of the training method of the multi-task object detection model according to the embodiment of the present application. The object detection model is applied to identify the category of the target object, such as Figure 2 As shown, the method comprises the following steps:

[0033] Step S201, obtaining a training sample image;

[0034] Specifically, the training sample image in the embodiment can be selected as an X-ray image of an article requiring security check (for example, express, parcel, luggage, etc.).

[0035] Step S202, constructing an object detection model, the object detection model comprising a common backbone network layer and a common bottleneck layer connected in sequence, and a first detection head and a second detection head connected in parallel after the common bottleneck layer, the first detection head being a detection head constructed for a first training set, and the second detection head being a detection head constructed for a second training set;

[0036] That is, the first detection head of the present application is designed for the target detection function of the first training set, and the second detection head is designed for the target detection function of the first training set;

[0037] Among them, the categories of the target detection of the first training set and the second training set are partially the same. For example, there are 10 categories in the first training set, and there are 10 categories in the second training set, and 5 categories in the second training set are the same as the categories in the first training set; that is, when new categories different from the first training set are added, the first training set does not need to be re-labeled;

[0038] Specifically, the object detection model is as shown in Figure 3 The existing object detection model is one training set corresponding to one detection head. The scheme of the present application adds one detection head on the basis of the existing scheme, and the two detection heads share the backbone network layer and the bottleneck layer, so that the object detection model of the present application is applied to multi-task object detection. Further, the detection capability of the object detection model is improved.

[0039] In different security modes, such as railway, aviation, etc., different categories of prohibited items are required for security. When switching security modes, the new category of prohibited items needs to be changed. Only the target detection model of a single detection head needs to be manually labeled with a training set containing a new category. However, the target detection model of the present application can train a new second target detection model, optimize the old first target detection model, and improve the detection ability of the first target detection model without re-labeling the training set containing the new category, such as the second training set. Moreover, the old category training set, such as the first training set, can also act on the new second target detection model together with the second training set without the need for re-labeling.

[0040] In addition, the sample inputs in the first training set and the second training set are input to the shared backbone network layer and the shared bottleneck layer to obtain the feature extraction result of the sample;

[0041] Step S203, input the training sample image into the target detection model, the first detection head outputs the first detection result, and the second detection head outputs the second detection result;

[0042] The training sample image is a training sample image in the first training set or a training sample image in the second training set. Since the target detection model has a first detection head and a second detection head, the corresponding training sample image can output two detection results after being input into the target detection model.

[0043] Step S204, determining the first loss value of the first detection head according to the first detection result, and determining the second loss value of the second detection head according to the second detection result;

[0044] Step S205, using the first loss value and the second loss value for back propagation to adjust the parameters of the target detection model to obtain the trained target detection model.

[0045] More specifically, the first loss value and the second loss value are used for back propagation, and the trained target detection model is obtained when the first loss value and the second loss value converge after repeated iteration.

[0046] The training method of the multi-task target detection model of the present application adds a detection head to the existing target detection model, which can perform multi-task target detection, and optimizes the model according to the first loss value and the second loss value, thereby improving the detection ability of the multi-task target detection model.

[0047] More specifically, the first loss value of the first detection head is determined according to the first detection result, which includes:

[0048] If the classification result of the first detection result is contained in the classification label of the first training set, a first regression loss value and a first classification loss value are obtained based on the first detection result, and the first loss value is determined according to the first regression loss value and the first classification loss value.

[0049] If the classification result of the first detection result is contained in the classification label of the first training set, a first regression loss value and a first classification loss value are obtained based on the first detection result, and the first loss value is determined according to the first regression loss value and the first classification loss value.

[0050] That is, the first loss value obtained in this case is mainly used to optimize the classification and regression tasks of the first detection head and improve the detection accuracy and positioning precision for the first training set.

[0051] Specifically, the first loss value can be represented as: wherein the first classification loss value represents a first classification loss value obtained by inputting the training sample image in the first training set into the first detection head for training, the first regression loss value represents a first regression loss value obtained by inputting the training sample image in the first training set into the first detection head for training.

[0052] More specifically, the second loss value of the second detection head is determined according to the second detection result, comprising:

[0053] If the classification result of the second detection result is contained in the classification label of the first training set, a second regression loss value and a second classification loss value are obtained based on the second detection result, and the second loss value is determined according to the second regression loss value and the second classification loss value.

[0054] If the classification result of the second detection result is contained in the classification label of the first training set, a second regression loss value and a second classification loss value are obtained based on the second detection result, and the second loss value is determined according to the second regression loss value and the second classification loss value.

[0055] Specifically, the second loss value can be represented as: ​a second classification loss value obtained by inputting a training sample image in the first training set to the second detection head for training, a second regression loss value obtained by inputting a training sample image in the first training set to the second detection head for training.

[0056] If the classification result of the second detection result does not belong to the classification label of the first training set, a third regression loss value, a third classification loss value, a first regression loss weight and a first classification loss weight are obtained based on the second detection result, and the second loss value is determined according to the third regression loss value, the third classification loss value, the first regression loss weight and the first classification loss weight.

[0057] In the case that the classification result of the second detection result does not belong to the classification label of the first training set, it indicates that the selected training sample image belongs to the first training set, and the training sample image in the first training set passes through the shared backbone network layer, the shared bottleneck layer and the second detection head to obtain the second detection result, and the classification result of the second detection result does not belong to the classification label of the first training set, for example, the classification result of the second detection result indicates a tool, and the first training set does not have a tool as a class label. In this case, the first regression loss weight and the first classification loss weight will be obtained in addition to the third regression loss value and the third classification loss value. That is, in the case that the classification result of the second detection result does not belong to the classification label of the first training set, the information of the first training set can also be utilized.

[0058] In a more specific embodiment, the third regression loss value, the third classification loss value, the first regression loss weight and the first classification loss weight are obtained based on the second detection result, and the second loss value is determined according to the third regression loss value, the third classification loss value, the first regression loss weight and the first classification loss weight, including:

[0059] The first classification loss weight is obtained based on the confidence of the prediction box.

[0060] To realize the determination of the first classification loss weight, in a specific embodiment, the first classification loss weight is obtained based on the confidence of the prediction box, including:

[0061] In the case that the same classification result is obtained by continuous multiple predictions, the confidence of the classification result obtained by each of the multiple predictions is obtained, an average value of the multiple confidences is obtained, and the average value is determined as the first classification loss weight.

[0062] Specifically, the first classification loss weight is represented as: wherein, The confidence of the i-th classification result is represented, N represents that the same classification result is obtained by continuous N times of prediction; and the similarity with the calibration result is greater than a preset similarity. The continuity of N times ensures stability, and the acquisition manner of the weight can better reflect the quality of the prediction box, further ensuring the accuracy of model training. And such setting can improve the robustness and generalization ability of the model under noise and abnormal conditions.

[0063] The first regression loss weight is obtained based on the intersection over union of the two prediction boxes.

[0064] To realize the determination of the first regression loss weight, in a specific implementation manner: the first regression loss weight is obtained based on the intersection over union of the two prediction boxes, comprising:

[0065] The intersection over union of the regression results obtained by any two times of prediction is obtained, and the first regression loss weight of the pseudo label is determined according to the plurality of intersection over unions.

[0066] Specifically, the first regression loss weight is represented as: IOU(bbox i ,bbox j ) represents the intersection over union of the i-th regression prediction result and the j-th regression prediction result. That is, the loss weight is calculated from the intersection over union of the regression prediction result, and the acquisition manner of the weight can better reflect the regression accuracy of the prediction box, further guiding the training process of the model on the regression task.

[0067] The second detection result includes a classification result and a regression position, a third classification loss value is obtained according to the classification result of the prediction box and the pseudo label, and a third regression loss value is obtained according to the regression position of the prediction box and the pseudo label.

[0068] The second loss value is determined according to the third regression loss value, the third classification loss value, the first regression loss weight and the first classification loss weight.

[0069] Specifically, the second loss value determined according to the third regression loss value, the third classification loss value, the first regression loss weight and the first classification loss weight is represented as:

[0070] weight label represents the first classification loss weight, weight bbox represents the first regression loss weight, represents the third regression loss value represents the third classification loss value,

[0071] Specifically, the third regression loss value is obtained by the specific implementation manner:

[0072] wherein bbox1 represents the regression prediction result of the first prediction in the first N predictions, bbox N represents the regression prediction result of the Nth prediction in the first N predictions, bbox predict represents the regression prediction result of the current prediction.

[0073] It can be seen that the regression loss function is calculated by the first N regression prediction results and the current regression prediction result. This method can better reflect the change trend of the model in the regression task, and can also reduce the influence of mutation, improve the stability and robustness of the model.

[0074] In some specific embodiments, determining the second loss value of the second detection head according to the second detection result comprises:

[0075] If the classification result of the second detection result is contained in the classification label of the second training set, the fourth regression loss value and the fourth classification loss value are obtained based on the second detection result, and the second loss value is determined according to the fourth regression loss value and the fourth classification loss value.

[0076] If the classification result of the second detection result is contained in the classification label of the second training set, the fourth regression loss value and the fourth classification loss value are obtained based on the second detection result, and the second loss value is determined according to the fourth regression loss value and the fourth classification loss value.

[0077] The second loss value obtained by the present scheme is mainly used to optimize the classification and regression tasks of the second detection head, and improve the detection accuracy and positioning precision of the second training set.

[0078] Specifically, the second loss value can be represented as: represents the fourth classification loss value obtained by inputting the training sample in the second training set into the second detection head for training, represents the fourth regression loss value obtained by inputting the training sample in the second training set into the second detection head for training.

[0079] In some specific embodiments, determining the first loss value of the first detection head according to the first detection result comprises:

[0080] If the classification result of the first detection result is contained in the classification label of the second training set, the fifth regression loss value and the fifth classification loss value are obtained based on the first detection result, and the first loss value is determined according to the fifth regression loss value and the fifth classification loss value.

[0081] The classification result of the first detection result is contained in the classification label of the second training set, and the training sample image selected at this time belongs to the second training set. The training sample image in the second training set is input into the shared backbone network layer, the shared bottleneck layer, and the first detection head to obtain the first detection result. The classification result of the first detection result is contained in the classification label of the second training set. For example, the classification result of the first detection result indicates that it is a tool, and the tool is a class label in the second training set. In this case, the fifth regression loss value and the fifth classification loss value are obtained. This setting makes the target detection model focus on the target in the second training set, thereby improving the performance of the model on the second training set, and further achieving the effect of optimizing the detection model.

[0082] Specifically, the first loss value can be represented as: The fifth classification loss value obtained by inputting the training sample image in the first training set into the second detection head for training, The fifth regression loss value obtained by inputting the training sample image in the first training set into the second detection head for training.

[0083] If the classification result of the first detection result is not contained in the classification label of the second training set, the sixth regression loss value, the sixth classification loss value, the second regression loss weight, and the second classification loss weight are obtained based on the first detection result, and the first loss value is determined according to the sixth regression loss value, the sixth classification loss value, the second regression loss weight, and the second classification loss weight.

[0084] In some specific embodiments, the sixth regression loss value, the sixth classification loss value, the second regression loss weight, and the second classification loss weight are obtained based on the first detection result, and the first loss value is determined according to the sixth regression loss value, the sixth classification loss value, the second regression loss weight, and the second classification loss weight, including:

[0085] The second classification loss weight is obtained based on the confidence of the prediction box;

[0086] To achieve the determination of the first classification loss weight, in a specific implementation manner: the first classification loss weight is obtained based on the confidence of the prediction box, including:

[0087] In the case of obtaining the same classification result through continuous multiple predictions, the confidence of the classification result obtained each time in the multiple predictions is obtained, an average value of the multiple confidences is obtained, and the average value is determined as the second classification loss weight.

[0088] The second regression loss weight is obtained based on the intersection over union of two prediction boxes;

[0089] To achieve the determination of the second regression loss weight, in a specific implementation manner: based on the intersection over union of the two predicted bounding boxes, the second regression loss weight is obtained, including:

[0090] The intersection over union of the regression results obtained in any two of the multiple predictions is obtained, and the second regression loss weight of the pseudo label is determined according to the multiple intersection over unions.

[0091] The first detection result includes a classification result and a regression position, a sixth classification loss value is obtained according to the classification result of the predicted bounding box and the pseudo label, and a sixth regression loss value is obtained according to the regression position of the predicted bounding box and the pseudo label.

[0092] The first loss value is determined according to the sixth regression loss value, the sixth classification loss value, the second regression loss weight and the second classification loss weight.

[0093] In the embodiment, the implementation principle of obtaining the sixth regression loss value, the sixth classification loss value, the second regression loss weight and the second classification loss weight based on the first detection result, and determining the first loss value according to the sixth regression loss value, the sixth classification loss value, the second regression loss weight and the second classification loss weight is the same as: obtaining the third regression loss value, the third classification loss value, the first regression loss weight and the first classification loss weight based on the second detection result, and determining the second loss value according to the third regression loss value, the third classification loss value, the first regression loss weight and the first classification loss weight.

[0094] In some specific implementation manners, the first loss value and the second loss value are used for back propagation to adjust the parameters of the target detection model to obtain a trained target detection model, including:

[0095] The parameters of the target detection model include the parameters in the shared backbone network layer and the shared bottleneck layer, the parameters in the first detection head, and the parameters in the second detection head.

[0096] The first loss value is used for back propagation to the first detection head to adjust the parameters in the first detection head.

[0097] The second loss value is used for back propagation to the first detection head to adjust the parameters in the second detection head.

[0098] To achieve the adjustment of the parameters of the target detection model, the first loss value is used for back propagation to the first detection head to adjust the parameters in the first detection head, and the second loss value is used for back propagation to the first detection head to adjust the parameters in the second detection head. The precise training of the first detection head and the second detection head can be realized.

[0099] The first loss value and the second loss value are used for back propagation to the shared backbone network layer and the shared bottleneck layer to adjust the parameters in the shared backbone network layer and the parameters in the shared bottleneck layer.

[0100] That is, the first loss value and the second loss value are used to jointly back-propagate the shared backbone network layer and the shared bottleneck layer to adjust the parameters in the shared backbone network layer and the parameters in the shared bottleneck layer.

[0101] It should be noted that when the first loss value and the second loss value are used for back-propagation, the parameters in the first detection head and the parameters in the second detection head are also adjusted, but the finally selected parameters in the first detection head are still the parameters obtained by back-propagating the first loss value only to the first detection head, and the finally selected parameters in the second detection head are still the parameters obtained by back-propagating the second loss value only to the second detection head.

[0102] In some more specific embodiments, the first loss value and the second loss value are used to back-propagate the shared backbone network layer and the shared bottleneck layer to adjust the parameters in the shared backbone network layer and the parameters in the shared bottleneck layer, including:

[0103] According to the first loss value and the second loss value, a first influence factor and a second influence factor are obtained;

[0104] According to the first influence factor, the second influence factor, the first loss value and the second loss value, a third loss value is obtained;

[0105] Wherein, the third loss value can be represented as: loss3=A1*loss1+A2*loss2. Wherein, loss3 represents the third loss value, A1 represents the first influence factor, which can be represented as A2 represents the second influence factor, which can be represented as loss1 represents the first loss value, and loss2 represents the second loss value.

[0106] According to the third loss value, the shared backbone network layer and the shared bottleneck layer are back-propagated to adjust the parameters in the shared backbone network layer and the parameters in the shared bottleneck layer.

[0107] That is, the first loss value and the second loss value are weighted to obtain a third loss value, and then the third loss value is used to back-propagate the shared backbone network layer and the shared bottleneck layer to adjust the parameters in the shared backbone network layer and the parameters in the shared bottleneck layer. Since the third loss value considers the influence of the first loss value and the influence of the second loss value, the adjusted parameters in the shared backbone network layer and the parameters in the shared bottleneck layer are more suitable for multi-task detection, and the detection capability of the target detection model of the present application is improved. Specifically, different loss values are used to jointly adjust the parameters in the shared backbone network layer and the parameters in the shared bottleneck layer, so that the entire target detection model can better balance different task requirements and training efficiency, and improve the overall performance of the detection model.

[0108] Figure 4 is a flow chart of a multi-task target detection method according to an embodiment of the present application. A multi-task target detection method comprises the following steps:

[0109] Step S401: obtaining a to-be-detected image;

[0110] Step S402: inputting the to-be-detected image into a trained target detection model to obtain a target detection result of a target object in the to-be-detected image, wherein the to-be-detected image is an image containing the target object.

[0111] In the embodiment, the to-be-detected image can be an X-ray image of an article requiring security check (for example, express delivery, package, luggage, etc.), and the target object can be contraband.

[0112] The trained target detection model used in the multi-task target detection method of the present application adds a detection head to the existing target detection model, can perform multi-task target detection, and optimizes the model according to the first loss value and the second loss value, thereby improving the detection capability of the multi-task target detection model. The use of the trained target detection model makes the obtained target detection result more accurate, and can realize the classification recognition of multiple target objects.

[0113] The embodiment of the present application further provides a multi-task target detection model training device. It should be noted that the multi-task target detection model training device of the embodiment of the present application can be used to execute the multi-task target detection model training method provided by the embodiment of the present application. The device is used to implement the above-mentioned embodiments and preferred embodiments, and will not be described again. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware can also be implemented and conceived.

[0114] The multi-task target detection model training device provided by the embodiment of the present application is described below.

[0115] Figure 5 is a schematic diagram of a multi-task target detection model training device according to an embodiment of the present application. The target detection model is applied to identify the category of a target object, such as Figure 5 As shown in the figure, the device comprises:

[0116] The obtaining unit 51 is configured to obtain a training sample image.

[0117] The constructing unit 52 is configured to construct a target detection model, the target detection model comprising a shared backbone network layer and a shared bottleneck layer connected in sequence, and a first detection head and a second detection head connected in parallel after the shared bottleneck layer, the first detection head being a detection head constructed for a first training set, and the second detection head being a detection head constructed for a second training set;

[0118] The detecting unit 53 is configured to input a training sample image into the target detection model, the first detection head outputting a first detection result, and the second detection head outputting a second detection result.

[0119] The determining unit 54 is configured to determine a first loss value of the first detection head according to the first detection result, and determine a second loss value of the second detection head according to the second detection result.

[0120] The back propagation unit 55 is configured to perform back propagation using the first loss value and the second loss value to adjust parameters of the target detection model, to obtain a trained target detection model.

[0121] The training device of the multi-task target detection model of the present application adds a detection head to an existing target detection model, can perform multi-task target detection, and optimizes the model according to the first loss value and the second loss value, so that the first training set not only acts on the first detection head but also optimizes the target detection model, and the second training set not only acts on the second detection head but also optimizes the target detection model, and meanwhile, the detection capability of a network comprising the shared backbone network layer, the shared bottleneck layer and the first detection head can be improved.

[0122] In the embodiment of the present application, the determining unit is further configured to, if the classification result of the first detection result is contained in the classification label of the first training set, obtain a first regression loss value and a first classification loss value based on the first detection result, and determine the first loss value according to the first regression loss value and the first classification loss value.

[0123] In the embodiment of the present application, the determining unit comprises a first determining module and a second determining module, the first determining module is configured to, if the classification result of the second detection result is contained in the classification label of the first training set, obtain a second regression loss value and a second classification loss value based on the second detection result, and determine the second loss value according to the second regression loss value and the second classification loss value; and the second determining module is configured to, if the classification result of the second detection result is not contained in the classification label of the first training set, obtain a third regression loss value, a third classification loss value, a first regression loss weight and a first classification loss weight based on the second detection result, and determine the second loss value according to the third regression loss value, the third classification loss value, the first regression loss weight and the first classification loss weight.

[0124] In this embodiment, the second determining module includes a first determining submodule, a second determining submodule, a third determining submodule, and a fourth determining submodule. The first determining submodule is used to obtain a first classification loss weight based on the confidence of the predicted bounding box; the second determining submodule is used to obtain a first regression loss weight based on the intersection-union ratio of two predicted bounding boxes; the third determining submodule is used to obtain a third classification loss value based on the classification result of the predicted bounding box and the pseudo-label, and a third regression loss value based on the regression position of the predicted bounding box and the pseudo-label, in the second detection result including the classification result and the regression position; the fourth determining submodule is used to determine a second loss value based on the third regression loss value, the third classification loss value, the first regression loss weight, and the first classification loss weight.

[0125] In this embodiment of the application, the determining unit is further configured to obtain a fourth regression loss value and a fourth classification loss value based on the second detection result if the classification result of the second detection result is included in the classification label of the second training set, and determine the second loss value based on the fourth regression loss value and the fourth classification loss value.

[0126] In this embodiment of the application, the determining unit includes a third determining module and a fourth determining module. If the classification result of the first detection result is included in the classification label of the second training set, the third determining module obtains a fifth regression loss value and a fifth classification loss value based on the first detection result, and determines a first loss value based on the fifth regression loss value and the fifth classification loss value. The fourth determining module is used to obtain a sixth regression loss value, a sixth classification loss value, a second regression loss weight, and a second classification loss weight based on the first detection result if the classification result of the first detection result is not included in the classification label of the second training set, and determines a first loss value based on the sixth regression loss value, the sixth classification loss value, the second regression loss weight, and the second classification loss weight.

[0127] In this embodiment of the application, the fourth determining module further includes a fifth determining submodule, a sixth determining submodule, a seventh determining submodule, and an eighth determining submodule. The fifth determining submodule is used to obtain the second classification loss weight based on the confidence of the predicted box; the sixth determining submodule is used to obtain the second regression loss weight based on the intersection-union ratio of the two predicted boxes; the seventh determining submodule is used to obtain the sixth classification loss value based on the classification result of the predicted box and the pseudo-label, and the sixth regression loss value based on the regression position of the predicted box and the pseudo-label, based on the first detection result including the classification result and the regression position; the eighth determining submodule is used to determine the first loss value based on the sixth regression loss value, the sixth classification loss value, the second regression loss weight, and the second classification loss weight.

[0128] In this embodiment, the parameters of the target detection model include parameters in the shared backbone network layer and the shared bottleneck layer, parameters in the first detection head, and parameters in the second detection head. The backpropagation unit includes a first backpropagation module, a second backpropagation module, and a third backpropagation module. The first backpropagation module is used to backpropagate the first detection head using a first loss value to adjust the parameters in the first detection head. The second backpropagation module is used to backpropagate the first detection head using a second loss value to adjust the parameters in the second detection head. The third backpropagation module is used to backpropagate the shared backbone network layer and the shared bottleneck layer using the first loss value and the second loss value to adjust the parameters in the shared backbone network layer and the shared bottleneck layer.

[0129] In this embodiment, the third backpropagation module includes a first processing submodule, a second processing submodule, and a third processing submodule. The first processing submodule is used to obtain a first influence factor and a second influence factor based on a first loss value and a second loss value. The second processing submodule is used to obtain a third loss value based on the first influence factor, the second influence factor, the first loss value, and the second loss value. The third processing submodule is used to perform backpropagation on the shared backbone network layer and the shared bottleneck layer based on the third loss value to adjust the parameters in the shared backbone network layer and the parameters in the shared bottleneck layer.

[0130] The training device for the aforementioned multi-task object detection model includes a processor and a memory. The acquisition unit and construction unit, among others, are stored as program units in the memory. The processor executes these program units stored in the memory to implement their respective functions. All of the above modules reside in the same processor; alternatively, the modules may be located in different processors in any combination.

[0131] The processor contains a kernel, which retrieves the corresponding program units from memory. One or more kernels can be configured, and adjusting kernel parameters can address the problem in existing model training methods where a training set is only applied to one object detection model.

[0132] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0133] This invention provides a computer-readable storage medium including a stored program, wherein, when the program is executed, it controls the device where the computer-readable storage medium is located to execute the training method of the detection model.

[0134] Specifically, the training methods for multi-task object detection models include:

[0135] Step S201: Obtain training sample images;

[0136] Step S202: Construct an object detection model. The object detection model includes a shared backbone network layer and a shared bottleneck layer connected in sequence, and a first detection head and a second detection head connected in parallel after the shared bottleneck layer. The first detection head is a detection head constructed for a first training set, and the second detection head is a detection head constructed for a second training set.

[0137] Step S203: Input the training sample image into the target detection model, the first detection head outputs a first detection result, and the second detection head outputs a second detection result;

[0138] Step S204: Determine the first loss value of the first detection head based on the first detection result, and determine the second loss value of the second detection head based on the second detection result;

[0139] Step S205: Backpropagation is performed using the first loss value and the second loss value to adjust the parameters of the target detection model and obtain the trained target detection model.

[0140] This invention provides a processor for running a program, wherein the program executes the training method of the multi-task object detection model.

[0141] This invention provides an electronic device, characterized by comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs include a training method for executing any one of the multi-task object detection models. The device described herein may be a server, PC, PAD, mobile phone, etc.

[0142] It is obvious to those skilled in the art that the modules or steps of the present invention described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those described herein, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any particular combination of hardware and software.

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

[0144] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0145] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0146] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0147] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

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

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

[0150] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0151] As can be seen from the above description, the embodiments of this application achieve the following technical effects:

[0152] 1) When the category of the training sample image is changed, the detection model of this application can train a new second object detection model without recalibrating the second training set, optimize the old first object detection model, and improve the detection capability of the first object detection model; and the first training set can also work together with the second training set to create a new second object detection model without recalibrating manually.

[0153] 2) The training method of the above-mentioned detection model in this application adds a new detection head on the basis of the existing target detection model, which can perform multi-task target detection. At the same time, the model is optimized according to the first loss value and the second loss value, so that the first loss value optimizes the first detection head and the second loss value optimizes the second detection head. Furthermore, the first loss value and the second loss value are used with different weights to participate in the optimization of the shared backbone network layer and the shared bottleneck layer, thereby improving the detection capability of the target detection model.

[0154] 3) The training device of the above-mentioned detection model of this application adds a new detection head on the basis of the existing target detection model, which can perform multi-task target detection. At the same time, the model is optimized according to the first loss value and the second loss value, so that the first loss value optimizes the first detection head and the second loss value optimizes the second detection head. Furthermore, the first loss value and the second loss value are used with different weights to participate in the optimization of the shared backbone network layer and the shared bottleneck layer, thereby improving the detection capability of the target detection model.

[0155] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A training method for a multi-task object detection model, characterized in that, The target detection model is used to identify the category of target objects, including: Obtain training sample images; A target detection model is constructed, comprising a shared backbone network layer and a shared bottleneck layer connected in sequence, and a first detection head and a second detection head connected in parallel after the shared bottleneck layer. The first detection head is a detection head constructed for a first training set, and the second detection head is a detection head constructed for a second training set. The training sample image is input into the target detection model, the first detection head outputs a first detection result, and the second detection head outputs a second detection result; A first loss value of the first detection head is determined based on the first detection result, and a second loss value of the second detection head is determined based on the second detection result. Backpropagation is performed using the first loss value and the second loss value to adjust the parameters of the object detection model, resulting in a trained object detection model. Determining the first loss value of the first detection head based on the first detection result includes: if the classification result of the first detection result is included in the classification label of the first training set, then obtaining a first regression loss value and a first classification loss value based on the first detection result, and determining the first loss value based on the first regression loss value and the first classification loss value. Determining the second loss value of the second detection head based on the second detection result includes: if the classification result of the second detection result is included in the classification label of the first training set, then a second regression loss value and a second classification loss value are obtained based on the second detection result, and the second loss value is determined based on the second regression loss value and the second classification loss value; if the classification result of the second detection result is not included in the classification label of the first training set, then a third regression loss value, a third classification loss value, a first regression loss weight, and a first classification loss weight are obtained based on the second detection result, and the second loss value is determined based on the third regression loss value, the third classification loss value, the first regression loss weight, and the first classification loss weight. The step of obtaining a third regression loss value, a third classification loss value, a first regression loss weight, and a first classification loss weight based on the second detection result, and determining the second loss value based on the third regression loss value, the third classification loss value, the first regression loss weight, and the first classification loss weight, includes: obtaining the first classification loss weight based on the confidence of the predicted bounding box; obtaining the first regression loss weight based on the intersection-union ratio of two predicted bounding boxes; the second detection result includes a classification result and a regression position; obtaining a third classification loss value based on the classification result of the predicted bounding box and the pseudo-label; obtaining a third regression loss value based on the regression position of the predicted bounding box and the pseudo-label; and determining the second loss value based on the third regression loss value, the third classification loss value, the first regression loss weight, and the first classification loss weight.

2. The method according to claim 1, characterized in that, Determining the second loss value of the second detection head based on the second detection result includes: If the classification result of the second detection result is included in the classification label of the second training set, then a fourth regression loss value and a fourth classification loss value are obtained based on the second detection result, and the second loss value is determined according to the fourth regression loss value and the fourth classification loss value.

3. The method according to claim 2, characterized in that, Determining the first loss value of the first detection head based on the first detection result includes: If the classification result of the first detection result is included in the classification label of the second training set, the fifth regression loss value and the fifth classification loss value are obtained based on the first detection result, and the first loss value is determined according to the fifth regression loss value and the fifth classification loss value. If the classification result of the first detection result is not included in the classification label of the second training set, then the sixth regression loss value, the sixth classification loss value, the second regression loss weight, and the second classification loss weight are obtained based on the first detection result, and the first loss value is determined according to the sixth regression loss value, the sixth classification loss value, the second regression loss weight, and the second classification loss weight.

4. The method according to claim 3, characterized in that, The process of obtaining a sixth regression loss value, a sixth classification loss value, a second regression loss weight, and a second classification loss weight based on the first detection result, and determining the first loss value based on the sixth regression loss value, the sixth classification loss value, the second regression loss weight, and the second classification loss weight, includes: The second classification loss weights are obtained based on the confidence of the predicted bounding box; The second regression loss weight is obtained based on the intersection-union ratio of the two predicted boxes; The first detection result includes classification result and regression position. The sixth classification loss value is obtained based on the classification result of the predicted box and pseudo label, and the sixth regression loss value is obtained based on the regression position of the predicted box and pseudo label. The first loss value is determined based on the sixth regression loss value, the sixth classification loss value, the second regression loss weight, and the second classification loss weight.

5. The method according to claim 1, characterized in that, The step of backpropagating using the first loss value and the second loss value to adjust the parameters of the target detection model and obtain the trained target detection model includes: The parameters of the target detection model include the parameters in the shared backbone network layer and the shared bottleneck layer, the parameters in the first detection head, and the parameters in the second detection head; The first detection head is backpropagated using a first loss value to adjust the parameters in the first detection head; The first detection head is backpropagated using the second loss value to adjust the parameters in the second detection head; Backpropagation is performed on the shared backbone network layer and the shared bottleneck layer using a first loss value and a second loss value to adjust the parameters in the shared backbone network layer and the shared bottleneck layer.

6. The method according to claim 5, characterized in that, The step of backpropagating the shared backbone network layer and the shared bottleneck layer using a first loss value and a second loss value to adjust the parameters in the shared backbone network layer and the shared bottleneck layer includes: The first influence factor and the second influence factor are obtained based on the first loss value and the second loss value; A third loss value is obtained based on the first impact factor, the second impact factor, the first loss value, and the second loss value; Backpropagation is performed on the shared backbone network layer and the shared bottleneck layer based on the third loss value to adjust the parameters in the shared backbone network layer and the shared bottleneck layer.

7. A multi-task target detection method, characterized in that, include: Acquire the image to be detected; The image to be detected is input into the trained target detection model according to any one of claims 1-6 to obtain the target detection result of the target object in the image to be detected, wherein the image to be detected is an image containing the target object.

8. A training device for a multi-task target detection model, characterized in that, The target detection model is used to identify the category of target objects, including: The acquisition unit is used to acquire training sample images; A construction unit is used to construct an object detection model. The object detection model includes a shared backbone network layer and a shared bottleneck layer connected in sequence, and a first detection head and a second detection head connected in parallel after the shared bottleneck layer. The first detection head is a detection head constructed for a first training set, and the second detection head is a detection head constructed for a second training set. The detection unit is used to input the training sample image into the target detection model, the first detection head outputs the first detection result, and the second detection head outputs the second detection result; A determining unit is configured to determine a first loss value of a first detection head based on a first detection result, and to determine a second loss value of a second detection head based on a second detection result; The backpropagation unit is used to perform backpropagation using a first loss value and a second loss value to adjust the parameters of the object detection model, thereby obtaining the trained object detection model. The determining unit is further configured to, if the classification result of the first detection result is contained in the classification label of the first training set, obtain a first regression loss value and a first classification loss value based on the first detection result, and determine the first loss value based on the first regression loss value and the first classification loss value. The determining unit includes a first determining module and a second determining module. The first determining module is used to obtain a second regression loss value and a second classification loss value based on the second detection result if the classification result of the second detection result is included in the classification label of the first training set, and to determine the second loss value based on the second regression loss value and the second classification loss value. The second determining module is used to obtain a third regression loss value, a third classification loss value, a first regression loss weight, and a first classification loss weight based on the second detection result if the classification result of the second detection result is not included in the classification label of the first training set, and to determine the second loss value based on the third regression loss value, the third classification loss value, the first regression loss weight, and the first classification loss weight. The second determining module includes a first determining submodule, a second determining submodule, a third determining submodule, and a fourth determining submodule. The first determining submodule is used to obtain the first classification loss weight based on the confidence of the predicted bounding box; the second determining submodule is used to obtain the first regression loss weight based on the intersection-union ratio of two predicted bounding boxes; the third determining submodule is used to obtain a third classification loss value based on the classification result of the predicted bounding box and the pseudo-label, and a third regression loss value based on the regression position of the predicted bounding box and the pseudo-label, in the second detection result including the classification result and the regression position; the fourth determining submodule is used to determine a second loss value based on the third regression loss value, the third classification loss value, the first regression loss weight, and the first classification loss weight.

9. An electronic device, characterized in that, include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including a training method for performing a multi-task object detection model according to any one of claims 1 to 6.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the training method for the multi-task object detection model as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Object recognition method and device

    CN110298262A