Training method, target detection method and device, equipment and medium

Through collaborative training and dynamic label allocation, the problem of low knowledge transfer efficiency in the target detection model is solved, the detection accuracy is improved, and more efficient knowledge transfer and accurate target detection are achieved.

CN118799666APending Publication Date: 2024-10-18SHENZHEN MICROBT ELECTRONICS TECH CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202310414059.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-04-11
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

In the knowledge distillation process of existing target detection models, there are conflicts in the label allocation paths between the teacher model and the student model, which results in low efficiency of knowledge transfer and affects detection accuracy.

Method used

Through the collaborative training method, image samples are input into the teacher model and the student model, the category labels are determined using the dynamic label allocation method, the fusion loss information is constructed based on the detection results, and the model parameters are updated to improve knowledge transfer efficiency and detection accuracy.

Benefits of technology

It improves the efficiency of knowledge transfer from the teacher model to the student model, improves the target detection accuracy of the student model, and improves the matching of the label distribution path by aligning the anchor box center point.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118799666A_ABST
    Figure CN118799666A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a training method and device, a target detection method and device, equipment and a medium, and the training method specifically comprises the steps: inputting an image sample into a teacher model and a student model, so as to obtain a first detection result outputted by the teacher model, and a second detection result outputted by the student model; determining a first category label and a second category label by utilizing a dynamic label distribution mode; determining first loss information according to the first category label and the first detection result, and updating parameters of the teacher model; determining second loss information according to the second category label and the second detection result; determining third loss information according to the first detection result and the second detection result; and updating parameters of the student model according to fusion loss information formed by the second loss information and the third loss information. According to the embodiment of the invention, the knowledge transmission efficiency from the teacher model to the student model can be improved, and the target detection precision of the student model can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of target detection technology, and in particular to a training method, a target detection method, a device, a equipment and a medium. Background Art

[0002] Object detection technology is widely used in monitoring scenarios (such as traffic monitoring, financial monitoring, and industrial monitoring). Taking the traffic monitoring scenario as an example, monitoring equipment installed on the road is used to obtain a video of a period of time on the road, and then object detection is performed on the video to obtain the object detection result; based on the object detection result, the trajectory of the object (vehicle, pedestrian, etc.) on the road, the category of the object, and the target flow of the road can be counted.

[0003] At present, most target detection methods are implemented based on target detection models. Applying knowledge distillation technology to the training of target detection models can achieve better detection accuracy with less storage and computing overhead. Specifically, knowledge distillation technology trains a large target detection model (teacher model) in the first stage, and then uses the knowledge learned by the teacher model to train a small target detection model (student model) in the second stage, thereby transferring the knowledge learned by the teacher model to the network structure of the student model, and finally using the student model for the target detection process.

[0004] In practical applications, the target detection model can adopt a dynamic label assignment method. In this way, in the first stage, the corresponding first label assignment path can be learned for the teacher model, and in the second stage, the corresponding second label assignment path can be learned for the student model; because the teacher model and the student model contain different parameter quantities, there is a conflict between the first label assignment path and the second label assignment path, resulting in low efficiency in knowledge transfer. Summary of the invention

[0005] The embodiment of the present application provides a method for training a target detection model, which can improve the efficiency of knowledge transfer from a teacher model to a student model, and can improve the target detection accuracy of the student model.

[0006] Accordingly, an embodiment of the present application also provides a training device for a target detection model, a target detection method, a target detection device, an electronic device and a machine-readable medium to ensure the implementation and application of the above method.

[0007] In order to solve the above problems, the embodiment of the present application discloses a method for training a target detection model, wherein the target detection model includes: a teacher model and a student model, and the method includes:

[0008] Inputting the image samples into the teacher model and the student model respectively to obtain a first detection result output by the teacher model and a second detection result output by the student model;

[0009] Using a dynamic label assignment method, according to the first detection result, a first category label corresponding to a first image area in the image sample is determined; and using a dynamic label assignment method, according to the second detection result, a second category label corresponding to a second image area in the image sample is determined; the first category label is used to characterize a positive sample or a negative sample of a preset category corresponding to the first image area; the second category label is used to characterize a positive sample or a negative sample of a preset category corresponding to the second image area;

[0010] Determine first loss information according to the first category label and the first detection result, and update the parameters of the teacher model according to the first loss information;

[0011] Determine second loss information based on the second category label and the second detection result; determine third loss information based on the first detection result and the second detection result; and update the parameters of the student model based on the fusion loss information formed by the second loss information and the third loss information.

[0012] In order to solve the above problems, an embodiment of the present application discloses a target detection method, which includes:

[0013] Receiving an image to be detected;

[0014] Using the student model included in the target detection model, target detection is performed on the image to be detected to obtain a corresponding detection result;

[0015] Outputting the detection result;

[0016] Among them, the target detection model also includes: a teacher model, and the training process of the target detection model includes: inputting image samples into the teacher model and the student model respectively to obtain a first detection result output by the teacher model and a second detection result output by the student model; using a dynamic label allocation method, according to the first detection result, determining a first category label corresponding to the first image area in the image sample, and, using a dynamic label allocation method, according to the second detection result, determining a second category label corresponding to the second image area in the image sample; the first category label is used to characterize a positive sample or a negative sample of a preset category corresponding to the first image area; the second category label is used to characterize a positive sample or a negative sample of a preset category corresponding to the second image area; according to the first category label and the first detection result, determining first loss information, and according to the first loss information, updating the parameters of the teacher model; according to the second category label and the second detection result, determining second loss information; according to the first detection result and the second detection result, determining third loss information; and according to the fusion loss information composed of the second loss information and the third loss information, updating the parameters of the student model.

[0017] In order to solve the above problems, the embodiment of the present application discloses a training device for a target detection model, wherein the target detection model includes: a teacher model and a student model, and the device includes:

[0018] A model processing module, used for inputting image samples into a teacher model and a student model respectively, so as to obtain a first detection result output by the teacher model and a second detection result output by the student model;

[0019] A first category label determination module, configured to determine a first category label corresponding to a first image region in the image sample according to the first detection result by using a dynamic label allocation method;

[0020] A second category label determination module is used to determine, according to the second detection result, a second category label corresponding to the second image area in the image sample by using a dynamic label allocation method; the first category label is used to characterize a positive sample or a negative sample of a preset category corresponding to the first image area; the second category label is used to characterize a positive sample or a negative sample of a preset category corresponding to the second image area;

[0021] a first parameter processing module, configured to determine first loss information according to the first category label and the first detection result, and to update parameters of the teacher model according to the first loss information;

[0022] The second parameter processing module is used to determine the second loss information according to the second category label and the second detection result; determine the third loss information according to the first detection result and the second detection result; and update the parameters of the student model according to the fusion loss information composed of the second loss information and the third loss information.

[0023] Optionally, the first category label determination module includes:

[0024] a loss and parallel-intersection ratio determination module, configured to determine fourth loss information and first parallel-intersection ratio information according to a first detection result corresponding to the first image region and information of a real region, wherein the information of the real region corresponds to a preset category;

[0025] A positive sample quantity determination module, used to determine the number of positive samples corresponding to the real area according to the first parallel-cross ratio information;

[0026] A selection module, configured to select, from the first image area in the image samples, a first target image area that meets the number of positive samples according to the fourth loss information in ascending order;

[0027] A positive and negative sample label determination module is used to determine the first category label corresponding to the first target image area as the positive sample label corresponding to the preset category, and to determine the first category label corresponding to the first image area in the image sample other than the first target image area as the negative sample label corresponding to the preset category.

[0028] Optionally, the detection result corresponding to the first detection result or the second detection result includes at least one of the following information:

[0029] Category probability information that the pixel points in the image sample belong to a preset category;

[0030] Area location information of image areas belonging to a preset category in the image sample; and

[0031] The foreground probability information of the pixel points in the image sample belonging to the foreground of the image.

[0032] Optionally, the first detection result includes: first category probability information, and / or first region location information, and / or first foreground probability information; the first parameter processing module includes:

[0033] a first loss determination module, configured to determine corresponding first cross entropy category loss information according to the first category probability information and the first category label; and / or

[0034] a second loss determination module, configured to determine corresponding first cross entropy foreground loss information according to the first foreground probability information and the first category label; and / or

[0035] The third loss determination module is used to determine the corresponding first parallel-crossover ratio loss information according to the first area position information and the position information corresponding to the first category label.

[0036] Optionally, the first detection result includes: first area location information, the second detection result includes: second area location information; the second parameter processing module includes:

[0037] a conversion module, configured to convert the first area position information into a first boundary probability value, and convert the second area position information into a second boundary probability value;

[0038] a normalization module, configured to normalize the first boundary probability value into a first normalized boundary probability value, and normalize the second boundary probability value into a second normalized boundary probability value;

[0039] A relative entropy operation module is used to perform a relative entropy operation according to the first normalized boundary probability value and the second normalized boundary probability value to obtain the third loss information.

[0040] The embodiment of the present application further discloses an electronic device, including: a processor; and a memory, on which executable code is stored. When the executable code is executed, the processor executes the method described in the embodiment of the present application.

[0041] The embodiment of the present application further discloses a machine-readable medium on which executable code is stored. When the executable code is executed, a processor executes the method described in the embodiment of the present application.

[0042] The embodiments of the present application include the following advantages:

[0043] The embodiment of the present application uses image samples to collaboratively train the teacher model and the student model. During the collaborative training process, the teacher model and the student model are supervised by their respective category labels to generate corresponding first loss information and second loss information. At the same time, the first detection result of the teacher model is also used as the supervision information of the second detection result of the student model to generate corresponding third loss information. The first detection result of the above-mentioned teacher model is also used as the supervision information of the second detection result of the student model, so that the student model can align the center point of the anchor frame of the teacher model as the target. Therefore, the embodiment of the present application can improve the matching degree between the first label allocation path and the center point of the anchor frame contained in the second label allocation path. Therefore, the embodiment of the present application can improve the efficiency of knowledge transfer from the teacher model to the student model.

[0044] Moreover, while improving the efficiency of knowledge transfer from the teacher model to the student model, the embodiments of the present application can improve the target detection accuracy of the student model. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 It is a schematic diagram of the steps of a method for training a target detection model according to an embodiment of the present application;

[0046] Figure 2 is a schematic diagram of the structure of a target detection model according to an embodiment of the present application;

[0047] Figure 3 It is a flowchart of a method for training a target detection model according to an embodiment of the present application;

[0048] Figure 4 This is a schematic diagram of the steps of a target detection method according to an embodiment of the present application;

[0049] Figure 5 It is a structural block diagram of a training device for a target detection model according to an embodiment of the present application;

[0050] Figure 6 is a structural block diagram of a target detection device according to an embodiment of the present application;

[0051] Figure 7 It is a schematic diagram of the structure of a device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0052] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0053] In the embodiment of the present application, the target detection technology can detect whether the image to be detected contains pedestrians and other targets. If so, the location information of the pedestrians and other targets can be provided. The targets can include pedestrians, vehicles, animals and other objects. It can be understood that the embodiment of the present application does not limit the specific targets to be detected.

[0054] The embodiments of the present application can be applied to various application scenarios such as traffic monitoring scenarios, financial monitoring scenarios, industrial monitoring scenarios, etc. Taking the traffic monitoring scenario as an example, a video of a period of time on the road is obtained through monitoring equipment deployed on the road, and target detection is performed on the video to obtain target detection results; based on the target detection results, the trajectory of the target (vehicle, pedestrian, etc.) on the road and the category of the target can be determined, and the target flow of the road can also be counted.

[0055] At present, most target detection methods are implemented based on target detection models. Applying knowledge distillation technology to the training of target detection models can achieve better detection accuracy with less storage and computing overhead.

[0056] Among them, knowledge distillation technology can transfer the knowledge of one network model to another network model, and the two network models can be isomorphic or heterogeneous. Specifically, knowledge distillation technology trains a large target detection model (teacher model) in the first stage, and then uses the knowledge learned by the teacher model to train a small target detection model (student model) in the second stage, thereby transferring the knowledge learned by the teacher model to the network structure of the student model, and finally using the student model for the target detection process.

[0057] In practical applications, the target detection model can adopt a dynamic label allocation method. The dynamic label allocation method can be used to dynamically determine the category label corresponding to the image area in the image sample during the training process. The category label can be used to characterize the positive sample or negative sample of the image area corresponding to the preset category. The preset category can be any category in the category range. The category range can characterize the category range corresponding to the target that the target detection model can detect. The category range can include: C preset categories, where C is usually a positive integer greater than 1.

[0058] The current related technologies usually obtain the corresponding first label assignment path for the teacher model in the first stage, and obtain the corresponding second label assignment path for the student model in the second stage. Since the teacher model and the student model contain different parameter quantities, there is a conflict between the first label assignment path and the second label assignment path. For example, the center points of the anchor boxes contained in the first label assignment path and the second label assignment path are different, which easily leads to low efficiency in knowledge transfer. Among them, the anchor box can be a bounding box for fitting a real box of a preset category. It can be a rectangular box of a preset size and a preset aspect ratio generated with a pixel in the image as the center, which is pre-set. The preset size can be multiple, and the preset aspect ratio can also be multiple. The target detection model can determine whether the anchor box contains a target of a preset category. If so, it predicts the offset between the anchor box and the real box.

[0059] In response to the technical problem of low efficiency in knowledge transfer in related technologies, an embodiment of the present application provides a method for training a target detection model, wherein the target detection model specifically includes: a teacher model and a student model, and the method specifically may include: inputting image samples into the teacher model and the student model respectively to obtain a first detection result output by the teacher model and a second detection result output by the student model; using a dynamic label assignment method to determine, according to the first detection result, a first category label corresponding to a first image area in the image sample, and, using a dynamic label assignment method, according to the second detection result, determining, according to the second detection result, a second category label corresponding to a second image area in the image sample A second category label; the first category label is used to characterize the positive sample or negative sample of the preset category corresponding to the first image area; the second category label is used to characterize the positive sample or negative sample of the preset category corresponding to the second image area; according to the first category label and the first detection result, the first loss information is determined, and according to the first loss information, the parameters of the teacher model are updated; according to the second category label and the second detection result, the second loss information is determined; according to the first detection result and the second detection result, the third loss information is determined; and according to the fusion loss information formed by the second loss information and the third loss information, the parameters of the student model are updated.

[0060] The embodiment of the present application uses image samples to collaboratively train the teacher model and the student model. During the collaborative training process, the teacher model and the student model are supervised by their respective category labels to generate corresponding first loss information and second loss information. At the same time, the first detection result of the teacher model is also used as the supervision information of the second detection result of the student model to generate corresponding third loss information. The first detection result of the above-mentioned teacher model is also used as the supervision information of the second detection result of the student model, so that the student model can align the center point of the anchor frame of the teacher model as the target. Therefore, the embodiment of the present application can improve the matching degree between the first label allocation path and the center point of the anchor frame contained in the second label allocation path. Therefore, the embodiment of the present application can improve the efficiency of knowledge transfer from the teacher model to the student model.

[0061] Method Example 1

[0062] Reference Figure 1 , shows a flowchart of a method for training a target detection model according to an embodiment of the present application, wherein the target detection model specifically includes: a teacher model and a student model, and the method specifically may include:

[0063] Step 101: input the image sample into the teacher model and the student model respectively to obtain a first detection result output by the teacher model and a second detection result output by the student model;

[0064] Step 102: using a dynamic label assignment method, according to the first detection result, determine a first category label corresponding to the first image region in the image sample, and using a dynamic label assignment method, according to the second detection result, determine a second category label corresponding to the second image region in the image sample; the first category label is used to characterize a positive sample or a negative sample of a preset category corresponding to the first image region; the second category label is used to characterize a positive sample or a negative sample of a preset category corresponding to the second image region;

[0065] Step 103: determining first loss information according to the first category label and the first detection result, and updating the parameters of the teacher model according to the first loss information;

[0066] Step 104: determine second loss information based on the second category label and the second detection result; determine third loss information based on the first detection result and the second detection result; and update the parameters of the student model based on the fusion loss information formed by the second loss information and the third loss information.

[0067] The embodiment of the present application can train the mathematical model to obtain a teacher model or a student model. The mathematical model can be trained by machine learning, deep learning methods, etc. The machine learning method may include: linear regression, decision tree, random forest, etc. The deep learning method may include: CNN (Convolutional Neural Networks), LSTM (Long Short-Term Memory), GRU (Gated Recurrent Unit), etc.

[0068] The training process of the teacher model or the student model may include: forward propagation and back propagation.

[0069] Among them, forward propagation can calculate in sequence from the input layer to the output layer according to the parameters of the teacher model or the student model to finally obtain the first detection result or the second detection result.

[0070] Backward propagation can calculate and update the parameters of the teacher model or the student model in sequence from the output layer to the input layer according to the first loss information or the fusion loss information. The teacher model or the student model usually adopts the structure of a neural network, and the parameters of the teacher model or the student model may include: parameters such as the weights of the neural network. Among them, during the back propagation process, the gradient information of the parameters of the teacher model or the student model can be determined, and the parameters of the teacher model or the student model can be updated using the gradient information. For example, back propagation can calculate and store the gradient information of the parameters of the processing layers (including the input layer, the intermediate layer, and the output layer) of the teacher model or the student model in sequence from the output layer to the input layer according to the chain rule in calculus.

[0071] Reference Figure 2 , shows a structural schematic diagram of a teacher model or a student model of an embodiment of the present application, and the teacher model or the student model may specifically include: a feature extraction unit 201, a feature fusion unit 202 and a detection unit 203.

[0072] Among them, the feature extraction unit 201 can be used to extract features from image samples. The feature extraction unit 201 can be used to receive image samples and extract image features of the image from the image samples. The image features can refer to deep image features. The feature extraction unit 201 can be a backbone network, which can include one or more of the following networks: convolutional network, VGG (Visual Geometry Group Network), ResNet (Residual Network), lightweight network, etc. It can be understood that the embodiment of the present application does not limit the specific network corresponding to the feature extraction unit 101.

[0073] Among them, the convolutional network can be a deep feedforward artificial neural network, which has good performance in image recognition. The convolutional network can specifically include a convolutional layer and / or a pooling layer. The convolutional layer is used to automatically extract features from the input image to obtain a feature map. The pooling layer is used to perform pooling processing on the feature map to reduce the number of features in the feature map. The pooling processing of the pooling layer may include: maximum pooling, average pooling, or random pooling, etc., and the appropriate method can be selected according to actual needs.

[0074] The residual network can include: multiple convolutional networks. The residual network is implemented in the form of skip-layer connection, that is, the input of the residual network is directly added to the output of the residual network, and then activated, which can overcome the degradation problem of deep neural networks to a first degree.

[0075] The feature fusion unit 202 is a connecting unit in the target detection model, which can fuse the image features extracted by the feature extraction unit 201 to obtain fused image features, which can improve the diversity of features and the performance of the target detection model.

[0076] The detection unit 203 is used to detect whether the image sample contains a target according to the fused image features, and output a corresponding detection result.

[0077] In an embodiment of the present application, the teacher model can be a model with high model complexity and a large number of parameters, while the student model can be a model with a simple structure and a small number of parameters. Using a student model with a simple structure to learn the generalization ability of the teacher model can achieve the effect of model compression, reduce model complexity, and reduce model parameters. The number of parameters of the teacher model can be greater than the number of parameters of the student model. For example, both the teacher model and the student model include: a feature extraction unit, but the first feature extraction unit included in the teacher model uses M network layers, and the second feature extraction unit included in the student model uses N network layers, where M and N are both positive integers, and M>N.

[0078] In an application example of the present application, an image sample having three channels of RGB (Red, Green, and Blue) is converted into The feature extraction unit 201 is inputted, and the feature extraction unit 201 can output three layers of image features, which are respectively recorded as: and Where H and W represent the height and width of the image sample, respectively, and C1, C2, and C3 represent the number of channels of the image features at the corresponding level.

[0079] The feature extraction unit 201 can input the three layers of image features into the feature fusion unit 202. The feature fusion unit 202 can receive the three layers of image features and perform feature fusion from top to bottom in the order of feat1->feat2->feat3. The features obtained after fusion are respectively recorded as and Then, the secondary feature fusion can be performed from bottom to top in the order of feat′3->feat′2->feat′1. The fused image feature after the secondary feature fusion is recorded as and

[0080] The fused image features after the secondary feature fusion may be input to the detection unit 203. The detection result output by the detection unit 203 may specifically include at least one of the following information:

[0081] Category probability information that the pixel points in the image sample belong to a preset category;

[0082] Area location information of image areas belonging to a preset category in the image sample; and

[0083] The foreground probability information of the pixel points in the image sample belonging to the foreground of the image.

[0084] In a specific implementation, the image samples may be derived from a training data set X∈{(x1,y1),(x2,y2),...,(x n ,y n ),...,(x N ,y N )}, where x n is the RGB image containing the target to be detected, y n For x n The spatial coordinates of the target to be detected and its corresponding preset category.

[0085] In practical applications, the teacher model can be used for input x n Output at least one of the three first detection results:

[0086] First category probability information It can represent the category distribution at the pixel level, (H / 8)×(W / 8)+(H / 16)×(W / 16)+(H / 32)×(W / 32) represents the sum of the spatial resolutions of the three fused image features output by the feature fusion unit, and B represents the number of image samples in a training batch;

[0087] First area location information The 4 represents that the rectangular box used for spatial positioning is represented by four values, which are the x and y values ​​of the upper left corner and the lower right corner of the rectangular box respectively;

[0088] First prospect probability information Among them, 1 represents a value from 0 to 1 to indicate the probability that the pixel is the foreground or the background. The closer to 1, the higher the probability of being the foreground.

[0089] In practical applications, the student model can be used for input x n Output at least one of the three second detection results:

[0090] The second category of probability information It can represent the category distribution at the pixel level;

[0091] Second area location information

[0092] Second prospect probability information

[0093] For the teacher model, a dynamic label allocation method can be used to determine a first category label corresponding to the first image area in the image sample according to the first detection result.

[0094] The process of determining the first category label corresponding to the first image region in the image sample may specifically include: determining fourth loss information and first parallel-crossover ratio information according to the first detection result corresponding to the first image region and information of the real region; the information of the real region corresponds to the preset category; the real region may correspond to x n The spatial coordinates of the target to be detected in the image; according to the first parallel-cross ratio information, the number of positive samples P1 corresponding to the real area is determined; according to the fourth loss information, the first target image area that meets the number of positive samples is selected from the first image area in the image sample in ascending order; the first category label corresponding to the first target image area is determined as the positive sample label corresponding to the preset category, and the first category label corresponding to the first image area other than the first target image area in the image sample is determined as the negative sample label corresponding to the preset category.

[0095] The determination process of the first category label can allocate P1 positive samples and P2 negative samples to the target to be detected corresponding to the real area. P1 can be determined according to the first parallel-cross ratio information. The first image area can be the image area corresponding to the anchor box predicted by the teacher model.

[0096] The first intersection-and-intersection ratio information may represent the overlap degree between the first image region and the real region. The first intersection-and-intersection ratio information may be determined according to the ratio of the intersection area to the union area between the first image region and the real region.

[0097] In a specific implementation, S first statistical image regions may be selected from the first image region in the order of the first parallel-cross ratio information from large to small, wherein the first statistical image region may be the first image region with the first parallel-cross ratio information being S large, and S may be a positive integer. Furthermore, the first parallel-cross ratio information of the S first statistical image regions may be accumulated, and the accumulated result may be rounded to obtain the number of positive samples P1. The number of positive samples P1 may be equal to the integer part of the accumulated result.

[0098] In practical applications, the fourth loss information may be determined based on one or more of the three first detection results and information about the real area. For example, the fourth loss information may include: parallel-crossover loss information and / or cross-entropy loss information.

[0099] The detection result corresponding to the first detection result may specifically include at least one of the following information:

[0100] Category probability information that the pixel points in the image sample belong to a preset category;

[0101] Area location information of image areas belonging to a preset category in the image sample; and

[0102] Foreground probability information of the pixel point in the image sample belonging to the image foreground

[0103] In the embodiment of the present application, P1 first target image regions can be selected from the first image region in the image sample in the order of the fourth loss information from small to large, and the first target image region can be the first image region with the smallest P1 before the fourth loss information.

[0104] For the student model, a dynamic label allocation method can be used to determine the second category label corresponding to the second image area in the image sample according to the second detection result.

[0105] The process of determining the second category label corresponding to the second image area in the image sample may specifically include: determining fifth loss information and second parallel-crossover ratio information according to the second detection result corresponding to the second image area and information of the real area; the information of the real area corresponds to the preset category; the real area may correspond to x n The spatial coordinates of the target to be detected in the image; according to the second parallel-cross ratio information, the number of positive samples Q1 corresponding to the real area is determined; according to the fifth loss information in ascending order, the second target image area that meets the number of positive samples Q1 is selected from the second image area in the image sample; the second category label corresponding to the second target image area is determined as the positive sample label corresponding to the preset category, and the second category label corresponding to the second image area other than the second target image area in the image sample is determined as the negative sample label corresponding to the preset category.

[0106] The above-mentioned determination process of the second category label can allocate Q1 positive samples and Q2 negative samples to the target to be detected corresponding to the real area. Among them, Q1 can be determined according to the second parallel-cross ratio information. The second image area can be the image area corresponding to the anchor box predicted by the student model.

[0107] The second intersection-and-intersection ratio information may represent the degree of overlap between the second image region and the real region. The second intersection-and-intersection ratio information may be determined according to the ratio of the intersection area to the union area between the second image region and the real region.

[0108] In a specific implementation, T second statistical image regions may be selected from the second image region in the order of the second parallel-cross ratio information from large to small, wherein the second statistical image region may be the second image region that is T larger than the second parallel-cross ratio information, and T may be a positive integer. Furthermore, the T second statistical image regions may be accumulated, and the accumulated result may be rounded to obtain the number of positive samples Q1.

[0109] In practical applications, the fifth loss information may be determined based on one or more of the three second detection results and information about the real region. For example, the fifth loss information may include: parallel-cross-ratio loss information and / or cross-entropy loss information.

[0110] In the embodiment of the present application, Q1 second target image areas can be selected from the second image area in the image sample in the order of the fifth loss information from small to large, and the second target image area can be the second image area with the smallest Q1 before the fifth loss information.

[0111] In the embodiment of the present application, the teacher model and the student model correspond to different numbers of network layers and parameters, so there may be a difference between the first detection result output by the teacher model and the second detection result output by the student model; and the first category label is determined based on the first detection result corresponding to the first image area, and the second category label is determined based on the second detection result corresponding to the second image area, so there may be a difference between the first category label and the second category label. However, in the embodiment of the present application, the first detection result of the teacher model is used as the supervisory information of the second detection result of the student model, so that the student model can align the center point of the anchor frame of the teacher model as the target, so the embodiment of the present application can improve the matching degree between the center points of the anchor frames contained in the first label allocation path (first category label) and the second label allocation path (second category label).

[0112] Reference Figure 3 , showing a flow chart of a method for training a target detection model of an embodiment of the present application, wherein a teacher model and a student model are collaboratively trained using image samples. The first detection result output by the teacher model can be used to determine the first loss information, and the first loss information can be used for back propagation of the teacher model. The second detection result output by the student model can be used to determine the second loss information. The first detection result of the teacher model serves as supervisory information for the second detection result of the student model, and the first detection result and the second detection result can be used to determine the third loss information. The embodiment of the present application can fuse the second loss information with the third loss information, and the obtained fused loss information can be used for back propagation of the student model.

[0113] For the teacher model, the first detection result may specifically include: first category probability information, and / or first region location information, and / or first foreground probability information; then the process of determining the first loss information may specifically include:

[0114] Determining corresponding first cross entropy category loss information according to the first category probability information and the first category label; and / or

[0115] Determining corresponding first cross entropy foreground loss information according to the first foreground probability information and the first category label; and / or

[0116] Corresponding first parallel-crossover ratio loss information is determined according to the first region position information and position information corresponding to the first category label.

[0117] Among them, the first cross entropy category loss information can be determined by formula (1); the first cross entropy foreground loss information can be determined by formula (2); and the first cross-parallel ratio loss information can be determined by formula (3). Represents the category probability information corresponding to the positive sample of the nth preset category, Represents the foreground probability information corresponding to the positive sample of the nth preset category, Represents the regional position information corresponding to the positive sample of the nth preset category; the positive sample of the nth preset category is determined according to the first category label.

[0118]

[0119]

[0120]

[0121] Among them, CELoss represents the cross entropy loss function, and the operation process of CELoss is shown in formula (4); IOULoss represents the cross-entropy loss function, and the operation process of IOULoss is shown in formula (5). Among them, | A ∩box B | represents the intersection area between rectangular box A and rectangular box B, | A ∪box B | represents the union area between rectangular box A and rectangular box B.

[0122]

[0123]

[0124] For the teacher model, the second detection result may specifically include: second category probability information, and / or second region location information, and / or second foreground probability information; then the above process of determining the second loss information may specifically include:

[0125] Determining corresponding second cross entropy category loss information according to the second category probability information and the second category label; and / or

[0126] determining corresponding second cross entropy foreground loss information according to the second foreground probability information and the second category label; and / or

[0127] Corresponding second cross-parallel ratio loss information is determined according to the second region position information and the position information corresponding to the second category label.

[0128] Among them, the second cross entropy category loss information can be determined using formula (6); the second cross entropy foreground loss information can be determined using formula (7); and the second cross-parallel ratio loss information can be determined using formula (8). Represents the category probability information corresponding to the positive sample of the nth preset category, Represents the foreground probability information corresponding to the positive sample of the nth preset category, Represents the regional position information corresponding to the positive sample of the nth preset category; the positive sample of the nth preset category is determined according to the second category label.

[0129]

[0130]

[0131]

[0132] In a specific implementation, the first detection result specifically includes: first area location information, and the second detection result specifically includes: second area location information; the above process of determining the third loss information may specifically include: converting the first area location information into a first boundary probability value, and converting the second area location information into a second boundary probability value; normalizing the first boundary probability value to a first normalized boundary probability value, and normalizing the second boundary probability value to a second normalized boundary probability value; performing relative entropy operation based on the first normalized boundary probability value and the second normalized boundary probability value to obtain the third loss information.

[0133] The first region position information and the second region position information are used to represent the spatial coordinates of the upper left corner and the lower right corner of the rectangular frame.

[0134] The embodiment of the present application converts the spatial coordinates of the rectangular frame into the probability value of the target boundary of the preset category. Since the probability value of the target boundary reflects the uncertainty of the teacher model or the student model about the target boundary, the third loss information is determined according to the probability value of the target boundary, and the uncertainty of the teacher model or the student model about the target boundary can be used for the target positioning of the student model, thereby improving the target positioning accuracy and target detection accuracy of the student model.

[0135] In this embodiment of the present application, the first area location information may be and second area location information The spatial coordinates of the rectangular box are converted into probability representations on the target boundary and recorded as and

[0136] In the embodiment of the present application, the regional location information pred can be converted into location Convert to boundary probability value pred lp .

[0137]

[0138] Furthermore, the embodiment of the present application may also normalize the first boundary probability value or the second boundary probability value to further mine uncertain information in target positioning.

[0139] In the embodiment of the present application, the mean (μ) and variance (σ) of the boundary probability value can be determined first, and then, according to the mean (μ) and variance (σ) of the boundary probability value, and Normalize the boundary probability values.

[0140] The specific process of normalizing the boundary probability values ​​such as the first boundary probability value or the second boundary probability value is as follows: for the image sample input in the i-th training batch Where m represents m image samples. Assume that the target detection model has input The boundary probability value is The corresponding mean can be expressed as:

[0141]

[0142] The corresponding variance can be expressed as:

[0143]

[0144] The normalized boundary probability value after normalization can be expressed as:

[0145]

[0146] Among them, ∈ = 1e-5; when i = 0, that is, in the first training batch, When i>0, After normalizing the boundary probabilities of the teacher model or the student model in the above way, we can get and

[0147] The process of performing relative entropy calculation according to the first normalized boundary probability value and the second normalized boundary probability value can be shown as formula (12):

[0148]

[0149] KLLoss(x, y) is a relative entropy function that is used to measure the difference between two data distributions. Generally, the smaller the value of KLLoss(x, y), the smaller the difference between the two data distributions. Formula (13) shows the calculation process of KLLoss(x, y), where p(x i ) represents x i probability.

[0150]

[0151] In practical applications, iterative training can be performed on image samples of multiple training batches. The convergence condition of the above iterative training can be: the loss information meets the preset condition. The preset condition can be: the absolute value of the difference between the fusion loss information and the preset value is less than the difference threshold, or the number of iterations exceeds the number threshold. In other words, when the fusion loss information meets the preset condition, the iteration can be terminated; in this case, the target parameter value of the student model can be obtained.

[0152] In summary, the training method of the target detection model of the embodiment of the present application uses image samples to collaboratively train the teacher model and the student model. During the collaborative training process, the teacher model and the student model are supervised by their respective category labels to generate corresponding first loss information and second loss information. At the same time, the first detection result of the teacher model is also used as the supervisory information of the second detection result of the student model to generate corresponding third loss information. The first detection result of the above-mentioned teacher model is used as the supervisory information of the second detection result of the student model, so that the student model can align the center point of the anchor frame of the teacher model as the target. Therefore, the embodiment of the present application can improve the matching degree between the center point of the anchor frame contained in the first label allocation path and the second label allocation path. Therefore, the embodiment of the present application can improve the efficiency of knowledge transfer from the teacher model to the student model.

[0153] Method Example 2

[0154] Reference Figure 4, shows a flowchart of a target detection method according to an embodiment of the present application, which method may specifically include:

[0155] Step 401: receiving an image to be detected;

[0156] Step 402: using the student model included in the target detection model, perform target detection on the image to be detected to obtain a corresponding detection result;

[0157] Step 403: output the detection result.

[0158] Among them, the target detection model may also include: a teacher model, and the training process of the target detection model specifically includes: inputting image samples into the teacher model and the student model respectively to obtain a first detection result output by the teacher model and a second detection result output by the student model; using a dynamic label allocation method, according to the first detection result, determining a first category label corresponding to the first image area in the image sample, and, using a dynamic label allocation method, according to the second detection result, determining a second category label corresponding to the second image area in the image sample; the first category label is used to characterize a positive sample or a negative sample of a preset category corresponding to the first image area; the second category label is used to characterize a positive sample or a negative sample of a preset category corresponding to the second image area; according to the first category label and the first detection result, determining first loss information, and according to the first loss information, updating the parameters of the teacher model; according to the second category label and the second detection result, determining second loss information; according to the first detection result and the second detection result, determining third loss information; and according to the fusion loss information composed of the second loss information and the third loss information, updating the parameters of the student model.

[0159] The image to be detected in step 401 may be derived from a collection device. The collection device may collect videos, in which case video frames may be extracted from the videos as the image to be detected. Alternatively, the collection device may collect images, in which case the images collected by the collection device may be used as the image to be detected.

[0160] In step 402, the student model may first extract features from the image to be detected, and then fuse the extracted image features to obtain fused image features; then, based on the fused image features, detect whether the image to be detected contains a target, and if so, output the position information corresponding to the target in the image to be detected. The student model has the characteristic of a small number of parameters and can be applied to terminal environments such as mobile phones to save terminal memory.

[0161] In practical applications, the detection results output by the student model may specifically include at least one of the following information:

[0162] Category probability information that the pixel points in the image to be detected belong to a preset category;

[0163] Area position information of an image area belonging to a preset category in the image to be detected; and

[0164] Foreground probability information of a pixel point in the image to be detected belonging to the foreground of the image.

[0165] For example, the foreground probability information can characterize whether there is an object at the pixel point. Among them, the category probability information and the regional position information can be information related to the anchor frame. In the embodiment of the present application, the preset category with the largest category probability information can be used as the target, and the regional position information corresponding to the anchor frame where the pixel point with the largest category probability information is located can be used as the regional position information of the target. Among them, the regional position information can be the spatial coordinates of the upper left corner and the lower right corner of the anchor frame.

[0166] The detection result may be outputted, and the name of the target and the area position information corresponding to the target may be outputted; or, a corresponding anchor frame may be drawn on the image to be detected according to the area position information corresponding to the target.

[0167] In summary, in the target detection method of the embodiment of the present application, during the collaborative training process of the teacher model and the student model, the teacher model and the student model respectively receive supervision from their respective category labels to generate corresponding first loss information and second loss information. At the same time, the first detection result of the teacher model is also used as supervision information for the second detection result of the student model to generate corresponding third loss information. The first detection result of the teacher model is used as supervision information for the second detection result of the student model, so that the student model can align the center point of the anchor frame of the teacher model as the target. Therefore, the embodiment of the present application can improve the matching degree between the first label allocation path and the center point of the anchor frame contained in the second label allocation path. Therefore, the embodiment of the present application can improve the efficiency of knowledge transfer from the teacher model to the student model.

[0168] While improving the efficiency of knowledge transfer from the teacher model to the student model, the embodiments of the present application can improve the target detection accuracy of the student model.

[0169] It should be noted that, for the method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present application are not limited by the described order of actions, because according to the embodiments of the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present application.

[0170] Reference Figure 5 , shows a structural block diagram of a training device for a target detection model according to an embodiment of the present application. The target detection model may specifically include: a teacher model and a student model. The device may specifically include the following modules:

[0171] The model processing module 501 is used to input the image samples into the teacher model and the student model respectively to obtain the first detection result output by the teacher model and the second detection result output by the student model;

[0172] A first category label determination module 502, configured to determine a first category label corresponding to a first image region in the image sample according to the first detection result by using a dynamic label allocation method;

[0173] The second category label determination module 503 is used to determine the second category label corresponding to the second image area in the image sample according to the second detection result by using a dynamic label allocation method; the first category label is used to characterize the positive sample or negative sample of the first image area corresponding to the preset category; the second category label is used to characterize the positive sample or negative sample of the second image area corresponding to the preset category;

[0174] A first parameter processing module 504, configured to determine first loss information according to the first category label and the first detection result, and update the parameters of the teacher model according to the first loss information;

[0175] The second parameter processing module 505 is used to determine the second loss information based on the second category label and the second detection result; determine the third loss information based on the first detection result and the second detection result; and update the parameters of the student model based on the fusion loss information formed by the second loss information and the third loss information.

[0176] Optionally, the first category label determination module 502 may specifically include:

[0177] a loss and parallel-intersection ratio determination module, configured to determine fourth loss information and first parallel-intersection ratio information according to a first detection result corresponding to the first image region and information of a real region, wherein the information of the real region corresponds to a preset category;

[0178] A positive sample quantity determination module, used to determine the number of positive samples corresponding to the real area according to the first parallel-cross ratio information;

[0179] A selection module, configured to select, from the first image area in the image samples, a first target image area that meets the number of positive samples according to the fourth loss information in ascending order;

[0180] A positive and negative sample label determination module is used to determine the first category label corresponding to the first target image area as the positive sample label corresponding to the preset category, and to determine the first category label corresponding to the first image area in the image sample other than the first target image area as the negative sample label corresponding to the preset category.

[0181] Optionally, the detection result corresponding to the first detection result or the second detection result may specifically include at least one of the following information:

[0182] Category probability information that the pixel points in the image sample belong to a preset category;

[0183] Area location information of image areas belonging to a preset category in the image sample; and

[0184] The foreground probability information of the pixel points in the image sample belonging to the foreground of the image.

[0185] Optionally, the first detection result may specifically include: first category probability information, and / or first region location information, and / or first foreground probability information; the first parameter processing module 504 may specifically include:

[0186] a first loss determination module, configured to determine corresponding first cross entropy category loss information according to the first category probability information and the first category label; and / or

[0187] a second loss determination module, configured to determine corresponding first cross entropy foreground loss information according to the first foreground probability information and the first category label; and / or

[0188] The third loss determination module is used to determine the corresponding first parallel-crossover ratio loss information according to the first area position information and the position information corresponding to the first category label.

[0189] Optionally, the first detection result may specifically include: first area location information, the second detection result may include: second area location information; the second parameter processing module 505 may specifically include:

[0190] a conversion module, configured to convert the first area position information into a first boundary probability value, and convert the second area position information into a second boundary probability value;

[0191] a normalization module, configured to normalize the first boundary probability value into a first normalized boundary probability value, and normalize the second boundary probability value into a second normalized boundary probability value;

[0192] A relative entropy operation module is used to perform a relative entropy operation according to the first normalized boundary probability value and the second normalized boundary probability value to obtain the third loss information.

[0193] Reference Figure 6 , shows a structural block diagram of a target detection device according to an embodiment of the present application, and the device may specifically include the following modules:

[0194] The receiving module 601 is used to receive the image to be detected;

[0195] The target detection module 602 is used to perform target detection on the image to be detected by using the student model included in the target detection model to obtain a corresponding detection result;

[0196] An output module 603 is used to output the detection result;

[0197] Among them, the target detection model also includes: a teacher model, and the training process of the target detection model includes: inputting image samples into the teacher model and the student model respectively to obtain a first detection result output by the teacher model and a second detection result output by the student model; using a dynamic label allocation method, according to the first detection result, determining a first category label corresponding to the first image area in the image sample, and, using a dynamic label allocation method, according to the second detection result, determining a second category label corresponding to the second image area in the image sample; the first category label is used to characterize a positive sample or a negative sample of a preset category corresponding to the first image area; the second category label is used to characterize a positive sample or a negative sample of a preset category corresponding to the second image area; according to the first category label and the first detection result, determining first loss information, and according to the first loss information, updating the parameters of the teacher model; according to the second category label and the second detection result, determining second loss information; according to the first detection result and the second detection result, determining third loss information; and according to the fusion loss information composed of the second loss information and the third loss information, updating the parameters of the student model.

[0198] In summary, in the collaborative training process of the teacher model and the student model in the embodiment of the present application, the teacher model and the student model respectively receive supervision from their respective category labels to generate corresponding first loss information and second loss information. At the same time, the first detection result of the teacher model is also used as supervision information for the second detection result of the student model to generate corresponding third loss information. The first detection result of the teacher model is used as supervision information for the second detection result of the student model, so that the student model can align the center point of the anchor frame of the teacher model as a target. Therefore, the embodiment of the present application can improve the matching degree between the first label allocation path and the center point of the anchor frame contained in the second label allocation path. Therefore, the embodiment of the present application can improve the efficiency of knowledge transfer from the teacher model to the student model.

[0199] While improving the efficiency of knowledge transfer from the teacher model to the student model, the embodiments of the present application can improve the target detection accuracy of the student model.

[0200] The embodiment of the present application also provides a non-volatile readable storage medium, which stores one or more modules (programs). When the one or more modules are applied to a device, the device can execute instructions (instructions) of each method step in the embodiment of the present application.

[0201] The embodiment of the present application provides one or more machine-readable media on which instructions are stored, and when executed by one or more processors, the electronic device executes one or more of the methods described in the above embodiments. In the embodiment of the present application, the electronic device includes various types of devices such as terminal devices and servers (clusters). The processor may include: the aforementioned MCU, CPU or SOC, etc.

[0202] The embodiments of the present disclosure may be implemented as a device that uses any appropriate hardware, firmware, software, or any combination thereof to perform a desired configuration, and the device may include: electronic devices such as terminal devices and servers (clusters). Figure 7 An exemplary apparatus 1300 that can be used to implement various embodiments described in this application is schematically shown. The exemplary apparatus 1300 may be an electronic device.

[0203] For one embodiment, Figure 7 An exemplary apparatus 1300 is shown having one or more processors 1302, a control module (chip set) 1304 coupled to at least one of the (one or more) processors 1302, a memory 1306 coupled to the control module 1304, a non-volatile memory (NVM) / storage device 1308 coupled to the control module 1304, one or more input / output devices 1310 coupled to the control module 1304, and a network interface 1312 coupled to the control module 1304.

[0204] The processor 1302 may include one or more single-core or multi-core processors, and the processor 1302 may include any combination of general-purpose processors or special-purpose processors (such as graphics processors, application processors, baseband processors, etc.). In some embodiments, the device 1300 can be used as a terminal device, server (cluster), and other devices described in the embodiments of the present application.

[0205] In some embodiments, the device 1300 may include one or more computer-readable media (e.g., memory 1306 or NVM / storage device 1308) having instructions 1314 and one or more processors 1302 configured to execute the instructions 1314 in combination with the one or more computer-readable media to implement a module to perform the actions described in the present disclosure.

[0206] For one embodiment, the control module 1304 may include any suitable interface controller to provide any suitable interface to at least one of the processor(s) 1302 and / or any suitable device or component in communication with the control module 1304 .

[0207] The control module 1304 may include a memory controller module to provide an interface to the memory 1306. The memory controller module may be a hardware module, a software module, and / or a firmware module.

[0208] The memory 1306 may be used, for example, to load and store data and / or instructions 1314 for the device 1300. For one embodiment, the memory 1306 may include any suitable volatile memory, such as a suitable DRAM. In some embodiments, the memory 1306 may include double data rate type four synchronous dynamic random access memory (DDR4 SDRAM).

[0209] For one embodiment, control module 1304 may include one or more input / output controllers to provide an interface to NVM / storage device 1308 and input / output device(s) 1310 .

[0210] For example, NVM / storage 1308 may be used to store data and / or instructions 1314. NVM / storage 1308 may include any suitable non-volatile memory (e.g., flash memory) and / or may include any suitable non-volatile storage device(s) (e.g., one or more hard disk drives (HDDs), one or more compact disk (CD) drives, and / or one or more digital versatile disk (DVD) drives).

[0211] NVM / storage device 1308 may include storage resources that are physically part of the device on which apparatus 1300 is installed, or it may be accessible to the device without being part of the device. For example, NVM / storage device 1308 may be accessed via input / output device(s) 1310 over a network.

[0212] (One or more) input / output devices 1310 may provide an interface for the apparatus 1300 to communicate with any other appropriate device, and the input / output device 1310 may include a communication component, an audio component, a sensor component, etc. The network interface 1312 may provide an interface for the apparatus 1300 to communicate through one or more networks, and the apparatus 1300 may wirelessly communicate with one or more components of a wireless network according to any of one or more wireless network standards and / or protocols, for example, accessing a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G, 5G, etc., or a combination thereof for wireless communication.

[0213] For one embodiment, at least one of the processor(s) 1302 may be packaged together with the logic of one or more controllers (e.g., a memory controller module) of the control module 1304. For one embodiment, at least one of the processor(s) 1302 may be packaged together with the logic of one or more controllers of the control module 1304 to form a system-in-package (SiP). For one embodiment, at least one of the processor(s) 1302 may be integrated on the same die with the logic of one or more controllers of the control module 1304. For one embodiment, at least one of the processor(s) 1302 may be integrated on the same die with the logic of one or more controllers of the control module 1304 to form a system-in-chip (SOC).

[0214] In various embodiments, the device 1300 may be, but is not limited to, a terminal device such as a server, a desktop computing device, or a mobile computing device (e.g., a laptop computing device, a handheld computing device, a tablet computer, a netbook, etc.). In various embodiments, the device 1300 may have more or fewer components and / or a different architecture. For example, in some embodiments, the device 1300 includes one or more cameras, a keyboard, a liquid crystal display (LCD) screen (including a touch screen display), a non-volatile memory port, multiple antennas, a graphics chip, an application-specific integrated circuit (ASIC), and a speaker.

[0215] Among them, the main control chip can be used as a processor or control module in the detection device, sensor data, location information, etc. are stored in a memory or NVM / storage device, the sensor group can be used as an input / output device, and the communication interface may include a network interface.

[0216] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0217] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0218] The present application embodiment is described with reference to the flowchart and / or block diagram of the method, terminal device (system) and computer program product according to the embodiment of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, and the combination of the process and / or box in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing terminal device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device produce a device for implementing the function specified in one process or multiple processes in the flowchart and / or one box or multiple boxes in the block diagram.

[0219] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0220] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce computer-implemented processing, so that the instructions executed on the computer or other programmable terminal device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0221] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.

[0222] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0223] The above is a detailed introduction to a target detection model training method and device, a target detection method and device, an electronic device and a machine-readable medium provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the ideas of the present application, there will be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A method for training a target detection model, characterized in that: The target detection model includes: a teacher model and a student model, and the method includes: Inputting the image samples into the teacher model and the student model respectively to obtain a first detection result output by the teacher model and a second detection result output by the student model; Using a dynamic label assignment method, according to the first detection result, a first category label corresponding to a first image area in the image sample is determined; and using a dynamic label assignment method, according to the second detection result, a second category label corresponding to a second image area in the image sample is determined; the first category label is used to characterize a positive sample or a negative sample of a preset category corresponding to the first image area; the second category label is used to characterize a positive sample or a negative sample of a preset category corresponding to the second image area; Determine first loss information according to the first category label and the first detection result, and update the parameters of the teacher model according to the first loss information; Determine second loss information based on the second category label and the second detection result; determine third loss information based on the first detection result and the second detection result; and update the parameters of the student model based on the fusion loss information formed by the second loss information and the third loss information.

2. The method according to claim 1, characterized in that The determining a first category label corresponding to a first image region in the image sample includes: Determining fourth loss information and first parallel-cross ratio information according to a first detection result corresponding to the first image area and information of a real area, wherein the information of the real area corresponds to a preset category; Determining the number of positive samples corresponding to the real area according to the first parallel-cross ratio information; Selecting, from the first image region in the image samples, a first target image region that matches the number of positive samples in the order of the fourth loss information from small to large; The first category label corresponding to the first target image area is determined as the positive sample label corresponding to the preset category, and the first category label corresponding to the first image area in the image sample except the first target image area is determined as the negative sample label corresponding to the preset category.

3. The method according to claim 1, characterized in that The test result corresponding to the first test result or the second test result includes at least one of the following information: Category probability information that the pixel points in the image sample belong to a preset category; Area location information of image areas belonging to a preset category in the image sample; and The foreground probability information of the pixel points in the image sample belonging to the foreground of the image.

4. The method according to claim 3, characterized in that The first detection result includes: first category probability information, and / or first area location information, and / or first foreground probability information; the determining of the first loss information includes: Determining corresponding first cross entropy category loss information according to the first category probability information and the first category label; and / or Determining corresponding first cross entropy foreground loss information according to the first foreground probability information and the first category label; and / or Corresponding first parallel-crossover ratio loss information is determined according to the first region position information and position information corresponding to the first category label.

5. The method according to claim 3, characterized in that: The first detection result includes: first area location information, the second detection result includes: second area location information; the determining of the third loss information includes: Converting the first area position information into a first boundary probability value, and converting the second area position information into a second boundary probability value; Normalizing the first boundary probability value to a first normalized boundary probability value, and normalizing the second boundary probability value to a second normalized boundary probability value; A relative entropy operation is performed according to the first normalized boundary probability value and the second normalized boundary probability value to obtain the third loss information.

6. A target detection method, characterized in that: The method comprises: Receiving an image to be detected; Using the student model included in the target detection model, target detection is performed on the image to be detected to obtain a corresponding detection result; Outputting the detection result; Among them, the target detection model also includes: a teacher model, and the training process of the target detection model includes: inputting image samples into the teacher model and the student model respectively to obtain a first detection result output by the teacher model and a second detection result output by the student model; using a dynamic label allocation method, according to the first detection result, determining a first category label corresponding to the first image area in the image sample, and, using a dynamic label allocation method, according to the second detection result, determining a second category label corresponding to the second image area in the image sample; the first category label is used to characterize a positive sample or a negative sample of a preset category corresponding to the first image area; the second category label is used to characterize a positive sample or a negative sample of a preset category corresponding to the second image area; according to the first category label and the first detection result, determining first loss information, and according to the first loss information, updating the parameters of the teacher model; according to the second category label and the second detection result, determining second loss information; according to the first detection result and the second detection result, determining third loss information; and according to the fusion loss information composed of the second loss information and the third loss information, updating the parameters of the student model.

7. A training device for a target detection model, characterized in that: The target detection model includes: a teacher model and a student model, and the device includes: A model processing module, used for inputting image samples into a teacher model and a student model respectively, so as to obtain a first detection result output by the teacher model and a second detection result output by the student model; A first category label determination module, configured to determine a first category label corresponding to a first image region in the image sample according to the first detection result by using a dynamic label allocation method; A second category label determination module is used to determine, according to the second detection result, a second category label corresponding to the second image area in the image sample by using a dynamic label allocation method; the first category label is used to characterize a positive sample or a negative sample of a preset category corresponding to the first image area; the second category label is used to characterize a positive sample or a negative sample of a preset category corresponding to the second image area; a first parameter processing module, configured to determine first loss information according to the first category label and the first detection result, and to update parameters of the teacher model according to the first loss information; The second parameter processing module is used to determine the second loss information according to the second category label and the second detection result; determine the third loss information according to the first detection result and the second detection result; and update the parameters of the student model according to the fusion loss information composed of the second loss information and the third loss information.

8. A target detection device, characterized in that: The device comprises: A receiving module, used for receiving an image to be detected; The target detection module is used to perform target detection on the image to be detected by using the student model included in the target detection model to obtain a corresponding detection result; An output module, used for outputting the detection result; Among them, the target detection model also includes: a teacher model, and the training process of the target detection model includes: inputting image samples into the teacher model and the student model respectively to obtain a first detection result output by the teacher model and a second detection result output by the student model; using a dynamic label allocation method, according to the first detection result, determining a first category label corresponding to the first image area in the image sample, and, using a dynamic label allocation method, according to the second detection result, determining a second category label corresponding to the second image area in the image sample; the first category label is used to characterize a positive sample or a negative sample of a preset category corresponding to the first image area; the second category label is used to characterize a positive sample or a negative sample of a preset category corresponding to the second image area; according to the first category label and the first detection result, determining first loss information, and according to the first loss information, updating the parameters of the teacher model; according to the second category label and the second detection result, determining second loss information; according to the first detection result and the second detection result, determining third loss information; and according to the fusion loss information composed of the second loss information and the third loss information, updating the parameters of the student model.

9. An electronic device, characterized in that: include: processor; and a memory having executable codes stored thereon, which, when the executable codes are executed, cause the processor to perform the method according to any one of claims 1 to 6.

10. A machine-readable medium having executable codes stored thereon, which, when executed, causes a processor to execute the method according to any one of claims 1 to 6.

Citation Information

Cited By

  • Sample generation method and device, deep learning model training method and device, video stream processing method and device, equipment and medium

    CN119478583A

  • Sample generation, deep learning model training, video stream processing methods and devices, equipment and media

    CN119478583B