Scene detection model training method, device, electronic device and storage medium

By introducing a three-dimensional feature extraction and detection network into the scene detection model, and using supervised training methods to adjust parameters, the problem of low detection accuracy of existing technologies in complex environments is solved, and more efficient three-dimensional object recognition and positioning are achieved.

CN118365992BActive Publication Date: 2024-09-13CHENGDU CELIS TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410803052.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-20
Publication Date
2024-09-13
Estimated Expiration
2044-06-20

AI Technical Summary

Technical Problem

Existing scene detection technology based on image perspective conversion performs poorly in complex or dynamic environments, especially under conditions of occlusion and lighting changes. It is difficult to accurately identify and locate partially occluded objects, resulting in reduced detection accuracy and efficiency.

Method used

A scene detection model training method is adopted. The pre-trained three-dimensional feature extraction network in the preset initial scene detection model is used to extract three-dimensional features from the image, and the scene detection is performed through the scene detection network. A supervised training method is used based on the loss. The function adjusts the network parameters to ensure that the model can accurately predict the category, location, size and other information of the object when processing three-dimensional features.

Benefits of technology

By utilizing three-dimensional features, the accuracy and efficiency of scene detection are improved, objects can be accurately identified and positioned in complex environments, and the ability to understand the scene is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118365992B
    Figure CN118365992B
Patent Text Reader

Abstract

The embodiment of the present application relates to a training method, device, electronic device and storage medium of a scene detection model, the method comprising: obtaining a first sample image and annotated scene information; using a pre-trained three-dimensional feature extraction network included in the initial scene detection model to extract three-dimensional features from at least one first sample image under a target perspective to obtain three-dimensional feature data; using the scene detection network included in the model to perform scene detection on the three-dimensional feature data to obtain predicted scene information; using a first loss function to calculate a first loss value representing the error between the predicted scene information and the annotated scene information; using the first loss value to adjust the parameters of the scene detection network; determining the adjusted initial scene detection model as the trained scene detection model. The model trained by the embodiment of the present application can effectively utilize the three-dimensional depth information of the object, accurately predict the information of various objects in the scene, and greatly improve the accuracy of scene detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of machine vision technology, and in particular to a training method, device, electronic device and computer-readable storage medium for a scene detection model. Background Art

[0002] Image perspective conversion technology is an important application in the fields of autonomous driving, drone monitoring, and intelligent surveillance systems. For example, perspective conversion technology can include BEV (Bird's Eye View) detection technology, which identifies and locates objects on the ground by analyzing images from a bird's-eye view. BEV detection provides a unique perspective that helps improve the global understanding of the scene, especially in applications that require precise spatial positioning. Most of the existing object detection methods based on image perspective conversion rely on deep learning models, such as convolutional neural networks and generative adversarial networks, to process and analyze image data.

[0003] Although perspective conversion techniques such as BEV detection technology perform well in simple scenarios, their performance may drop significantly in complex or dynamic environments, such as under occlusion and lighting changes. In particular, existing technologies often fail to accurately identify and locate partially occluded objects. This is because traditional BEV detection technology relies mainly on two-dimensional image data, and the use of three-dimensional information is relatively limited. This may lead to a lack of depth perception when performing spatial analysis and understanding, affecting the ultimate detection accuracy and efficiency. Summary of the invention

[0004] In view of this, in order to solve some or all of the above-mentioned technical problems, the embodiments of the present application provide a training method, device, electronic device and computer-readable storage medium for a scene detection model.

[0005] In a first aspect, an embodiment of the present application provides a method for training a scene detection model, the method comprising: obtaining at least one first sample image taken from at least one perspective, and corresponding annotated scene information; using a pre-trained three-dimensional feature extraction network included in a preset initial scene detection model to extract three-dimensional features from the target perspective of the at least one first sample image to obtain three-dimensional feature data; using the scene detection network included in the initial scene detection model to perform scene detection on the three-dimensional feature data to obtain predicted scene information; using a preset first loss function to calculate a first loss value representing the error between the predicted scene information and the annotated scene information; using the first loss value to adjust the parameters of the scene detection network; in response to the scene detection network after the adjustment of the parameters meeting the preset training end conditions, determining the current initial scene detection model as the trained scene detection model.

[0006] In a second aspect, an embodiment of the present application provides a training device for a scene detection model, the device comprising: an acquisition module for acquiring at least one first sample image taken from at least one perspective, and corresponding annotated scene information; an extraction module for performing three-dimensional feature extraction on at least one first sample image from a target perspective using a pre-trained three-dimensional feature extraction network included in a preset initial scene detection model to obtain three-dimensional feature data; a detection module for performing scene detection on the three-dimensional feature data using the scene detection network included in the initial scene detection model to obtain predicted scene information; a calculation module for calculating a first loss value representing the error between the predicted scene information and the annotated scene information using a preset first loss function; a training module for adjusting the parameters of the scene detection network using the first loss value; and a determination module for determining the current initial scene detection model as the trained scene detection model in response to the scene detection network after adjusting the parameters meeting the preset training end conditions.

[0007] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a memory for storing a computer program; a processor for executing the computer program stored in the memory, and when the computer program is executed, the method of any embodiment of the scene detection model training method of the above-mentioned first aspect of the present application is implemented.

[0008] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method of any embodiment of the scene detection model training method of the first aspect described above is implemented.

[0009] In a fifth aspect, an embodiment of the present application provides a computer program, which includes a computer-readable code. When the computer-readable code runs on a device, the processor in the device implements a method as in any embodiment of the scene detection model training method of the first aspect described above.

[0010] The training method, device, electronic device and computer-readable storage medium of the scene detection model provided in the embodiments of the present application, by using the pre-trained three-dimensional feature extraction network included in the initial scene detection model, extracting three-dimensional features from at least one first sample image under the target perspective, obtaining three-dimensional feature data, using the scene detection network included in the initial scene detection model, performing scene detection on the three-dimensional feature data, obtaining predicted scene information, and then using a supervised training method, based on a first loss function, adjusting the parameters of the scene detection network, when the initial scene detection model after adjusting the parameters meets the training end condition, the initial scene detection model after adjusting the parameters is determined as the trained scene detection model. The embodiments of the present application realize setting a three-dimensional feature extraction network in the scene detection model to extract the three-dimensional features of the image, and the three-dimensional features include depth information, so that when using the three-dimensional features for scene detection, the three-dimensional depth information of the object can be effectively used to accurately predict the category, position, size and other information of various objects in the scene, greatly improving the accuracy of scene detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0012] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0013] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0014] Figure 1 A flowchart of a method for training a scene detection model provided in an embodiment of the present application;

[0015] Figure 2 A flowchart of another scene detection model training method provided in an embodiment of the present application;

[0016] Figure 3 A schematic diagram of the structure of a scene detection model provided in an embodiment of the present application;

[0017] Figure 4 A flowchart of another method for training a scene detection model provided in an embodiment of the present application;

[0018] Figure 5 A flowchart of another method for training a scene detection model provided in an embodiment of the present application;

[0019] Figure 6 A flowchart of another method for training a scene detection model provided in an embodiment of the present application;

[0020] Figure 7 A flowchart of another method for training a scene detection model provided in an embodiment of the present application;

[0021] Figure 8 A schematic diagram of the structure of a road detection subnetwork and a target detection subnetwork provided in an embodiment of the present application;

[0022] Fig. 9 A flowchart of another method for training a scene detection model provided in an embodiment of the present application;

[0023] Fig.10 A flowchart of another method for training a scene detection model provided in an embodiment of the present application;

[0024] Fig.11 A flowchart of another method for training a scene detection model provided in an embodiment of the present application;

[0025] Fig.12 A schematic diagram of a process flow of a pre-training method for a three-dimensional feature extraction network provided in an embodiment of the present application;

[0026] Fig.13 A schematic diagram of the connection relationship between the initial three-dimensional feature extraction network and the initial occupancy grid prediction network provided in an embodiment of the present application;

[0027] Fig.14 A schematic diagram of the structure of a training device for a scene detection model provided in an embodiment of the present application;

[0028] Fig.15 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0029] Various exemplary embodiments of the present application will now be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. It should be noted that unless otherwise specifically stated, the relative arrangement of the components and steps, the numerical expressions and the numerical values ​​described in these embodiments do not limit the scope of the present application.

[0030] Those skilled in the art will understand that the terms "first" and "second" in the embodiments of the present application are only used to distinguish between different steps, devices, modules and other objects, and do not represent any specific technical meanings, nor do they indicate the logical order between them.

[0031] It should also be understood that in this embodiment, “plurality” may refer to two or more than two, and “at least one” may refer to one, two or more than two.

[0032] It should also be understood that any component, data or structure mentioned in the embodiments of the present application can generally be understood as one or more, unless explicitly limited or otherwise indicated in the context.

[0033] In addition, the term "and / or" in this application is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this application generally indicates that the associated objects before and after are in an "or" relationship.

[0034] It should also be understood that the description of the various embodiments in this application focuses on the differences between the various embodiments, and the same or similar aspects thereof can be referenced to each other, and for the sake of brevity, they will not be described one by one.

[0035] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present application, its application, or uses.

[0036] Technologies, circuits, and devices known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the above-mentioned technologies, circuits, and devices should be considered as part of the specification.

[0037] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0038] It should be noted that, in the absence of conflict, the embodiments in this application and the features in the embodiments can be combined with each other. To facilitate the understanding of the embodiments of the present application, the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0039] In order to solve the technical problem of low accuracy of scene detection using images from the target perspective in the prior art, the present application provides a training method for a scene detection model, which can effectively utilize the three-dimensional features of the image and improve the accuracy of scene detection from the target perspective.

[0040] Figure 1 A flow chart of a training method for a scene detection model provided in an embodiment of the present application. This method can be applied to one or more electronic devices such as various vehicles (e.g., smart driving vehicles), desktop computers, portable computers, smart phones, laptops, servers, etc. In addition, the execution subject of this method can be hardware or software. When the above-mentioned execution subject is hardware, the execution subject can be one or more of the above-mentioned electronic devices. For example, a single electronic device can execute this method, or multiple electronic devices can cooperate with each other to execute this method. When the above-mentioned execution subject is software, this method can be implemented as multiple software or software modules, or as a single software or software module. It is not specifically limited here.

[0041] like Figure 1 As shown, the method specifically includes:

[0042] Step 101: Obtain at least one first sample image taken from at least one viewing angle and corresponding annotated scene information.

[0043] In this embodiment, at least one first sample image may be an image captured by one or more cameras at different viewing angles. For example, at least one first sample image may be an image of the surrounding environment captured by cameras installed at multiple locations outside the vehicle.

[0044] The annotated scene information represents information about objects, roads, environments, etc. in the current scene. For example, the annotated scene information may include road information, object category information, object location information, etc.

[0045] Step 102 , using a pre-trained three-dimensional feature extraction network included in a preset initial scene detection model, extract three-dimensional features from at least one first sample image under a target viewing angle to obtain three-dimensional feature data.

[0046] In this embodiment, the initial scene detection model can be an untrained model with initialized parameters, or a trained but incomplete model. The three-dimensional feature extraction network is used to extract the depth information in the at least one first sample image, and determine the spatial position, size and other information of various objects. The target perspective is a pre-set fixed perspective. For example, the target perspective is a bird's-eye view, and accordingly, the three-dimensional feature data can be the feature data of the BEV image after the at least one first sample image is converted to BEV.

[0047] The three-dimensional feature extraction network can be constructed based on neural network models of various structures. For example, the three-dimensional feature extraction network can be a backbone network (backbone) and a three-dimensional feature encoder (3D Encoder) included in the LSS (Multi-view Stereo Vision System), which can perform three-dimensional feature extraction, perspective conversion and feature splicing on at least one first sample image to generate BEV features in the current scene. In addition, when training the three-dimensional feature extraction network, an object position detection method can also be introduced so that the three-dimensional feature extraction network can extract the position features of the object. For example, an OCC detection network or other networks for obstacle detection can be used to extract obstacle position information from three-dimensional feature data, and the parameters of the three-dimensional feature extraction network can be adjusted based on the obstacle information, so that the three-dimensional feature extraction network has the ability to identify the three-dimensional features of obstacles.

[0048] The method for pre-training the three-dimensional feature extraction network can adopt an unsupervised training method or a supervised training method.

[0049] Step 103: Use the scene detection network included in the initial scene detection model to perform scene detection on the three-dimensional feature data to obtain predicted scene information.

[0050] In this embodiment, the scene detection network is used to perform scene detection on the three-dimensional feature data converted to the target perspective to identify the categories, shapes, positions and other features of various objects, roads and other objects in the corresponding scene.

[0051] As an example, the scene detection network may include an object detection subnetwork that can extract the categories and locations of various objects from the three-dimensional feature data. The scene detection network may include a road detection subnetwork that can extract features such as the type, direction, and range of the road from the three-dimensional feature data.

[0052] Step 104: Calculate a first loss value representing an error between the predicted scene information and the labeled scene information using a preset first loss function.

[0053] In this embodiment, the first loss function can be set according to the type of predicted scene information. For example, if the predicted scene information contains category information, the first loss function may include a loss function for classification (such as a cross entropy loss function, etc.); if the predicted scene information contains regression information (such as predicted vehicle speed, driving trajectory, etc.), the first loss function may include a loss function for regression (such as a mean square error loss function, etc.). When the first loss function contains multiple sub-loss functions, each sub-loss function may be weighted and summed to obtain the first loss value.

[0054] Step 105: Use the first loss value to adjust the parameters of the scene detection network.

[0055] In this embodiment, the gradient descent method and the back propagation method can be used to iteratively update the parameters of the scene detection network so that the above-mentioned first loss value is gradually reduced. Usually, each iteration requires executing the above-mentioned steps 101 to 105 once, that is, iteratively training the model using multiple sets of training samples. The adjusted model obtained after each iteration is used as the initial scene detection model for the next iteration, and the iteration is repeated multiple times until the scene detection network included in the adjusted initial scene detection model meets the preset training end condition.

[0056] It should be noted that, since the above three-dimensional feature extraction network is pre-trained, this step can only adjust the parameters of the scene detection network. Optionally, during training, the parameters of the scene detection network and the above three-dimensional feature extraction network can also be adjusted simultaneously to gradually converge the first loss value.

[0057] Step 106, in response to the scene detection network after adjusting parameters meeting a preset training end condition, determining the current initial scene detection model as the trained scene detection model.

[0058] In this embodiment, the above-mentioned training end conditions may include but are not limited to at least one of the following: the training time exceeds the preset duration; the number of training times exceeds the preset number of times; the calculated loss value converges; the prediction accuracy obtained by testing the model using the test sample exceeds the accuracy threshold.

[0059] When using the trained scene detection model, images taken from at least one shooting angle can be collected and input into the scene detection model to obtain predicted scene information (e.g., including predicted object information and predicted road information). This scene detection model is applicable to various fields such as autonomous driving, intelligent traffic management, and urban planning. For example, in autonomous driving, it can be used to perceive the surrounding environment in real time and accurately identify pedestrians, vehicles, and obstacles. In intelligent traffic management, it can provide accurate traffic flow monitoring and vehicle tracking, helping to optimize traffic light control and road condition management. In urban planning, it can be used for building structure monitoring and urban space planning, providing data to support the intelligent development of cities.

[0060] The training method of the scene detection model provided in the embodiment of the present application uses a pre-trained three-dimensional feature extraction network included in the initial scene detection model to extract three-dimensional features from at least one first sample image under the target perspective to obtain three-dimensional feature data, uses the scene detection network included in the initial scene detection model to perform scene detection on the three-dimensional feature data to obtain predicted scene information, and then uses a supervised training method to adjust the parameters of the scene detection network based on a first loss function, and when the initial scene detection model after adjusting the parameters meets the training end condition, the initial scene detection model after adjusting the parameters is determined as the trained scene detection model. The embodiment of the present application realizes setting a three-dimensional feature extraction network in the scene detection model to extract the three-dimensional features of the image, and the three-dimensional features contain depth information, so that when using the three-dimensional features for scene detection, the three-dimensional depth information of the object can be effectively used to accurately predict the category, position, size and other information of various objects in the scene, greatly improving the accuracy of scene detection.

[0061] In some optional implementations of this embodiment, such as Figure 2 As shown, step 103 includes:

[0062] Step 1031, using the road detection subnetwork included in the scene detection network, perform road detection on the three-dimensional feature data to obtain predicted road information.

[0063] like Figure 3 As shown, the scene detection model includes a scene detection network, and the scene detection network includes a road detection subnetwork and a target detection subnetwork. Generally, the scene detection model as a whole includes a three-dimensional feature extraction network including a backbone network (backbone), the scene detection network can be used as a head network (head), the road detection subnetwork as a head network (maphead) for predicting road information in the map, and the target detection subnetwork as a head network (objhead) for predicting target objects.

[0064] The road detection subnetwork can be constructed based on a convolutional neural network model. For example, the road detection subnetwork can include a convolution layer, a pooling layer, a fully connected layer, a classifier, and other parts to extract the spatial structure features and category features of the road from the three-dimensional feature data, and then obtain the predicted road information representing the spatial structure of the road, the road category, and other features.

[0065] Step 1032, using the target detection subnetwork included in the scene detection network, perform target detection on the three-dimensional feature data to obtain predicted object information.

[0066] The road detection subnetwork can also be constructed based on the convolutional neural network model. For example, the road detection subnetwork can include convolutional layers, pooling layers, fully connected layers, classifiers, regression layers, etc., to extract the features of each object from the three-dimensional feature data, and then obtain the predicted object information representing the shape, size, position, motion state, etc. of the object.

[0067] Step 1033: determine the predicted object information and the predicted road information as predicted scene information.

[0068] This embodiment sets a road detection subnetwork and a target detection subnetwork in the scene detection network, thereby effectively utilizing three-dimensional features for road recognition and target recognition on the basis of a pre-trained three-dimensional feature extraction network, thereby being able to perceive the environment more comprehensively and accurately and improving the detection accuracy of the scene detection model.

[0069] In some optional implementations of this embodiment, the annotated scene information includes annotated road information and annotated object information. The annotated road information indicates the real road conditions in the scene corresponding to the at least one first sample image, such as the category, boundary line, lane line, intersection location, road topology, and other information of the real road. The annotated object information indicates the conditions of the real object in the scene, such as the location, category, speed, movement trajectory, and other information of the real object.

[0070] like Figure 4 As shown, step 104 includes:

[0071] Step 1041: Calculate a first sub-loss value representing an error between the predicted road information and the labeled road information using a first sub-loss function included in the first loss function.

[0072] Among them, the first sub-loss function may include a classification loss function (such as a cross entropy loss function) for classifying roads, that is, the road detection subnetwork classifies pixels in the image to determine the category to which the pixel belongs (such as lane lines, boundary lines, intersections, etc.), and the first sub-loss function can calculate the probability error between the predicted category and the true category to obtain the first sub-loss value.

[0073] Step 1042: Calculate a second sub-loss value representing an error between the predicted object information and the labeled object information using a second sub-loss function included in the first loss function.

[0074] Among them, the second sub-loss function may include a classification loss function for classifying roads, and may also include a regression loss function for predictive regression (such as a mean square error loss function). Different loss functions may correspond to a weight, and the weighted sum of the loss values ​​is used to obtain the second sub-loss value. That is, the target detection subnetwork classifies the pixels in the image to determine the object category to which the pixel belongs (such as vehicles, pedestrians, traffic signs, etc.). The target detection subnetwork can also predict the motion state of objects on the road to determine the speed, motion trajectory, etc. of the target object. The second sub-loss function can calculate the probability error between the predicted object category and the real object category, and calculate the error between the predicted motion state and the real motion state to obtain the second sub-loss value.

[0075] Step 1043: determine a first weight corresponding to the first sub-loss function and a second weight corresponding to the second sub-loss function.

[0076] Optionally, the first weight and the second weight can be manually set in advance, or the density, quantity and other characteristics of the object distribution in the shooting scene can be counted, and the first weight and the second weight can be automatically set according to the statistical results. For example, the corresponding relationship between the number of objects and the first weight can be expressed by a table or a calculation formula. The principle of the corresponding relationship is that the more objects there are, the greater the weight of the road detection task will be, that is, the greater the first weight, and at the same time, the weight of the target detection task will be reduced, that is, the smaller the second weight will be.

[0077] Step 1044, based on the first sub-loss value, the second sub-loss value, the first weight and the second weight, calculate a first loss value representing the error between the predicted scene information and the labeled scene information.

[0078] Specifically, the first weight may be multiplied by the first sub-loss value, and the second weight may be multiplied by the second sub-loss value, and the two products may be added to obtain the above-mentioned first loss value.

[0079] This embodiment calculates the prediction errors of predicted road information and predicted object information for the road detection subnetwork and the object detection network respectively by setting the first sub-loss function and the second sub-loss function, and by setting the first weight and the second weight, the focus of the current training process can be adjusted based on the scene corresponding to the sample image, thereby improving the adaptability of the road detection subnetwork and the object detection network to the actual scene, and further improving the accuracy of the predicted road information and the predicted object information.

[0080] In some optional implementations of this embodiment, such as Figure 5 As shown, step 1043 includes:

[0081] Step 10431: Acquire sensing information obtained by sensing a scene corresponding to at least one first sample image.

[0082] Among them, the sensing information can include various types of information such as image information taken by the camera and point cloud information collected by the lidar.

[0083] Step 10432, based on the sensing information, determine the object density information in the scene and the number of target objects in the scene.

[0084] The object density information and the number of target objects are usually obtained by pre-calibration, and the object density information and the number of target objects can be obtained by manual calibration or detected by electronic equipment.

[0085] The object density indicates the distribution of various objects in the scene. For example, object detection can be performed on image information, and the object density can be calculated based on the number of all objects and the image area as the object density information. For another example, point cloud data can be counted to calculate the density of the point cloud in the scene. The larger the point cloud density, the more objects there are. Therefore, the point cloud density can be used as the object density information.

[0086] The number of target objects is the number of objects of a specific type. For example, the target objects may include vehicles and / or pedestrians. The number of target objects is identified from the image information included in the sensing information by using the target detection method.

[0087] Step 10433, based on the density information and the number of target objects, a preset weight algorithm is used to determine the first weight and the second weight.

[0088] The weight algorithm may include a preset calculation formula, and the density information and the number of target objects are calculated according to the calculation formula to obtain the first weight and the second weight. Optionally, the weight algorithm may also include a corresponding relationship table, and the weights corresponding to different density information and the number of target objects may be pre-counted, and the first weight and the second weight may be found from the table.

[0089] As an example, the first weight and the second weight may be calculated by the following calculation formula:

[0090] (1)

[0091] (2)

[0092] Wherein, a and b represent the first weight and the second weight respectively, ρ represents the density information, N represents the number of target objects, α and β are adjustment parameters that can be adjusted through experiments or experience to balance the influence of density information and the number of target objects on the weight.

[0093] The above formula takes into account the impact of ρ and N on the weights of the two tasks, and uses an exponential function to adjust the impact of the number of targets on the weights. When ρ is high, the scene is dense, resulting in increased object overlap and occlusion, and the difficulty of the target detection task will increase. Therefore, the weight of the target detection task will increase to improve the accuracy of target detection, and the corresponding weight of the road detection task will decrease. When the number of target objects N is large, the focus of the detection task does not have to be placed on a single target, but should be placed on the road detection task to improve the understanding of road space information. Therefore, the weight of the road detection task will increase, and the weight of the target detection task will decrease.

[0094] Exponential terms in formulas and It is used to smoothly adjust the effect of the number of target objects on the weight. This function is mathematically continuous and differentiable, so in actual optimization, it is convenient to apply methods such as gradient descent to adjust parameters.

[0095] This embodiment sets a weight algorithm to introduce the influence of the density of objects and the number of target objects in the actual scene on the task weight during the training process, and balances these influences through appropriate parameter adjustment. In this way, the weights of the two tasks can be dynamically adjusted to adapt to different scene characteristics and task requirements, thereby helping to further improve the adaptability of the trained scene detection model to the actual scene and improve the detection accuracy of the scene detection model.

[0096] In some optional implementations of this embodiment, such as Figure 6 As shown, step 10432 includes:

[0097] Step 104321, calculate the density of occupied pixels in the image included in the sensing information to obtain pixel occupancy density.

[0098] Among them, occupied pixels are pixels contained in the area where the objects in the scene are located. The objects here can be various types of objects, such as obstacles on the ground, animals and plants, pedestrians, vehicles, buildings, etc. Electronic devices can use methods such as semantic segmentation to determine the areas of various objects, and then determine the occupied pixels. Areas that do not contain objects, such as pixels in the sky, open space, water surface, etc., are unoccupied pixels. The pixel occupancy density can be obtained by dividing the number of occupied pixels mentioned above by the total number of pixels in the image. Generally, the greater the pixel occupancy density, the more objects are within a close distance to the camera, or the larger the volume of the objects.

[0099] Step 104322, calculate the density of the point cloud data included in the sensing information to obtain the point cloud density.

[0100] Specifically, point cloud data can be collected by laser radar and other equipment. Generally, the greater the density of points represented by point cloud data, the greater the number of objects within a relatively close distance, or the larger the volume of the objects.

[0101] Step 104323, calculate the density of the object in the image included in the sensing information to obtain the object density.

[0102] Specifically, the objects here can be various types of objects. The electronic device can use the target detection method to detect various types of objects in the image, count the number of objects, and use the number of objects within a specific range in the image as the object density.

[0103] Step 104324, determine the object density information based on at least one of the pixel occupancy density, the point cloud density, and the object density.

[0104] Specifically, the pixel occupancy density, point cloud density, and object density may be weightedly summed according to preset weights corresponding to the pixel occupancy density, point cloud density, and object density to obtain object density information.

[0105] Step 104325, counting the number of target objects in the image included in the sensing information to obtain the number of target objects.

[0106] Specifically, based on the objects detected in the above steps, the number of target objects can be determined, for example, vehicles, pedestrians, etc. are target objects.

[0107] This embodiment can integrate data of multiple dimensions by calculating pixel occupancy density, point cloud density, object density, and the number of target objects, so as to make the judgment of object distribution in the scene corresponding to the sample image more accurate, thereby making the calculation of the first weight and the second weight more accurate, thereby improving the adaptability and accuracy of the model to scene detection.

[0108] In some optional implementations of this embodiment, such as Figure 7 As shown, step 1031 includes:

[0109] Step 10311, using the road spatial structure detection branch included in the road detection subnetwork, perform road spatial structure detection on the three-dimensional feature data to obtain predicted road spatial structure information.

[0110] like Figure 8As shown, the road detection subnetwork includes a road spatial structure detection branch and a road topological structure detection branch, and the two branches share a feature extraction unit composed of the first few layers of a convolutional neural network (CNN). The feature extraction unit further extracts features from the input three-dimensional feature data. The road spatial structure detection branch uses the input feature data to detect the road spatial structure to determine the spatial structure information of the road, such as the boundary line, lane line, and intersection position. The road spatial structure detection branch may include a classifier, which uses the input feature data to classify the pixels contained in the image under the target perspective to determine the corresponding areas such as the boundary line, lane line, and intersection position. The above spatial structure information is conducive to the positioning and navigation of the vehicle on the road.

[0111] Step 10312, using the road topology detection branch included in the road detection subnetwork, perform road topology detection on the three-dimensional feature data to obtain predicted road topology information.

[0112] The road topology detection branch detects the road topology using the input feature data to determine the topology information such as the connection relationship and extension direction of each road section. The road topology detection branch may also include a classifier, which uses the input feature data to classify the pixels contained in the image under the target perspective to determine each road section and the topology information such as the connection relationship of each road section. The above road topology information is helpful for the vehicle to plan and navigate the path on the road.

[0113] Step 10313: Determine the predicted road spatial structure information and the predicted road topological structure information as predicted road information.

[0114] This embodiment sets a road spatial structure detection branch and a road topological structure detection branch in the road detection subnetwork, so that the road detection subnetwork detects the road spatial structure and the road topological structure using the three-dimensional feature data under the target perspective, and predicts more comprehensive road information, which helps to train scene detection models for the road spatial structure and the topological structure. When the trained scene detection model is used in subsequent actual scenarios, richer and more accurate road information can be obtained, which helps with vehicle positioning, path planning and navigation.

[0115] In some optional implementations of this embodiment, the annotated road information includes annotated road spatial structure information and annotated road topological structure information. The annotated road spatial structure information and the annotated road topological structure information represent the real road spatial structure and topological structure in the scene corresponding to the first sample image.

[0116] The first sub-loss function includes a road space structure loss function and a road topology structure loss function, wherein the road space structure loss function corresponds to a road space structure detection branch, and the road topology structure loss function corresponds to a road topology structure detection branch. The types of the road space structure loss function and the road topology structure loss function may be loss functions for classification, such as a cross entropy loss function.

[0117] like Fig. 9 As shown, step 1041 includes:

[0118] Step 10411, using the road spatial structure loss function, calculate the road spatial structure loss value representing the error between the predicted road spatial structure information and the annotated road spatial structure information.

[0119] Specifically, the road space structure loss function can be a cross entropy loss function, as shown in the following formula (3):

[0120] (3)

[0121] in, represents the road spatial structure loss value, N represents the number of training samples, K represents the number of spatial structures, represents the spatial structure information of the annotated road of the i-th sample, Represents the probability distribution of predicted road spatial structure information.

[0122] Step 10412: Calculate a road topology loss value representing the error between the predicted road topology information and the annotated road topology information using the road topology loss function.

[0123] Specifically, the road space structure loss function may be a cross entropy loss function, as shown in the following formula (4):

[0124] (4)

[0125] in, represents the road topology loss value, M represents the number of road topology structures, represents the annotated road topological structure information of the i-th sample, Represents the probability distribution of predicted road topology information.

[0126] Step 10413, determining a first sub-loss value based on the road spatial structure loss value and the road topological structure loss value.

[0127] Specifically, the first sub-loss value can be calculated according to the following formula (5):

[0128] (5)

[0129] Among them, c and d are preset weights.

[0130] This embodiment sets loss functions corresponding to the road spatial structure detection branch and the road topology structure detection branch respectively, thereby utilizing the real data and predicted data of the road spatial structure, and the real data and predicted data of the road topology structure, to specifically judge the prediction errors of the road spatial structure detection branch and the road topology structure detection branch, thereby adjusting the model parameters according to the model's road information perception capability and improving the model's road information prediction accuracy.

[0131] In some optional implementations of this embodiment, such as Fig.10 As shown, step 1032 includes:

[0132] Step 10321, using the object category detection branch included in the target detection subnetwork, perform object category detection on the three-dimensional feature data to obtain predicted object category information.

[0133] like Figure 8 As shown, the target detection subnetwork includes an object category detection branch and an object motion state detection branch. The two branches share a feature extraction unit composed of the first few layers of a convolutional neural network (CNN). The feature extraction unit further extracts features from the input three-dimensional feature data. The object category detection branch uses the input feature data to classify objects in the image to determine information such as the category and position of the object. The above-mentioned predicted object category information may include the object category and position. The object category detection branch may include a classifier that uses the input feature data to classify the pixels contained in the image under the target perspective to determine the category and position of the target object.

[0134] Step 10322, using the object motion state detection branch included in the target detection subnetwork, perform object motion state detection on the three-dimensional feature data to obtain predicted object motion state information.

[0135] The object motion state detection branch detects the object motion state based on the predicted object category information using the input feature data to determine the target object's motion speed, direction, predicted trajectory, etc. The object motion state information may include motion speed, direction, predicted trajectory, etc.

[0136] The object motion state detection branch may include a regression layer, which uses the input feature data to perform regression prediction on the motion state of the target object to obtain predicted object motion state information corresponding to the target object.

[0137] Optionally, the object motion state detection branch may include a speed prediction unit and a trajectory prediction unit, which respectively perform speed prediction and trajectory prediction. The speed prediction unit may use a network with a fully connected structure, and the trajectory prediction unit may use a network based on time series data, such as an LSTM (Long Short Term Memory) network.

[0138] Step 10323: Determine the predicted object category information and the predicted object motion state information as the predicted object information.

[0139] This embodiment sets an object category detection branch and an object motion state detection branch in the target detection subnetwork, so that the target detection subnetwork uses the three-dimensional feature data under the target perspective to detect the category and position of the target object, as well as the motion state of the target object, and predicts more comprehensive object information, which helps to train scene detection models for object categories and object motion states. When the trained scene detection model is used in subsequent actual scenarios, richer and more accurate object information can be obtained, which helps the vehicle to judge obstacles and plan paths.

[0140] In some optional implementations of this embodiment, the annotated road information includes annotated object category information and annotated object motion state information, which represent the real object category, position and motion state in the scene corresponding to the first sample image.

[0141] The second sub-loss function includes an object category loss function and an object motion state loss function, wherein the object category loss function corresponds to the object category detection branch, and the object motion state loss function corresponds to the object motion state detection branch. The type of the object category loss function may be a loss function for classification, such as a cross entropy loss function. The type of the object motion state loss function may be a regression loss function, such as a mean square error loss function (MSE), a mean absolute error loss function (MAE), and the like.

[0142] like Fig.11 As shown, the above step 1042 includes:

[0143] Step 10421, using the object category loss function, calculate the object category loss value representing the error between the predicted object category information and the labeled object category information.

[0144] Specifically, the object category loss function may be a cross entropy loss function, as shown in the following formula (6):

[0145] (6)

[0146] in, Represents the object category loss value, N represents the number of samples, represents the labeled object category information of the i-th sample, Represents the probability distribution of predicted object category information.

[0147] Step 10422, using the object motion state loss function, calculate the object motion state loss value representing the error between the predicted object motion state information and the labeled object motion state information.

[0148] Specifically, the object category loss function can be a regression loss function, as shown in the following formula (7):

[0149] (7)

[0150] in, Indicates the loss value of the object's motion state, Indicates the motion status information of the labeled object. Represents the predicted object motion state information.

[0151] Optionally, when the object motion state detection branch includes a speed prediction unit and a trajectory prediction unit, the above formula (7) can be used to calculate the speed prediction loss value and the trajectory prediction loss value respectively. When calculating the speed prediction loss value, represents the pre-annotated true velocity vector, Represents the predicted velocity vector. When calculating the trajectory prediction loss value, represents the real trajectory information marked in advance, Represents the predicted trajectory information. The weighted sum of the velocity prediction loss value and the trajectory prediction loss value can be used to obtain the object motion state loss value.

[0152] Step 10423, determine the second sub-loss value based on the object category loss value and the object motion state loss value.

[0153] Specifically, the second sub-loss value can be calculated according to the following formula (8):

[0154] (8)

[0155] Among them, e and f are preset weights.

[0156] This embodiment sets loss functions corresponding to the object category detection branch and the object motion state detection branch respectively, and realizes the use of real data and predicted data of the object category, and real data and predicted data of the object motion state, to specifically judge the prediction errors of the object category detection branch and the object motion state detection branch, thereby adjusting the model parameters according to the target detection capability of the model and improving the target detection accuracy of the model.

[0157] In some optional implementations of this embodiment, such as Fig.12 As shown, the 3D feature extraction network is pre-trained according to the following steps:

[0158] Step 1201, using a preset initial three-dimensional feature extraction network, extract three-dimensional features from at least two groups of second sample images under a target viewing angle to obtain a sample three-dimensional feature data sequence.

[0159] Each group of second sample images includes at least one second sample image. The second sample image may be the same as or different from the first sample image. The at least two groups of second sample images may be multiple groups of images taken at different times by cameras with different viewing angles.

[0160] The initial three-dimensional feature extraction network can be an untrained neural network model with initialized parameters, or a trained but incomplete model. The initial three-dimensional feature extraction network is used to extract the three-dimensional depth information in each group of second sample images in turn, and the at least two three-dimensional feature data obtained constitute the sample three-dimensional feature data sequence. The above-mentioned target perspective is the same as the target perspective described in the above step 102. For example, the target perspective is a top-down perspective, and accordingly, the three-dimensional feature data can be the feature data of the BEV image after the BEV conversion of each group of first sample images.

[0161] The three-dimensional feature extraction network can be constructed based on neural network models of various structures. For example, the three-dimensional feature extraction network can be the backbone network and three-dimensional feature encoder included in LSS, which can perform three-dimensional feature extraction, perspective conversion and feature splicing on at least one first sample image to generate BEV features in the current scene.

[0162] Step 1202, using a preset initial occupancy grid prediction network, performs occupancy grid prediction on the obtained sample three-dimensional feature data sequence to obtain an occupancy grid image sequence.

[0163] Among them, the occupancy grid prediction network (Occupancy Network) can divide the image into multiple three-dimensional grid units, reflect the occupancy of the unit through voxels (Voxel), and predict the semantic category, speed, direction information, etc. contained in each occupied unit. Each occupied grid image in the occupancy grid image sequence of this step is an image under the target perspective, and each grid in the image indicates whether there is a corresponding object occupying the grid in the three-dimensional space.

[0164] like Fig.13 As shown, multiple groups of second sample images are sequentially input into the initial three-dimensional feature extraction network, and the initial three-dimensional feature extraction network may include a backbone network and a three-dimensional feature encoder. For each group of second sample images, the backbone network is first used to extract features of the input second sample images, and then the three-dimensional feature encoder is used to convert each second sample image from the initial perspective to the target perspective, and the features under the target perspective are spliced ​​to obtain sample three-dimensional feature data. The occupancy grid prediction network processes the input sample three-dimensional feature data, predicts the occupancy of each grid, and outputs an occupancy grid image.

[0165] Step 1203: Calculate a second loss value representing the similarity gap between different sample three-dimensional feature data pairs in the sample three-dimensional feature data sequence based on a preset second loss function.

[0166] Specifically, the second loss function can adopt a feature contrast loss function. First, define positive samples and negative samples. Positive samples: In contrastive learning, this usually refers to two frames from the same video clip or the same time window. Although they may have slight differences in content (such as changes in the position or angle of an object), they still belong to the same scene or the same time period. Negative samples: They are usually frame images from different video clips, different time windows, or different scenes. Compared with positive samples, they are more different.

[0167] In the feature contrast loss function, we hope to encourage the model to regard images in the same video clip or time window as positive samples and learn the similarity relationship between them. At the same time, the model should also be able to recognize and distinguish frame images between different video clips or time windows and regard them as negative samples. In short, for multiple frame images, the definition of positive and negative samples should be based on the similarity or difference of content, not just scene or time. Therefore, assuming that the time window contains 4 frames of images, the second loss function is as shown in equation (9):

[0168] (9)

[0169] Where bev represents the feature vector, i.e., the three-dimensional feature data of the sample; i and j represent the vector index, i∈{1,2,3,4}, j∈{1,2,3,4}, j≠i. cos(bev i ,bev j ) and cos(bev i ,bev j+1 ) represent the calculation of bev i With bev j 、bev j+1 The cosine similarity between them; margin is a hyperparameter used to control the interval between positive and negative samples; ReLu is the activation function.

[0170] Step 1204, based on a preset third loss function, calculate a third loss value representing an occupied grid gap between each pair of adjacent occupied grid images in the occupied grid image sequence.

[0171] Specifically, the third loss function can also be called a spatiotemporal consistency loss function. This loss function can calculate the loss between the occupied grid images corresponding to adjacent frames, so as to enable the model to learn the consistency information between consecutive frames.

[0172] Assume that the grid image sequence is ,in Indicates the first The space-time consistency loss function is defined as follows:

[0173] (10)

[0174] Where i is the index of the sequence, , and are two adjacent elements in the sequence, express and The distance between them, such as the Euclidean distance.

[0175] Step 1205: Adjust parameters of the initial three-dimensional feature extraction network and the initial occupancy grid prediction network based on the second loss value and the third loss value.

[0176] Specifically, the second loss value and the third loss value can be weighted and summed to obtain a total loss value, and the weight value can be preset. Then, the gradient descent method and the back propagation method can be used to iteratively update the parameters of the initial occupied grid prediction network so that the above total loss value is gradually reduced. Usually, each iteration requires executing the above steps 1201-1205 once, that is, iteratively training the model using multiple sets of training samples. The adjusted model obtained after each iteration is used as the initial occupied grid prediction network for the next iteration, and it is iterated multiple times until the adjusted initial occupied grid prediction network meets the preset training end condition.

[0177] Step 1206, in response to the initial three-dimensional feature extraction network and the initial occupancy grid prediction network after adjusting parameters meeting the training end condition, the initial three-dimensional feature extraction network after adjusting parameters is determined as the trained three-dimensional feature extraction network.

[0178] Specifically, the above training end conditions may include but are not limited to at least one of the following: the training time exceeds a preset duration; the number of training times exceeds a preset number of times; the calculated loss value converges, etc.

[0179] The training method used in this embodiment does not pre-set the annotation information, but adopts a self-supervised or unsupervised training method to automatically adjust the model parameters according to the loss function so that it has the ability to predict the spatiotemporal characteristics of the object. After the training end conditions are met, the current initial three-dimensional feature extraction network can be used as the pre-trained three-dimensional feature extraction network, and the three-dimensional feature extraction network is used to perform the above steps 101 to 106.

[0180] This embodiment adopts a self-supervised training method, which does not require setting annotation information, greatly improving the efficiency of training the three-dimensional feature extraction network. The pre-trained three-dimensional feature extraction network has the ability to extract more accurate three-dimensional feature data. Combined with the above embodiments, it realizes the combination of self-supervised learning and supervised learning, thereby accelerating the speed of extracting three-dimensional feature detection from the target perspective and improving the accuracy of detection. Compared with the traditional BEV detection method, the introduction of OCC task pre-training allows the model to better understand the occupancy of the scene, thereby more accurately detecting and locating the target.

[0181] Fig.14A schematic diagram of the structure of a training device for a scene detection model provided in an embodiment of the present application. Specifically comprising: an acquisition module 1401, for acquiring at least one first sample image taken from at least one perspective, and the corresponding annotated scene information; an extraction module 1402, for using a pre-trained three-dimensional feature extraction network included in a preset initial scene detection model to extract three-dimensional features from at least one first sample image under a target perspective to obtain three-dimensional feature data; a detection module 1403, for using a scene detection network included in the initial scene detection model to perform scene detection on the three-dimensional feature data to obtain predicted scene information; a calculation module 1404, for using a preset first loss function to calculate a first loss value representing the error between the predicted scene information and the annotated scene information; a training module 1405, for using the first loss value to adjust the parameters of the scene detection network; and a determination module 1406, for determining the current initial scene detection model as the trained scene detection model in response to the scene detection network after adjusting the parameters meeting the preset training end condition.

[0182] In some optional implementations of this embodiment, the detection module includes: a first detection unit, used to perform road detection on the three-dimensional feature data using a road detection subnetwork included in the scene detection network, and obtain predicted road information; a second detection unit, used to perform target detection on the three-dimensional feature data using a target detection subnetwork included in the scene detection network, and obtain predicted object information; a first determination unit, used to determine the predicted object information and the predicted road information as predicted scene information.

[0183] In some optional implementations of this embodiment, the labeled scene information includes labeled road information and labeled object information; the calculation module includes: a first calculation unit, used to calculate a first sub-loss value representing the error between the predicted road information and the labeled road information using a first sub-loss function included in the first loss function; a second calculation unit, used to calculate a second sub-loss value representing the error between the predicted object information and the labeled object information using a second sub-loss function included in the first loss function; a second determination unit, used to determine a first weight corresponding to the first sub-loss function and a second weight corresponding to the second sub-loss function; and a third calculation unit, used to calculate the first loss value representing the error between the predicted scene information and the labeled scene information based on the first sub-loss value, the second sub-loss value, the first weight, and the second weight.

[0184] In some optional implementations of the present embodiment, the second determination unit includes: an acquisition subunit, used to acquire sensing information obtained by sensing a scene corresponding to at least one first sample image; a first determination subunit, used to determine object density information in the scene and the number of target objects in the scene based on the sensing information; and a second determination subunit, used to determine the first weight and the second weight based on the density information and the number of target objects using a preset weight algorithm.

[0185] In some optional implementations of the present embodiment, the first determination subunit is further used to: calculate the density of occupied pixels in the image included in the sensing information to obtain pixel occupancy density, wherein the occupied pixels are pixels contained in the area where the objects in the scene are located; calculate the density of point cloud data included in the sensing information to obtain point cloud density; calculate the density of objects in the image included in the sensing information to obtain object density; determine object density information based on at least one of the pixel occupancy density, point cloud density, and object density; and count the number of target objects in the image included in the sensing information to obtain the number of target objects.

[0186] In some optional implementations of the present embodiment, the first detection unit includes: a first detection subunit, used to perform road spatial structure detection on the three-dimensional feature data using a road spatial structure detection branch included in the road detection subnetwork, and obtain predicted road spatial structure information; a second detection subunit, used to perform road topology structure detection on the three-dimensional feature data using a road topology structure detection branch included in the road detection subnetwork, and obtain predicted road topology structure information; and a third determination subunit, used to determine the predicted road spatial structure information and the predicted road topology structure information as predicted road information.

[0187] In some optional implementations of the present embodiment, the labeled road information includes labeled road spatial structure information and labeled road topological structure information, the first sub-loss function includes a road spatial structure loss function and a road topological structure loss function, the road spatial structure loss function corresponds to a road spatial structure detection branch, and the road topological structure loss function corresponds to a road topological structure detection branch; the first calculation unit includes: a first calculation subunit, used to use the road spatial structure loss function to calculate a road spatial structure loss value representing the error between the predicted road spatial structure information and the labeled road spatial structure information; a second calculation subunit, used to use the road topological structure loss function to calculate a road topological structure loss value representing the error between the predicted road topological structure information and the labeled road topological structure information; a fourth determination subunit, used to determine the first sub-loss value based on the road spatial structure loss value and the road topological structure loss value.

[0188] In some optional implementations of the present embodiment, the second detection unit includes: a third detection subunit, used to perform object category detection on the three-dimensional feature data using the object category detection branch included in the target detection subnetwork, and obtain predicted object category information; a fourth detection subunit, used to perform object motion state detection on the three-dimensional feature data using the object motion state detection branch included in the target detection subnetwork, and obtain predicted object motion state information; and a fifth determination subunit, used to determine the predicted object category information and the predicted object motion state information as predicted object information.

[0189] In some optional implementations of this embodiment, the labeled road information includes labeled object category information and labeled object motion state information, the second sub-loss function includes an object category loss function and an object motion state loss function, the object category loss function corresponds to an object category detection branch, and the object motion state loss function corresponds to an object motion state detection branch; the second calculation unit includes: a third calculation subunit, used to use the object category loss function to calculate an object category loss value representing an error between the predicted object category information and the labeled object category information; a fourth calculation subunit, used to use the object motion state loss function to calculate an object motion state loss value representing an error between the predicted object motion state information and the labeled object motion state information; a sixth determination subunit, used to determine the second sub-loss value based on the object category loss value and the object motion state loss value.

[0190] In some optional implementations of the present embodiment, the three-dimensional feature extraction network is pre-trained according to the following steps: using a preset initial three-dimensional feature extraction network, performing three-dimensional feature extraction under a target perspective on at least two groups of second sample images respectively to obtain a sample three-dimensional feature data sequence; using a preset initial occupied grid prediction network, performing occupied grid prediction on the obtained sample three-dimensional feature data sequence respectively to obtain an occupied grid image sequence; based on a preset second loss function, calculating a second loss value representing a similarity gap between different sample three-dimensional feature data pairs in the sample three-dimensional feature data sequence; based on a preset third loss function, calculating a third loss value representing an occupied grid gap between each pair of adjacent occupied grid images in the occupied grid image sequence; based on the second loss value and the third loss value, adjusting parameters of the initial three-dimensional feature extraction network and the initial occupied grid prediction network; in response to the initial three-dimensional feature extraction network and the initial occupied grid prediction network after adjusting parameters meeting a training end condition, determining the initial three-dimensional feature extraction network after adjusting parameters as a trained three-dimensional feature extraction network.

[0191] The training device of the scene detection model provided in this embodiment can be as follows: Fig.14The training device of the scene detection model shown in can execute all steps of the above training methods of each scene detection model, thereby achieving the technical effects of the above training methods of each scene detection model. Please refer to the above related description for details. For the sake of brevity, it will not be repeated here.

[0192] Fig.15 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application, Fig.15 The electronic device 1500 shown includes: at least one processor 1501, a memory 1502, at least one network interface 1504 and other user interfaces 1503. The various components in the electronic device 1500 are coupled together via a bus system 1505. It is understood that the bus system 1505 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 1505 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 1505 is not described in detail. Fig.15 Various buses are labeled as bus system 1505.

[0193] The user interface 1503 may include a display, a keyboard, or a pointing device (eg, a mouse, a trackball, a touch pad, or a touch screen).

[0194] It can be understood that the memory 1502 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct memory bus random access memory (DRRAM). The memory 1502 described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0195] In some embodiments, the memory 1502 stores the following elements, executable units or data structures, or a subset thereof, or an extended set thereof: an operating system 15021 and an application program 15022 .

[0196] Among them, the operating system 15021 includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks. The application 15022 includes various application programs, such as a media player (Media Player), a browser (Browser), etc., which are used to implement various application services. The program for implementing the method of the embodiment of the present application can be included in the application 15022.

[0197] In this embodiment, by calling the program or instruction stored in the memory 1502, specifically, the program or instruction stored in the application 15022, the processor 1501 is used to execute the method steps provided by each method embodiment, for example, including:

[0198] Acquire at least one first sample image taken from at least one viewing angle, and corresponding annotated scene information; use a pre-trained three-dimensional feature extraction network included in a preset initial scene detection model to extract three-dimensional features from the at least one first sample image at a target viewing angle to obtain three-dimensional feature data; use a scene detection network included in the initial scene detection model to perform scene detection on the three-dimensional feature data to obtain predicted scene information; use a preset first loss function to calculate a first loss value representing the error between the predicted scene information and the annotated scene information; use the first loss value to adjust the parameters of the scene detection network; in response to the scene detection network after adjusting the parameters meeting the preset training end condition, determine the current initial scene detection model as the trained scene detection model.

[0199] The method disclosed in the above embodiment of the present application can be applied to the processor 1501, or implemented by the processor 1501. The processor 1501 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 1501. The above processor 1501 may be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor may be a microprocessor or the processor may also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to execute, or the hardware and software units in the decoding processor are combined and executed. The software unit may be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 1502, and the processor 1501 reads the information in the memory 1502 and completes the steps of the above method in combination with its hardware.

[0200] It is understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPDevice, DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the above functions of the present application, or a combination thereof.

[0201] For software implementation, the technology described above in this article can be implemented by a unit that performs the functions described above in this article. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.

[0202] The electronic device provided in this embodiment may be Fig.15 The electronic device shown in can execute all steps of the training method of each scene detection model described above, and thus achieve the technical effect of the training method of each scene detection model described above. Please refer to the above related description for details. For the sake of brevity, it will not be repeated here.

[0203] The embodiment of the present application also provides a storage medium (computer-readable storage medium). The storage medium here stores one or more programs. The storage medium may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a read-only memory, a flash memory, a hard disk or a solid-state drive; the memory may also include a combination of the above-mentioned types of memory.

[0204] When one or more programs in the storage medium can be executed by one or more processors, the training method of the scene detection model executed on the electronic device side can be implemented.

[0205] The above-mentioned processor is used to execute the program stored in the memory to implement the steps of the above-mentioned scene detection model training method executed on the electronic device side.

[0206] The professionals should further realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different circuits to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0207] The steps of the circuits or algorithms described in conjunction with the embodiments disclosed herein may be implemented using hardware, software modules executed by a processor, or a combination of the two. The software modules may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0208] It should be understood that the terms used in the text are only for the purpose of describing specific example embodiments, and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used in the text may also be represented to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The steps, processes, and operations described in the text are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.

[0209] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features applied for herein.

Claims

1. A method for training a scene detection model, characterized in that: The method comprises: Acquire at least one first sample image taken from at least one viewing angle, and corresponding annotated scene information; Using a pre-trained 3D feature extraction network included in a preset initial scene detection model, extracting 3D features from the at least one first sample image at a target perspective to obtain 3D feature data, wherein the 3D feature extraction network is used to extract 3D features from the at least one first sample image, and perform perspective conversion and feature splicing on the extracted features to obtain the 3D feature data at the target perspective; Using the scene detection network included in the initial scene detection model, performing scene detection on the three-dimensional feature data to obtain predicted scene information; Calculating a first loss value representing an error between the predicted scene information and the labeled scene information using a preset first loss function; Using the first loss value, adjusting parameters of the scene detection network; In response to the scene detection network after adjusting parameters meeting a preset training end condition, determining the current initial scene detection model as a trained scene detection model; The annotated scene information includes annotated road information and annotated object information; The calculating, using a preset first loss function, a first loss value representing an error between the predicted scene information and the labeled scene information includes: Calculating a first sub-loss value representing an error between the predicted road information and the labeled road information using a first sub-loss function included in the first loss function; Calculating, by using a second sub-loss function included in the first loss function, a second sub-loss value representing an error between the predicted object information and the labeled object information; Determine a first weight corresponding to the first sub-loss function and a second weight corresponding to the second sub-loss function; Calculating a first loss value representing an error between the predicted scene information and the labeled scene information based on the first sub-loss value, the second sub-loss value, the first weight, and the second weight; The determining a first weight corresponding to the first sub-loss function and a second weight corresponding to the second sub-loss function includes: Acquire sensing information obtained by sensing a scene corresponding to the at least one first sample image; Based on the sensing information, determine the density information of objects in the scene and the number of target objects in the scene; Based on the density information and the number of target objects, using a preset weight algorithm, the first weight and the second weight are determined according to the principle that the greater the number of objects, the greater the first weight representing the road detection task and the smaller the second weight representing the target detection task.

2. The method according to claim 1, characterized in that The step of performing scene detection on the three-dimensional feature data using the scene detection network included in the initial scene detection model to obtain predicted scene information includes: Using the road detection subnetwork included in the scene detection network, performing road detection on the three-dimensional feature data to obtain predicted road information; Using the target detection subnetwork included in the scene detection network, perform target detection on the three-dimensional feature data to obtain predicted object information; The predicted object information and the predicted road information are determined as predicted scene information.

3. The method according to claim 1, characterized in that Determining the object density information in the scene and the number of target objects in the scene based on the sensing information includes: Calculating the density of occupied pixels in the image included in the sensing information to obtain pixel occupancy density, wherein the occupied pixels are pixels contained in the area where the object in the scene is located; Calculating the density of the point cloud data included in the sensing information to obtain the point cloud density; Calculating the density of the object in the image included in the sensing information to obtain the object density; Determine the object density information based on at least one of the pixel occupancy density, the point cloud density, and the object density; The number of target objects in the image included in the sensing information is counted to obtain the number of target objects.

4. The method according to claim 1, characterized in that The method of using the road detection subnetwork included in the scene detection network to perform road detection on the three-dimensional feature data to obtain predicted road information includes: Using the road space structure detection branch included in the road detection subnetwork, the road space structure detection is performed on the three-dimensional feature data to obtain predicted road space structure information; Using the road topology structure detection branch included in the road detection subnetwork, the three-dimensional feature data is subjected to road topology structure detection to obtain predicted road topology structure information; The predicted road spatial structure information and the predicted road topological structure information are determined as the predicted road information.

5. The method according to claim 4, characterized in that The annotated road information includes annotated road spatial structure information and annotated road topological structure information, the first sub-loss function includes a road spatial structure loss function and a road topological structure loss function, the road spatial structure loss function corresponds to the road spatial structure detection branch, and the road topological structure loss function corresponds to the road topological structure detection branch; The calculating, using a first sub-loss function included in the first loss function, a first sub-loss value representing an error between the predicted road information and the labeled road information comprises: Calculating a road space structure loss value representing an error between the predicted road space structure information and the annotated road space structure information using the road space structure loss function; Utilizing the road topology loss function, calculating a road topology loss value representing an error between the predicted road topology information and the annotated road topology information; The first sub-loss value is determined based on the road spatial structure loss value and the road topological structure loss value.

6. The method according to claim 1, characterized in that The method of using the target detection subnetwork included in the scene detection network to perform target detection on the three-dimensional feature data to obtain predicted object information includes: Using the object category detection branch included in the target detection subnetwork, perform object category detection on the three-dimensional feature data to obtain predicted object category information; Using the object motion state detection branch included in the target detection subnetwork, perform object motion state detection on the three-dimensional feature data to obtain predicted object motion state information; The predicted object category information and the predicted object motion state information are determined as the predicted object information.

7. The method according to claim 6, characterized in that The annotated road information includes annotated object category information and annotated object motion state information, the second sub-loss function includes an object category loss function and an object motion state loss function, the object category loss function corresponds to the object category detection branch, and the object motion state loss function corresponds to the object motion state detection branch; The calculating, using a second sub-loss function included in the first loss function, a second sub-loss value representing an error between the predicted object information and the labeled object information comprises: Calculating an object category loss value representing an error between the predicted object category information and the labeled object category information using the object category loss function; Calculating an object motion state loss value representing an error between the predicted object motion state information and the labeled object motion state information using the object motion state loss function; The second sub-loss value is determined based on the object category loss value and the object motion state loss value.

8. The method according to claim 1, characterized in that The three-dimensional feature extraction network is pre-trained according to the following steps: Using a preset initial three-dimensional feature extraction network, extract three-dimensional features from at least two groups of second sample images under a target viewing angle to obtain a sample three-dimensional feature data sequence; Using a preset initial occupancy grid prediction network, occupancy grid prediction is performed on the obtained sample three-dimensional feature data sequence to obtain an occupancy grid image sequence; Based on a preset second loss function, calculating a second loss value representing a similarity gap between different pairs of sample three-dimensional feature data in the sample three-dimensional feature data sequence; Based on a preset third loss function, calculating a third loss value representing an occupied grid gap between each pair of adjacent occupied grid images in the occupied grid image sequence; Adjusting parameters of the initial three-dimensional feature extraction network and the initial occupancy grid prediction network based on the second loss value and the third loss value; In response to the initial three-dimensional feature extraction network and the initial occupancy grid prediction network after adjusting parameters meeting the training end condition, the initial three-dimensional feature extraction network after adjusting parameters is determined as the trained three-dimensional feature extraction network.

9. A training device for a scene detection model, characterized in that: The device comprises: An acquisition module, used to acquire at least one first sample image taken from at least one viewing angle, and corresponding annotated scene information; An extraction module, used to extract three-dimensional features from the at least one first sample image at a target perspective using a pre-trained three-dimensional feature extraction network included in a preset initial scene detection model to obtain three-dimensional feature data, wherein the three-dimensional feature extraction network is used to extract three-dimensional features from the at least one first sample image, and perform perspective conversion and feature splicing on the extracted features to obtain the three-dimensional feature data at the target perspective; A detection module, configured to perform scene detection on the three-dimensional feature data using a scene detection network included in the initial scene detection model to obtain predicted scene information; A calculation module, used to calculate a first loss value representing an error between the predicted scene information and the labeled scene information using a preset first loss function; A training module, used to adjust the parameters of the scene detection network using the first loss value; A determination module, configured to determine the current initial scene detection model as a trained scene detection model in response to the scene detection network after adjusting parameters meeting a preset training end condition; The annotated scene information includes annotated road information and annotated object information; The calculation module comprises: A first calculation unit, configured to calculate a first sub-loss value representing an error between the predicted road information and the annotated road information by using a first sub-loss function included in the first loss function; A second calculation unit, configured to calculate a second sub-loss value representing an error between the predicted object information and the labeled object information by using a second sub-loss function included in the first loss function; A second determining unit, used to determine a first weight corresponding to the first sub-loss function and a second weight corresponding to the second sub-loss function; a third calculation unit, configured to calculate a first loss value representing an error between the predicted scene information and the labeled scene information based on the first sub-loss value, the second sub-loss value, the first weight, and the second weight; The second determining unit includes: an acquisition subunit, configured to acquire sensing information obtained by sensing a scene corresponding to the at least one first sample image; A first determining subunit, configured to determine, based on the sensing information, information about the density of objects in the scene and the number of target objects in the scene; The second determination subunit is used to determine the first weight and the second weight based on the density information and the number of target objects, using a preset weight algorithm, according to the principle that the greater the number of objects, the greater the first weight representing the road detection task, and the smaller the second weight representing the target detection task.

10. An electronic device, characterized in that: include: Memory for storing computer programs; A processor is used to execute the computer program stored in the memory, and when the computer program is executed, the training method of the scene detection model described in any one of claims 1 to 8 is implemented.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the training method of the scene detection model described in any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Target detection and classification method based on deep learning under vehicle-road cooperation

    CN110781927A

  • Construction method of multi-target detection network, multi-target detection method and device

    CN112347851A

  • Object classification model training method and device as well as object classification prediction method and device

    CN113887447A

  • Three-dimensional scene decoupling method, electronic equipment and storage medium

    CN116342776A