Model training method, target object detection method, device, apparatus, and road side unit

CN115908963BActive Publication Date: 2026-08-11APOLLO INTELLIGENT CONNECTIVITY (BEIJING) TECH CO LTD +1
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-09
Publication Date
2026-08-11

Smart Images

  • Figure CN115908963B_ABST
    Figure CN115908963B_ABST
Patent Text Reader

Abstract

This disclosure provides a training method for an object detection model, relating to the field of artificial intelligence technology, particularly deep learning, computer vision, autonomous driving, and assisted driving technologies. The specific implementation involves: inputting a target sample image into the object detection model to obtain at least one detection result, wherein the target sample image includes a first sample region where a first sample object is located, and the detection result corresponds to a second sample object in the target sample image; obtaining a loss value corresponding to the second sample object based on the detection result and the label of the target sample image; determining processing parameter values ​​corresponding to the second sample object based on the position of the second sample object in the target sample image and the first sample region; and training the object detection model based on at least one processing parameter value and at least one loss value. This disclosure also provides an object detection method, apparatus, electronic device, and roadside unit.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of artificial intelligence technology, and more particularly to the fields of deep learning, computer vision, autonomous driving, and driver assistance systems. More specifically, this disclosure provides a method for training an object detection model, an object detection method, an apparatus, an electronic device, a storage medium, and a roadside unit. Background Technology

[0002] With the development of artificial intelligence technology, deep learning models are widely used in scenarios such as image classification, object detection, and autonomous driving. For example, in autonomous driving scenarios, deep learning models deployed on autonomous vehicles can perform object detection on images acquired by the autonomous vehicle to determine whether there are obstacles near the vehicle, enabling the autonomous vehicle to perform corresponding operations. Summary of the Invention

[0003] This disclosure provides a method for training a target detection model, a method for detecting target objects, an apparatus, a device, a storage medium, and a roadside unit.

[0004] According to one aspect of this disclosure, a method for training an object detection model is provided. The method includes: inputting a target sample image into an object detection model to obtain at least one detection result, wherein the target sample image includes a first sample region in which a first sample object is located, and the detection result corresponds to a second sample object in the target sample image; obtaining a loss value corresponding to the second sample object based on the detection result and the label of the target sample image; determining a processing parameter value corresponding to the second sample object based on the position of the second sample object in the target sample image and the first sample region; and training the object detection model based on at least one processing parameter value and at least one loss value.

[0005] According to another aspect of this disclosure, a target object detection method is provided, the method comprising: inputting a target image into a target detection model to obtain at least one detection result, wherein the target image includes a first target region in which a first target object is located, and the detection result corresponds to a second target object in the target image. For example, the target detection model is trained using the method provided in this disclosure.

[0006] According to another aspect of this disclosure, a training apparatus for an object detection model is provided. The apparatus includes: a first obtaining module, configured to input a target sample image into the object detection model to obtain at least one detection result, wherein the target sample image includes a first sample region in which a first sample object is located, and the detection result corresponds to a second sample object in the target sample image; a second obtaining module, configured to obtain a loss value corresponding to the second sample object based on the detection result and the label of the target sample image; a determining module, configured to determine a processing parameter value corresponding to the second sample object based on the position of the second sample object in the target sample image and the first sample region; and a training module, configured to train the object detection model based on at least one processing parameter value and at least one loss value.

[0007] According to another aspect of this disclosure, a target object detection apparatus is provided, the apparatus comprising: a third obtaining module, configured to input a target image into a target detection model to obtain at least one detection result, wherein the target image includes a first target region where a first target object is located, the detection result corresponds to a second target object in the target image, and the target detection model is trained using the apparatus provided in this disclosure.

[0008] According to another aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform a method provided according to this disclosure.

[0009] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions for causing a computer to perform the methods provided according to this disclosure.

[0010] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the method provided according to this disclosure.

[0011] According to another aspect of this disclosure, a roadside unit is provided, including the electronic equipment provided in this disclosure.

[0012] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

[0013] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:

[0014] Figure 1This is a flowchart of a training method for an object detection model according to an embodiment of the present disclosure;

[0015] Figure 2A This is a schematic diagram of an original sample image according to an embodiment of the present disclosure;

[0016] Figure 2B This is a schematic diagram of a first mask image according to an embodiment of the present disclosure;

[0017] Figures 2C to 2D This is a schematic diagram of cropping a first fused image according to an embodiment of the present disclosure;

[0018] Figure 2E This is a schematic diagram of a target sample image according to an embodiment of the present disclosure;

[0019] Figure 3 This is a schematic diagram of a target detection model according to an embodiment of the present disclosure;

[0020] Figure 4 This is a schematic diagram of a target sample image according to another embodiment of the present disclosure;

[0021] Figure 5 This is a flowchart of a target object detection method according to an embodiment of the present disclosure;

[0022] Figure 6 This is a block diagram of a training apparatus for an object detection model according to an embodiment of the present disclosure;

[0023] Figure 7 This is a block diagram of a target object detection apparatus according to an embodiment of the present disclosure; and

[0024] Figure 8 This is a block diagram of an electronic device according to an embodiment of the present disclosure, to which a training method for an object detection model and / or an object detection method can be applied. Detailed Implementation

[0025] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0026] Deep learning models can be used to perform object detection tasks. For example, Reigon Convolutional Neural Network (RCNN) models, Single Shot Multibox Detector (SSD) models, YOLO (You Only Look Once) models, Feature Pyramid Networks (FPN) models, Pyramid Attention Network (PAN) models, and EfficientDet models can be used to perform object detection tasks.

[0027] Deep learning models can be trained using publicly available datasets for object detection. In autonomous driving or roadside perception scenarios, to improve the accuracy of object detection results, images from these scenarios can be used to further train the deep learning model.

[0028] When training deep learning models using publicly available datasets, information from all image regions within an image sample can be used. These image samples can include regions highly relevant to the application scenario or regions irrelevant. Using information from all image regions in an image sample for training incurs unnecessary resource overhead, as it utilizes information from irrelevant regions. Furthermore, the range of values ​​for obstacle location, size, sharpness, and lighting is quite wide. Using information from all image regions in an image sample for training requires significant hardware resources, preventing limited hardware resources from being used to process information from image regions highly relevant to the application scenario, thus degrading model performance.

[0029] Figure 1 This is a flowchart of a training method for an object detection model according to an embodiment of the present disclosure.

[0030] like Figure 1 As shown, the method 100 may include operations S110 to S140.

[0031] In operation S110, the target sample image is input into the target detection model to obtain at least one detection result.

[0032] In this embodiment of the disclosure, the target sample image includes the first sample region where the first sample object is located.

[0033] For example, the original sample image may include various sample objects. These sample objects may include a first sample object Obj_1, a second sample object, and so on. The first sample object Obj_1 may be a road, etc. The second sample object may be an obstacle. Obstacles may include pedestrians, motor vehicles, non-motorized vehicles, etc. For example, a road may include a motor vehicle lane, a non-motorized vehicle lane, a sidewalk, etc.

[0034] For example, based on the first mask image of the original sample image, the region where the first sample object is located in the original sample image can be determined. Next, the original sample image can be processed in various ways to obtain the target sample image. The target sample image may include the first sample region. As another example, the first mask image of the original sample image can be determined based on various segmentation methods. These segmentation methods may include semantic segmentation, instance segmentation, and so on.

[0035] For example, the target sample image can also be determined using other methods based on the original sample image. In one example, the first sample region can also be manually marked in the original sample image to determine the target sample image.

[0036] In this embodiment of the disclosure, the object detection model can be various deep learning models. For example, the aforementioned region convolutional neural network model, single-point multi-window detection model, YOLO model, feature pyramid network model, pyramid attention network model, and efficient detector model can be used as object detection models.

[0037] In this embodiment of the disclosure, the detection result corresponds to a second sample object. The detection result can indicate the category of the second sample object or the location of the second sample object in the target sample image.

[0038] In operation S120, based on the detection results and the label of the target sample image, the loss value corresponding to the second sample object is obtained.

[0039] In this embodiment of the disclosure, the label of the original sample image may include the label of at least one second sample object. The target sample image is obtained based on the original sample image. The label of the target sample image can be determined based on the label of the original sample image. The label of the target sample image may include the label of at least one second sample object.

[0040] In this embodiment of the disclosure, the label of the second sample object can indicate the true category of the second sample object, or it can indicate the true location of the second sample object in the target sample image.

[0041] In this embodiment of the disclosure, various loss functions can be used to obtain the loss value corresponding to the second sample object. For example, various loss functions may include L1 loss function, L2 loss function, etc.

[0042] In operation S130, the processing parameter value corresponding to the second sample object is determined based on the position of the second sample object in the target sample image and the first sample region.

[0043] In this embodiment of the disclosure, it can be determined whether the second sample object is within the first sample region in order to determine the processing parameter value corresponding to the second sample object. For example, based on the detection result of the second sample object Obj_21, if it is determined that the second sample object Obj_21 is within the first sample region, the processing parameter value mask_21 corresponding to the second sample object Obj_21 can be determined as a first preset processing parameter value (e.g., 1). As another example, based on the detection result of the second sample object Obj_22, if it is determined that the second sample object Obj_22 is outside the first sample region, the processing parameter value mask_22 corresponding to the second sample object Obj_22 can be determined as a second preset processing parameter value (e.g., 0).

[0044] In operation S140, the object detection model is trained based on at least one processing parameter value and at least one loss value.

[0045] In this embodiment of the disclosure, various operations can be performed based on at least one processing parameter value and at least one loss value to obtain a total loss value. The object detection model can then be trained based on the total loss value. For example, these operations may include summation, multiplication, weighted summation, etc.

[0046] It should be noted that operations S120 and S130 can be executed sequentially. However, this disclosure is not limited to this; these two operations can also be executed in other orders, such as executing operation S130 first and then operation S120; or executing operation S120 and operation S130 in parallel.

[0047] By training an object detection model based on the relationship between the position of the second sample object in the target sample image and the first sample region through the embodiments of this disclosure, the trained object detection model can focus on the sample objects in the first sample region, thereby reducing the hardware resources required by the object detection model in the inference stage.

[0048] The following will describe in detail some implementation methods for obtaining target sample images with reference to relevant embodiments.

[0049] In some embodiments, inputting the target sample image into the target detection model may include: performing image segmentation on the original sample image to obtain a first mask image; cropping the original sample image according to the first mask region to obtain the target sample image. In embodiments of this disclosure, the original sample image includes a first sample object. The first mask image includes a first mask region corresponding to the first sample object. The following will be combined with... Figures 2A to 2E Please provide a detailed explanation.

[0050] Figure 2A This is a schematic diagram of an original sample image according to an embodiment of the present disclosure.

[0051] like Figure 2A As shown, the original sample image 210 may include a first sample object 211. The category of the first sample object 211 may be, for example, a road. The original sample image may also include a second sample object 212, a second sample object 213, and a second sample object 214. The true category of both the second sample object 212 and the second sample object 213 may be pedestrians. The true category of the second sample object 214 may be a truck.

[0052] Figure 2B This is a schematic diagram of a first mask image according to an embodiment of the present disclosure.

[0053] Image segmentation can be performed on the original sample image 210 to obtain, as shown below. Figure 2B The first mask image 220 is shown. (As shown...) Figure 2B As shown, the first mask image 220 may include a first mask region 221 corresponding to the first sample object 211.

[0054] Next, the original sample image 210 can be cropped according to the first mask region 221 to obtain the target sample image.

[0055] Figures 2C to 2D This is a schematic diagram illustrating the cropping of an original sample image according to an embodiment of the present disclosure.

[0056] In this embodiment of the disclosure, a first sample region can be determined based on a first mask region. For example, as described above, the first mask image 220 is obtained by image segmentation of the original sample image. Each first mask pixel in the first mask image 220 corresponds to an original pixel in the original sample image 210. Based on this, a first sample region 231 corresponding to the first mask region 221 can be determined from the original sample image 210.

[0057] In this embodiment of the disclosure, a first bounding box corresponding to the first mask region can be determined in the original sample image. For example, the first bounding box 232 can be determined based on the first sample region 231.

[0058] In this embodiment of the disclosure, a target sample image is obtained by deleting the image region outside the first bounding box from the original sample image. For example, the target sample image 230 can be obtained by deleting the image region outside the first bounding box 232 from the original sample image 210.

[0059] Figure 2E This is a schematic diagram of a target sample image according to an embodiment of the present disclosure.

[0060] like Figure 2D and Figure 2E As shown, the target sample image 230 may include an image region within a first bounding box 232. This image region includes a first sample region 231.

[0061] It is understandable that the target sample image 230 can be input into the target detection model.

[0062] Understandable, Figures 2C to 2D In the process, the original pixels within the first sample region 231 are adjusted to show the boundaries and range of the first sample region 231. During training and inference, the first sample region 231 can be determined based on the first mask region 221, while keeping the pixel values ​​of the original pixels within the first sample region 231 unchanged.

[0063] In this embodiment, the target sample image is obtained by cropping the first fused image. When training an object detection model using the target sample image, the hardware overhead required for training the model can be reduced, and the model can focus on second sample objects related to the first sample region, thereby improving the performance of the object detection model.

[0064] As explained above, the target sample image is generated based on the original sample image. The label of the target sample image can be determined based on the label of the original sample image. This will be explained in detail below.

[0065] In some embodiments, the labels of the original sample image include the labels of M second sample objects, where M is an integer greater than or equal to 1. For example, such as Figure 2A As shown, the original sample image 210 may include second sample object 212, second sample object 213, and second sample object 214. Accordingly, the labels of the original sample image 210 may include the labels of the second sample object 212, the second sample object 213, and the second sample object 214.

[0066] In some embodiments, the label of the target sample image can be determined based on the label of the original sample image. In embodiments of this disclosure, the label of the target sample image includes the labels of N second sample objects, where N is an integer greater than or equal to 1 and less than or equal to M. For example, such as Figure 2D As shown, the second sample object 214 is located in the image region outside the first bounding box 230. As described above, after deleting the image region outside the first bounding box 232 from the original sample image 210, the target sample image 230 is obtained. The label of the second sample object 214 can be deleted from the label of the original sample image 210 to obtain the label of the target sample image 230. The label of the target sample image 230 may include the label of the second sample object 212 and the label of the second sample object 213. It can be understood that for the original sample image 210, M can be 3. For the target sample image 230, N can be 2.

[0067] It can be understood that the second sample object 212 can be the second sample object Obj_21 mentioned above. The second sample object 213 can be the second sample object Obj_22 mentioned above.

[0068] As can be understood, the methods for obtaining target sample images have been described in detail above. The following will describe in detail some implementation methods for obtaining at least one detection result, in conjunction with relevant embodiments.

[0069] In some embodiments, the target sample image can be input into the target detection model to obtain the detection result of at least one second sample object in the target sample image. The following will combine... Figure 3 Please provide a detailed explanation.

[0070] Figure 3 This is a schematic diagram of a target detection model according to an embodiment of the present disclosure.

[0071] like Figure 3 As shown, the target detection model may include a feature extraction network 301, a fusion network 302, and a detection network 303.

[0072] like Figure 3 As shown, the target sample image 330 can be obtained from the original sample image 310. It is understood that the above detailed description of the original sample image 210 and the target sample image 230 also applies to this embodiment, and will not be repeated here.

[0073] In this embodiment of the disclosure, the target sample image can be input into a feature extraction network to obtain multiple sample image features. For example, the target sample image 330 can be input into the feature extraction network 301 to obtain multiple sample image features at different scales.

[0074] In this embodiment of the disclosure, multiple sample image features are input into a fusion network to obtain fused sample image features. For example, multiple sample image features can be input into the fusion network 302 so that the fusion network can fuse multiple sample image features of different scales to obtain fused sample image features.

[0075] In this embodiment of the disclosure, fused sample image features can be input into a detection network to obtain at least one detection result. For example, inputting fused sample image features into detection network 303 can obtain a detection result for at least one second sample object. As another example, the detection result for at least one second sample object may include the detection result for the second sample object Obj_21 and the detection result for the second sample object Obj_22.

[0076] It is understood that the above text has described in detail some implementation methods for obtaining the detection results of at least one second sample object in the target sample image. The following will describe in detail some implementation methods for obtaining the loss value corresponding to the second sample object, in conjunction with relevant embodiments.

[0077] In some embodiments, the label of the target sample image may also include the label of at least one second sample object.

[0078] In embodiments of this disclosure, the label of the second sample object may include at least one of a category sub-label and a regression sub-label of the second sample object. For example, the category sub-label may indicate the true category of the second sample object. The regression sub-label is used to indicate the true region where the second sample object is located in the target sample image.

[0079] In this embodiment of the disclosure, the detection result may include at least one of the category information of the second sample object and the regression information of the second sample object.

[0080] For example, category information can include multiple output categories and multiple output probability values ​​corresponding to each output category. In one example, the multiple output categories corresponding to the second sample object Obj_21 can include: pedestrian, motor vehicle, and non-motor vehicle. The output probability value corresponding to the output category "pedestrian" can be 90%, the output probability value corresponding to the output category "motor vehicle" can be 3%, and the output probability value corresponding to the output category "non-motor vehicle" can be 7%.

[0081] For example, regression information can indicate the region where the second sample object is located in the target sample image. In one example, the regression information may include the output x-coordinate, output y-coordinate, region output height h, and region output width w associated with the second sample object. It can be understood that, based on the regression information, a detection box for the second sample object can be determined to indicate the region where the second sample object is located in the target sample image, and thus, the position of the second sample object in the target sample image.

[0082] In some embodiments, obtaining the loss value corresponding to the second sample object based on the detection result and the label of the target sample image may include: obtaining the category sub-loss value corresponding to the second sample object based on category information and category sub-label.

[0083] In this embodiment of the disclosure, a target output category that matches the category sub-label can be determined from multiple output categories. For example, if the category sub-label of the second sample object Obj_21 indicates that the true category of the second sample object Obj_21 is "pedestrian", the output category "pedestrian" can be determined as the target output category.

[0084] In this embodiment of the disclosure, the category sub-loss value corresponding to the second sample object can be obtained based on the output probability value corresponding to the target output category. For example, the category sub-loss value l_cls corresponding to the second sample object is obtained based on the output probability value p_u corresponding to the target output category. As another example, the category sub-loss value l_cls can be determined using the following formula:

[0085] l_cls = -log p_u (Formula 1)

[0086] For example, as mentioned above, the output category "pedestrian" is the target output category, and the output probability value corresponding to the output category "pedestrian" can be 90%. Using Formula 1, the category sub-loss value l cls21 corresponding to the second sample object Obj_21 can be determined.

[0087] It is understandable that the category sub-loss value l_cls can be used as the loss value corresponding to the second sample object.

[0088] In some embodiments, obtaining the loss value corresponding to the second sample object based on the detection result and the label of the target sample image may include: obtaining the regression sub-loss value corresponding to the second sample object based on the regression information and the regression sub-label.

[0089] For example, the regressor loss value l_loc can be determined using the following formula:

[0090]

[0091] t_i can be t_1, t_2, t_3, and t_4. t_1, t_2, t_3, and t_4 can be the true x-coordinate, true y-coordinate, true height of the region, and true width of the region associated with the second sample object, respectively. p_i can be p_1, p_2, p_3, and p_4. p_1, p_2, p_3, and p_4 can be the output x-coordinate, output y-coordinate, output height of the region, and output width of the region associated with the second sample object, respectively. g(·) can be various loss functions (e.g., L1 loss function or L2 loss function).

[0092] It is understandable that the regressor loss value l_loc can be used as the loss value corresponding to the second sample object.

[0093] It is understandable that various calculations can be performed based on the categorical sub-loss value and the regressive sub-loss value to obtain the loss value corresponding to the second sample object.

[0094] In this embodiment of the disclosure, obtaining the loss value corresponding to the second sample object based on the detection result and the label of the target sample image may further include: obtaining the loss value corresponding to the second sample object based on the category sub-loss value, the regression sub-loss value, and the preset weight value. For example, the loss value corresponding to the second sample object can be determined by the following formula:

[0095] loss = l_cls + λl_loc (Formula 3)

[0096] λ is a preset weight value. In one example, λ can be 1.

[0097] It is understood that the above text has described in detail some implementation methods for obtaining the loss value corresponding to the second sample object. The following text will describe in detail some implementation methods for determining the processing parameter value corresponding to the second sample object in conjunction with relevant embodiments.

[0098] In some embodiments, determining the processing parameter value corresponding to the second sample object based on its position in the target sample image and the first sample region may include determining whether the second sample object is within the first sample region. For example, the position of the second sample object in the target sample image can be determined based on regression information in the detection results. Next, it can be determined whether the second sample object is within the first sample region. The following will combine... Figure 4 Provide a detailed description.

[0099] Figure 4 This is a schematic diagram of a target sample image according to another embodiment of the present disclosure.

[0100] like Figure 4As shown, the target sample image 430 includes a second sample object 412 and a second sample object 413. It is understood that the above detailed description of the second sample object 412 and the second sample object 413 also applies to this embodiment, and will not be repeated here. It is understood that in... Figure 4 In this process, the original pixels within the first sample region 431 are adjusted to reflect the boundaries and extent of the first sample region 431. During training and inference, the pixel values ​​of the original pixels within the first sample region 431 can be kept unchanged.

[0101] In this embodiment of the disclosure, in response to determining that the second sample object is within the first sample region, the processing parameter value corresponding to the second sample object is determined as a first preset processing parameter value. For example, the first preset processing parameter value can be 1. As another example, if it is determined that the second sample object 412 is within the first sample region 431, the processing parameter value corresponding to the second sample object 412 can be determined as 1. It is understood that the first preset processing parameter value can also be a value greater than 1, and this disclosure does not limit this.

[0102] In this embodiment of the disclosure, in response to determining that the second sample object is outside the first sample region, the processing parameter value corresponding to the second sample object is determined to be a second preset processing parameter value. For example, the second preset processing parameter value can be 0. As another example, if it is determined that the second sample object 413 is outside the first sample region 431, the processing parameter value corresponding to the second sample object 413 can be determined to be 0.

[0103] It is understood that the above text has described in detail some implementation methods for determining the processing parameter values ​​corresponding to the second sample object. The following text will describe in detail some implementation methods for training the target detection model in conjunction with relevant embodiments.

[0104] In some embodiments, training an object detection model based on at least one processing parameter value and at least one loss value may include: determining a post-processing loss value based on the processing parameter value and the loss value; obtaining a total loss value based on at least one post-processing loss value; and adjusting the parameters of the object detection model based on the total loss value to train the object detection model.

[0105] In this embodiment of the disclosure, determining the processed loss value based on the processing parameter value and the loss value may include: determining the processed category sub-loss value based on the processing parameter value and the category sub-loss value. For example, the processed category sub-loss value l'_cls can be determined using the following formula:

[0106] l′_cls=mask_u*l_cls=-mask_u*log p_u (Formula 4)

[0107] mask_u is the processing parameter value mentioned above, l_cls is the category sub-loss value mentioned above, and p_u is the output probability value corresponding to the target output category.

[0108] In this embodiment of the disclosure, determining the post-processing loss value based on the processing parameter value and the loss value may include: determining the post-processing regression sub-loss value based on the processing parameter value and the regression sub-loss value. For example, the post-processing regression sub-loss value l'_loc can be determined using the following formula:

[0109]

[0110] mask_u represents the processing parameter value mentioned above, and l_loc represents the regressor sub-loss value mentioned above. It can be understood that the detailed description of t_i and p_i in Formula 2 also applies to Formula 5, and will not be repeated here.

[0111] In other embodiments of this disclosure, the processed loss value can also be determined based on the processing parameter values ​​and the loss value. For example, the processed loss value loss' can also be determined using the following formula:

[0112] loss′=mask_u*loss (Formula 6)

[0113] In this embodiment of the disclosure, various operations can be performed based on at least one processed loss value to obtain a total loss value. For example, the various operations may include summation.

[0114] In this embodiment of the disclosure, the parameters of the object detection model can be adjusted in various ways to train the object detection model based on the total loss value. For example, these various methods may include backpropagation, gradient descent, etc.

[0115] In one example, as mentioned above, for Figure 4 If the second sample object 412 shown is determined to be within the first sample region 431, the processing parameter value corresponding to the second sample object 413 can be set to 1. Next, by using formulas four to five, the processed loss value loss'_21 corresponding to the second sample object 413 can be determined.

[0116] In one example, as mentioned above, for Figure 4If the second sample object 413 is determined to be outside the first sample region 431, the processing parameter value corresponding to the second sample object 413 can be set to 0. Next, using formulas four and five, the processed loss value loss'_22 corresponding to the second sample object 413 can be determined to be 0. Then, based on the processed loss values ​​loss'_21 and loss'_22, the total loss value can be determined. It can be understood that the processed loss value loss'_21 corresponding to the second sample object 412 accounts for a larger proportion of the total loss value. When adjusting the target detection model using the total loss value, the relevant information of the second sample object 412, which is within the first sample region 431, has a greater impact on the target detection model. Therefore, the target detection model can focus more on sample objects within the first sample region.

[0117] By using the embodiments of this disclosure to process the loss value corresponding to the second sample object using the processing parameter value, and using the processed loss value to train the target detection model, the trained target detection model can focus on the second sample object located in the first sample region, which helps to improve the computational efficiency of the target detection model and reduce resource consumption.

[0118] It is understood that the training method of the object detection model of this disclosure has been described in detail above in the context of autonomous driving or assisted driving scenarios. However, the training method of the object detection model provided in this disclosure can also be applied to other scenarios, and this disclosure does not impose any limitations on it.

[0119] In this embodiment of the disclosure, the original sample image may also include a facial region. For example, in the original sample image, the face of a person or animal can be used as the first sample object, and scars, etc., can be used as the second sample object. The first sample region can be the facial region where the face is located. The original sample image is cropped according to the facial region to obtain the target sample image. The target sample image is input into the target detection model to obtain at least one detection result. The detection result corresponds to a scar in the target sample image. According to the detection result and the label of the target sample image, the loss value corresponding to the second sample object is obtained. If the second sample object is located within the facial region, the processing parameter value corresponding to the second sample object is determined as the first preset processing parameter value. If the second sample object is located outside the facial region, the processing parameter value corresponding to the second sample object is determined as the second preset processing parameter value. The target detection model is trained according to at least one processing parameter value and at least one loss value.

[0120] As can be understood, the training method of the object detection model has been described in detail above. The following will describe in detail some implementation methods of using the object detection model for object detection, in conjunction with relevant embodiments.

[0121] Figure 5 This is a flowchart of a target object detection method according to an embodiment of the present disclosure.

[0122] like Figure 5 As shown, method 500 may include operation S510.

[0123] In operation S510, the target image is input into the target detection model to obtain at least one detection result.

[0124] In this embodiment of the disclosure, the target image includes a first target region where the first target object is located.

[0125] For example, the original image may include various target objects. These target objects may include a first target object, a second sample object, and so on. The first sample object may be a road or other terrain feature. The second sample object may be an obstacle. Obstacles may include pedestrians, motor vehicles, and non-motorized vehicles. Roads may include motor vehicle lanes, non-motorized vehicle lanes, and sidewalks.

[0126] For example, based on the second mask image of the original image, the region where the first target object is located in the original image can be determined. Next, the original image can be processed in various ways to obtain the target image. The target image may include the first target region.

[0127] For example, a second mask image of the original image can be determined based on various segmentation methods. These methods can include semantic segmentation, instance segmentation, and so on.

[0128] In embodiments of this disclosure, the original image can be various types of images. For example, the original image can be an image acquired by a Roadside Computing Unit (RSCU). Alternatively, the original image can also be an image acquired by the vehicle's sensing devices.

[0129] In this embodiment of the disclosure, the detection result corresponds to a second target object. The detection result can indicate the category of the second target object or the location of the second target object in the target sample image.

[0130] In embodiments of this disclosure, the object detection model may be trained using the methods provided in this disclosure. For example, the object detection model may be trained using method 200.

[0131] The following will describe in detail some implementation methods for obtaining target images with reference to relevant embodiments.

[0132] In some embodiments, inputting the target image into the target detection model may include: performing image segmentation on the original image to obtain a second mask image; cropping the original image according to the second mask region to obtain the target image; and inputting the target image into the target detection model. In embodiments of this disclosure, the original image includes a first target object. The second mask image includes a second mask region corresponding to the first target object.

[0133] For example, the original image may include a first target object. The category of the first target object could be, for example, a road. The original image may also include multiple second target objects. The true categories of the multiple second target objects could be pedestrians, trucks, etc.

[0134] In this embodiment of the disclosure, a second target region is obtained based on a second mask region. Cropping the original image based on the second mask region to obtain the target image may include: determining a second bounding box corresponding to the second mask region in the original image; and deleting image regions outside the second bounding box from the original image to obtain the target image.

[0135] In this embodiment, the target image is obtained by cropping the fused image. When processing the target image using the target detection model, the hardware overhead required by the model can be reduced, and the model can focus on the second target object related to the first target region, thereby improving the accuracy of target detection.

[0136] As can be understood, the method for obtaining the target image has been described in detail above. The following will describe in detail some implementation methods for obtaining the detection result of at least one second target object in the target image, in conjunction with relevant embodiments.

[0137] In some embodiments, the target image can be input into the target detection model to obtain the detection result of at least one second target object in the target image.

[0138] Object detection models can include feature extraction networks, fusion networks, and detection networks.

[0139] In this embodiment of the disclosure, the target image can be input into a feature extraction network to obtain multiple image features. For example, the multiple image features can be image features of different scales.

[0140] In this embodiment of the disclosure, multiple image features are input into a fusion network to obtain fused image features. For example, a fusion network can be used to fuse sample image features of multiple different scales to obtain fused image features.

[0141] In this embodiment of the disclosure, fused image features can be input into a detection network to obtain the detection result of at least one second target object.

[0142] The following will describe in detail, with reference to relevant embodiments, an exemplary system architecture for which target object detection methods can be applied.

[0143] The system architecture according to this embodiment may include multiple sensors, a network, and a server. The network serves as a medium for providing communication links between the sensors and the server. The network may include various connection types, such as wired and / or wireless communication links, etc.

[0144] Sensors can interact with servers via networks to receive or send messages, etc.

[0145] Sensors can be functional components integrated into vehicles, such as infrared sensors, ultrasonic sensors, millimeter-wave radar, and information acquisition devices. Sensors can be used to collect status data of obstacles around the vehicle and surrounding road data.

[0146] The vehicle can communicate with roadside units (RSUs), receiving information from or sending information to them. In this embodiment, the vehicle may also be equipped with image acquisition devices (e.g., cameras) to acquire raw images. Furthermore, the vehicle may be equipped with means or electronic devices to perform method 500, enabling target detection on the raw images or target images derived from the raw images.

[0147] Roadside units can be deployed, for example, on traffic lights to adjust the duration or frequency of the traffic lights. In embodiments of this disclosure, the roadside unit may also be equipped with an image acquisition device (e.g., a camera) to acquire raw images. Furthermore, the roadside unit may also be equipped with means or electronic devices for performing method 500 to perform target detection on the raw image or a target image obtained from the raw image.

[0148] The server can be set up at a remote location that can communicate with the vehicle terminal. It can be implemented as a distributed server cluster consisting of multiple servers or as a single server.

[0149] A server can be a provider of various services. Applications such as map applications and data processing applications can be installed on the server. Taking a data processing application running on the server as an example: it receives obstacle status data and road data transmitted from sensors over the network. One or more of the obstacle status data and road data can be used as data to be processed. This data is then processed to obtain the target data.

[0150] It is understood that the above description of the target object detection method of this disclosure has been provided in detail in conjunction with autonomous driving or assisted driving scenarios. However, the target object detection method provided by this disclosure can also be applied to other scenarios, and this disclosure does not impose any limitations on it.

[0151] In this embodiment of the disclosure, the original image may also include a facial region. For example, in the original image, the face of a person or animal can be used as the first target object, and scars, etc., can be used as the second target object. The first target region can be the facial region where the face is located. Based on the facial region, the original image is cropped to obtain the target image. The target image is input into the target detection model described above to obtain at least one detection result. The detection result can correspond to a scar in the target image.

[0152] Figure 6 This is a block diagram of a training apparatus for an object detection model according to an embodiment of the present disclosure.

[0153] like Figure 6 As shown, the device 600 may include a first acquisition module 610, a second acquisition module 620, a determination module 630, and a training module 640.

[0154] The first acquisition module 610 is used to input the target sample image into the target detection model to obtain at least one detection result. For example, the target sample image includes a first sample region where a first sample object is located, and the detection result corresponds to a second sample object in the target sample image.

[0155] The second acquisition module 620 is used to obtain the loss value corresponding to the second sample object based on the detection result and the label of the target sample image.

[0156] The determination module 630 is used to determine the processing parameter value corresponding to the second sample object based on the position of the second sample object in the target sample image and the first sample region.

[0157] Training module 640 is used to train an object detection model based on at least one processing parameter value and at least one loss value.

[0158] In some embodiments, the first obtaining module includes: a first image segmentation submodule, configured to segment the original sample image to obtain a first mask image, wherein the original sample image includes a first sample object, and the first mask image includes a first mask region corresponding to the first sample object; a first cropping submodule, configured to crop the original sample image according to the first mask region to obtain a target sample image; and a first input module, configured to input the target sample image into the target detection model.

[0159] In some embodiments, the first cropping submodule includes: a first obtaining unit, configured to obtain the first sample region based on the first mask region; a first determining unit, configured to determine a first bounding box corresponding to the first mask region in the original sample image; and a first deleting unit, configured to delete the image region outside the first bounding box from the original sample image to obtain the target sample image.

[0160] In some embodiments, the labels of the original sample image include the labels of M second sample objects, where M is an integer greater than or equal to 1. The second obtaining module includes: a first determining submodule, configured to determine the label of the target sample image based on the label of the original sample image, wherein the label of the target sample image includes the labels of N second sample objects, where N is an integer greater than or equal to 1 and less than or equal to M; and a first obtaining submodule, configured to obtain the loss value corresponding to the second sample object based on the label of the second sample object and the detection result.

[0161] In some embodiments, the determining module includes: a second determining submodule, configured to determine the processing parameter value corresponding to the second sample object as a first preset processing parameter value in response to determining that the second sample object is within the first sample region.

[0162] In some embodiments, the determining module includes a third determining submodule, configured to determine the processing parameter value corresponding to the second sample object as a second preset processing parameter value in response to determining that the second sample object is outside the first sample region.

[0163] In some embodiments, the label of the target sample image includes at least one label of a second sample object, the label of the second sample object includes at least one of the category sub-label of the second sample object and the regression sub-label of the second sample object, the detection result includes at least one of the category information of the second sample object and the regression information of the second sample object, the category information includes multiple output categories and multiple output probability values ​​corresponding to the multiple output categories respectively, and the regression information is used to indicate the region where the second sample object is located in the target sample image.

[0164] In some embodiments, the second obtaining module includes at least one of the following sub-modules: a second obtaining sub-module, configured to obtain a category sub-loss value corresponding to the second sample object based on category information and category sub-labels; and a third obtaining sub-module, configured to obtain a regression sub-loss value corresponding to the second sample object based on regression information and regression sub-labels.

[0165] In some embodiments, the second obtaining submodule includes: a second determining unit, configured to determine a target output category consistent with the category sublabel from a plurality of output categories; and a second obtaining unit, configured to obtain a category sub-loss value corresponding to the second sample object based on the output probability value corresponding to the target output category.

[0166] In some embodiments, the second obtaining module further includes a fourth obtaining submodule, used to obtain a loss value corresponding to the second sample object based on the category sub-loss value, the regression sub-loss value and the preset weight value.

[0167] In some embodiments, the training module includes: a fourth determining submodule for determining a post-processing loss value based on the processing parameter value and the loss value; a fifth obtaining submodule for obtaining a total loss value based on at least one post-processing loss value; and an adjusting submodule for adjusting the parameters of the object detection model based on the total loss value to train the object detection model.

[0168] In some embodiments, the target detection model includes a feature extraction network, a fusion network, and a detection network. The first obtaining module includes: a sixth obtaining submodule, used to input the target sample image into the feature extraction network to obtain multiple sample image features; a seventh obtaining submodule, used to input the multiple sample image features into the fusion network to obtain fused sample image features; and an eighth obtaining submodule, used to input the fused sample image features into the detection network to obtain at least one detection result.

[0169] Figure 7 This is a block diagram of a target object detection apparatus according to another embodiment of the present disclosure.

[0170] like Figure 7 As shown, the device 700 may include a third obtaining model 710.

[0171] The third acquisition module 710 is used to input the target image into the target detection model to obtain at least one detection result.

[0172] In this embodiment of the disclosure, the target image includes a first target region where a first target object is located, and the detection result corresponds to a second target object in the target image.

[0173] In this embodiment of the disclosure, the target detection model is trained using the apparatus provided in this disclosure.

[0174] In some embodiments, the third obtaining module includes: a second image segmentation submodule, configured to segment the original image to obtain a second mask image, wherein the original image includes a first target object, and the second mask image includes a second mask region corresponding to the first target object; a second cropping submodule, configured to crop the original image according to the second mask region to obtain a target image; and a second input submodule, configured to input the target image into the target detection model.

[0175] In some embodiments, the second cropping submodule includes: a third obtaining unit, configured to obtain the first target region based on the second mask region; a third determining unit, configured to determine a second bounding box corresponding to the second mask region in the original image; and a second deleting unit, configured to delete the image region outside the second bounding box from the original image to obtain the target image.

[0176] In some embodiments, the target detection model includes a feature extraction network, a fusion network, and a detection network. The third obtaining module includes: a ninth obtaining submodule for inputting the target image into the feature extraction network to obtain multiple image features; a tenth obtaining submodule for inputting the multiple image features into the fusion network to obtain fused image features; and an eleventh obtaining submodule for inputting the fused image features into the detection network to obtain at least one detection result.

[0177] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0178] In some embodiments, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0179] In embodiments of this disclosure, the electronic device may include at least one processor and a memory communicatively connected to the at least one processor. For example, the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the methods provided in this disclosure.

[0180] In embodiments of this disclosure, a non-transitory computer-readable storage medium may store computer instructions. These computer instructions can cause a computer to perform the methods provided according to this disclosure.

[0181] In embodiments of this disclosure, a computer program product may include a computer program that, when executed by a processor, implements the methods provided in this disclosure.

[0182] In this embodiment of the disclosure, the roadside unit may include the electronic equipment provided in this disclosure.

[0183] Figure 8A schematic block diagram of an example electronic device 800 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0184] like Figure 8 As shown, device 800 includes a computing unit 801, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 802 or a computer program loaded from storage unit 808 into random access memory (RAM) 803. RAM 803 may also store various programs and data required for the operation of device 800. The computing unit 801, ROM 802, and RAM 803 are interconnected via bus 804. Input / output (I / O) interface 805 is also connected to bus 804.

[0185] Multiple components in device 800 are connected to I / O interface 805, including: input unit 806, such as keyboard, mouse, etc.; output unit 807, such as various types of monitors, speakers, etc.; storage unit 808, such as disk, optical disk, etc.; and communication unit 809, such as network card, modem, wireless transceiver, etc. Communication unit 809 allows device 800 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0186] The computing unit 801 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 performs the various methods and processes described above, such as methods for training object detection models and / or object detection methods. For example, in some embodiments, the methods for training object detection models and / or object detection methods can be implemented as computer software programs tangibly contained in a machine-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program can be loaded and / or installed on device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of the methods for training object detection models and / or object detection methods described above can be performed. Alternatively, in other embodiments, the computing unit 801 may be configured by any other suitable means (e.g., by means of firmware) to perform a training method for the object detection model and / or a target object detection method.

[0187] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0188] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0189] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0190] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) monitor or an LCD (liquid crystal display)) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0191] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0192] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other.

[0193] This disclosure also provides a roadside unit that may include the aforementioned electronic equipment.

[0194] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.

[0195] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A method for training an object detection model, comprising: The original sample image is segmented to obtain a first mask image, wherein the original sample image includes a first sample object, and the first mask image includes a first mask region corresponding to the first sample object. In the original sample image, a first sample region corresponding to the first mask region is determined; Determine a first bounding box corresponding to the first mask region in the original sample image; The image region outside the first bounding box is deleted from the original sample image to obtain the target sample image, wherein the target sample image includes the first sample region where the first sample object is located. The target sample image is input into the target detection model to obtain at least one detection result, wherein the detection result corresponds to a second sample object in the target sample image; Based on the detection results and the label of the target sample image, the loss value corresponding to the second sample object is obtained; Based on the position of the second sample object in the target sample image and the first sample region, determine the processing parameter value corresponding to the second sample object; and Training the object detection model based on at least one of the processing parameter values ​​and at least one of the loss values ​​includes: The processed loss value is determined based on the processing parameter value and the loss value. A total loss value is obtained based on at least one of the processed loss values, wherein the proportion of the processed loss value corresponding to the second sample object within the first sample region in the total loss value is greater than the proportion of the processed loss value corresponding to the second sample object outside the first sample region in the total loss value; and The parameters of the object detection model are adjusted based on the total loss value to train the object detection model.

2. The method according to claim 1, wherein, The labels of the original sample image include M labels for the second sample object, where M is an integer greater than or equal to 1. The step of obtaining the loss value corresponding to the second sample object based on the detection result and the label of the target sample image includes: Based on the labels of the original sample images, the labels of the target sample images are determined, wherein the labels of the target sample images include N labels of the second sample objects, where N is an integer greater than or equal to 1 and less than or equal to M; and Based on the label of the second sample object and the detection result, the loss value corresponding to the second sample object is obtained.

3. The method according to claim 1, wherein, The step of determining the processing parameter value corresponding to the second sample object based on the position of the second sample object in the target sample image and the first sample region includes: In response to determining that the second sample object is within the first sample region, the processing parameter value corresponding to the second sample object is determined as the first preset processing parameter value.

4. The method according to claim 1, wherein, The step of determining the processing parameter value corresponding to the second sample object based on the position of the second sample object in the target sample image and the first sample region includes: In response to determining that the second sample object is outside the first sample region, the processing parameter value corresponding to the second sample object is determined as the second preset processing parameter value.

5. The method according to claim 1, wherein, The label of the target sample image includes at least one label of the second sample object, and the label of the second sample object includes at least one of the category sub-label and the regression sub-label of the second sample object. The detection result includes at least one of the category information of the second sample object and the regression information of the second sample object. The category information includes multiple output categories and multiple output probability values ​​corresponding to the multiple output categories respectively. The regression information is used to indicate the region where the second sample object is located in the target sample image.

6. The method according to claim 5, wherein, Obtaining the loss value corresponding to the second sample object based on the detection result and the label of the target sample image includes at least one of the following operations: Based on the category information and the category sub-label, the category sub-loss value corresponding to the second sample object is obtained; and Based on the regression information and the regression sub-label, the regression sub-loss value corresponding to the second sample object is obtained.

7. The method according to claim 6, wherein, The step of obtaining the category sub-loss value corresponding to the second sample object based on the category information and the category sub-label includes: Determine a target output category that matches the category sub-label from among the multiple output categories; and Based on the output probability value corresponding to the target output category, the category sub-loss value corresponding to the second sample object is obtained.

8. The method according to claim 6, wherein, The step of obtaining the loss value corresponding to the second sample object based on the detection result and the label of the target sample image further includes: Based on the category sub-loss value, the regression sub-loss value, and the preset weight value, the loss value corresponding to the second sample object is obtained.

9. The method according to claim 1, wherein, The target detection model includes a feature extraction network, a fusion network, and a detection network. The step of inputting the target sample image into the target detection model to obtain at least one detection result includes: The target sample image is input into the feature extraction network to obtain multiple sample image features; Multiple sample image features are input into the fusion network to obtain fused sample image features; and The fused sample image features are input into the detection network to obtain at least one detection result.

10. A method for detecting a target object, comprising: Input the target image into the target detection model to obtain at least one detection result. The target image includes a first target region where the first target object is located, and the detection result corresponds to a second target object in the target image. The target detection model is trained using the method described in any one of claims 1 to 9.

11. The method according to claim 10, wherein, The step of inputting the target image into the target detection model includes: The original image is segmented to obtain a second mask image, wherein the original image includes the first target object, and the second mask image includes a second mask region corresponding to the first target object; The original image is cropped according to the second mask region to obtain the target image; and The target image is input into the target detection model.

12. The method according to claim 11, wherein, The step of cropping the original image according to the second mask region to obtain the target image includes: The first target region is obtained based on the second mask region; Determine a second bounding box corresponding to the second mask region in the original image; and The target image is obtained by deleting the image region outside the second bounding box from the original image.

13. The method according to claim 10, wherein, The target detection model includes a feature extraction network, a fusion network, and a detection network. The step of inputting the target image into the target detection model to obtain at least one detection result includes: The target image is input into the feature extraction network to obtain multiple image features; Multiple image features are input into the fusion network to obtain fused image features; and The fused image features are input into the detection network to obtain at least one detection result.

14. A training device for an object detection model, comprising: The first obtaining module is used to input the target sample image into the target detection model to obtain at least one detection result, wherein the target sample image includes a first sample region where the first sample object is located, and the detection result corresponds to a second sample object in the target sample image; The second obtaining module is used to obtain a loss value corresponding to the second sample object based on the detection result and the label of the target sample image; The determining module is configured to determine the processing parameter value corresponding to the second sample object based on the position of the second sample object in the target sample image and the first sample region; and The training module is used to train the object detection model based on at least one of the processing parameter values ​​and at least one of the loss values. The first obtaining module includes: The first image segmentation submodule is used to segment the original sample image to obtain a first mask image, wherein the original sample image includes a first sample object, and the first mask image includes a first mask region corresponding to the first sample object. The first obtaining unit is configured to determine a first sample region in the original sample image that corresponds to the first mask region. The first determining unit is configured to determine a first bounding box corresponding to the first mask region in the original sample image; A first deletion unit is configured to delete an image region outside the first bounding box from the original sample image to obtain a target sample image; and The first input submodule is used to input the target sample image into the target detection model to obtain at least one detection result; The training module includes: The fourth determining submodule is used to determine the processed loss value based on the processing parameter value and the loss value; The fifth obtaining submodule is configured to obtain a total loss value based on at least one of the processed loss values, wherein the proportion of the processed loss value corresponding to the second sample object within the first sample region in the total loss value is greater than the proportion of the processed loss value corresponding to the second sample object outside the first sample region in the total loss value; and The adjustment submodule is used to adjust the parameters of the object detection model according to the total loss value in order to train the object detection model.

15. The apparatus according to claim 14, wherein, The labels of the original sample image include M labels for the second sample object, where M is an integer greater than or equal to 1. The second obtaining module includes: The first determining submodule is configured to determine the label of the target sample image based on the label of the original sample image, wherein the label of the target sample image includes N labels of the second sample object, where N is an integer greater than or equal to 1 and less than or equal to M; and The first acquisition submodule is used to obtain the loss value corresponding to the second sample object based on the label of the second sample object and the detection result.

16. The apparatus according to claim 14, wherein, The determining module includes: The second determining submodule is used to determine the processing parameter value corresponding to the second sample object as the first preset processing parameter value in response to determining that the second sample object is within the first sample region.

17. The apparatus according to claim 14, wherein, The determining module includes: The third determining submodule is used to determine the processing parameter value corresponding to the second sample object as the second preset processing parameter value in response to determining that the second sample object is outside the first sample area.

18. The apparatus according to claim 14, wherein, The label of the target sample image includes at least one label of the second sample object, and the label of the second sample object includes at least one of the category sub-label and the regression sub-label of the second sample object. The detection result includes at least one of the category information of the second sample object and the regression information of the second sample object. The category information includes multiple output categories and multiple output probability values ​​corresponding to the multiple output categories respectively. The regression information is used to indicate the region where the second sample object is located in the target sample image.

19. The apparatus according to claim 18, wherein, The second obtaining module includes at least one of the following sub-modules: The second acquisition submodule is used to obtain the category sub-loss value corresponding to the second sample object based on the category information and the category sub-label; as well as The third acquisition submodule is used to obtain the regression sub-loss value corresponding to the second sample object based on the regression information and the regression sub-label.

20. The apparatus according to claim 19, wherein, The second obtaining submodule includes: The second determining unit is configured to determine, from the plurality of output categories, a target output category that matches the category sub-label; and The second obtaining unit is used to obtain the category sub-loss value corresponding to the second sample object based on the output probability value corresponding to the target output category.

21. The apparatus according to claim 19, wherein, The second obtaining module also includes: The fourth submodule is used to obtain the loss value corresponding to the second sample object based on the category sub-loss value, the regression sub-loss value, and the preset weight value.

22. The apparatus according to claim 14, wherein, The target detection model includes a feature extraction network, a fusion network, and a detection network. The first obtaining module includes: The sixth submodule is used to input the target sample image into the feature extraction network to obtain multiple sample image features; The seventh submodule is used to input multiple sample image features into the fusion network to obtain fused sample image features; and The eighth submodule is used to input the fused sample image features into the detection network to obtain at least one detection result.

23. A target object detection device, comprising: The third acquisition module is used to input the target image into the target detection model and obtain at least one detection result. The target image includes a first target region where the first target object is located, and the detection result corresponds to a second target object in the target image. The target detection model is trained using the apparatus described in any one of claims 14 to 22.

24. The apparatus according to claim 23, wherein, The third obtaining module includes: The second image segmentation submodule is used to segment the original image to obtain a second mask image, wherein the original image includes the first target object, and the second mask image includes a second mask region corresponding to the first target object; The second cropping submodule is used to crop the original image according to the second mask region to obtain the target image; and The second input submodule is used to input the target image into the target detection model.

25. The apparatus according to claim 24, wherein, The second trimming submodule includes: The third obtaining unit is used to obtain the first target region based on the second mask region; A third determining unit is configured to determine a second bounding box corresponding to the second mask region in the original image; and The second deletion unit is used to delete the image region outside the second bounding box from the original image to obtain the target image.

26. The apparatus according to claim 23, wherein, The target detection model includes a feature extraction network, a fusion network, and a detection network. The third obtaining module includes: The ninth submodule is used to input the target image into the feature extraction network to obtain multiple image features; The tenth submodule is used to input multiple image features into the fusion network to obtain fused image features; and The eleventh submodule is used to input the fused image features into the detection network to obtain at least one detection result.

27. An electronic device comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 13.

28. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1 to 13.

29. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 13.

30. A roadside unit comprising the electronic device of claim 27.

Citation Information

Patent Citations

  • Target detection method and device applied to vehicle-road cooperation, roadside equipment and vehicle

    CN113469025A

  • Learning of detection model using loss function

    CN113614780A

  • Semantic segmentation method, terminal and storage medium

    CN114387434A