Target detection method, model training method, device, equipment and storage medium
By constructing a hybrid query and utilizing the Transformer network, the problem of inaccurate query representation in multi-view image 3D target detection is solved, the accuracy and efficiency of detection are improved, and it is suitable for scenarios such as autonomous driving.
Patent Information
- Application Number
- CN202311764274.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-20
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2043-12-20
AI Technical Summary
Existing 3D object detection technology in multi-view images has challenges in obtaining accurate query representations. Especially when the image lacks depth information, it is difficult to achieve efficient and accurate 3D object detection.
By constructing a hybrid query containing sparse queries and dense queries, and using the Transformer network for upsampling and interaction, the target features of multi-view images are extracted to achieve learning-enhanced query representations, thereby improving the accuracy of target detection.
It improves the accuracy and detection rate of three-dimensional target detection in multi-view images, is suitable for scenarios such as autonomous driving, and enhances the detection capabilities of objects of different sizes and resolutions.
Smart Images

Figure CN117746133B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, in particular to technical fields such as computer vision, deep learning, and large models, and can be applied to scenarios such as autonomous driving. Background Art
[0002] Multi-view image 3D object detection is currently widely used in many fields and application scenarios, such as autonomous driving scenarios, intelligent transportation scenarios, industrial automation, virtual reality and augmented reality scenarios, etc. Multi-view image 3D object detection technology plays a key role in improving the accuracy and robustness of object detection, and promotes the development of intelligence and automation in various fields.
[0003] At present, the technology of three-dimensional object detection in multi-view images based on deep learning has made certain progress. Summary of the invention
[0004] The present invention provides a target detection method, a model training method, an apparatus, a device and a storage medium.
[0005] According to one aspect of the present disclosure, there is provided a target detection method, comprising:
[0006] Extracting image features of multi-view images, wherein the multi-view images are acquired by image acquisition devices with different viewpoints;
[0007] Position encoding of preset reference points in the bird's-eye view BEV space is performed to obtain an initialized sparse query;
[0008] Determine input data according to the initialized sparse query and the image features, and input the input data into a decoder of a Transformer network to obtain a target BEV feature; wherein the decoder is used to upsample the sparse query to obtain a corresponding dense query, and update a hybrid query based on the image features, the hybrid query including the sparse query and the dense query, and the updated hybrid query is used to determine the target BEV feature;
[0009] The target detection result of the multi-view image is determined based on the target BEV feature.
[0010] According to another aspect of the present disclosure, a method for training a target detection model is provided, comprising:
[0011] Extracting sample image features of multi-view sample images through a feature extraction network in a preset detection model, wherein the multi-view sample images are acquired by image acquisition devices with different viewpoints;
[0012] Position encoding of preset reference points in the bird's-eye view BEV space is performed to obtain an initialized sparse query;
[0013] Determine input data according to the initialized sparse query and the sample image features, and input the input data into the decoder of the Transformer network in the preset detection model to obtain target BEV features; wherein the decoder is used to upsample the sparse query to obtain a corresponding dense query, and update the hybrid query based on the sample image features, the hybrid query includes the sparse query and the dense query, and the updated hybrid query is used to determine the target BEV features;
[0014] Determine, by means of a detection head in the preset detection model, a sample target detection result of the multi-view sample image based on the target BEV feature;
[0015] A loss relationship is calculated based on the sample target detection results and the sample labels corresponding to the multi-view sample images, and the preset detection model is trained based on the loss relationship.
[0016] According to another aspect of the present disclosure, there is provided a target detection device, comprising:
[0017] An image feature extraction module, used to extract image features of multi-view images, wherein the multi-view images are acquired by image acquisition devices with different view angles;
[0018] A position encoding module is used to perform position encoding on preset reference points in the bird's-eye view BEV space to obtain an initialized sparse query;
[0019] A target feature determination module, used to determine input data according to the initialized sparse query and the image feature, and input the input data into a decoder of a Transformer network to obtain a target BEV feature; wherein the decoder is used to upsample the sparse query to obtain a corresponding dense query, and update a hybrid query based on the image feature, the hybrid query including the sparse query and the dense query, and the updated hybrid query is used to determine the target BEV feature;
[0020] The target detection module is used to determine the target detection result of the multi-view image based on the target BEV feature.
[0021] According to another aspect of the present disclosure, there is provided a target detection device, comprising:
[0022] A sample image feature extraction module, used to extract sample image features of a multi-view sample image through a feature extraction network in a preset detection model, wherein the multi-view sample image is acquired by image acquisition devices of different viewpoints;
[0023] An encoding module, used for encoding the positions of preset reference points in the bird's-eye view BEV space to obtain an initialized sparse query;
[0024] A feature determination module, used to determine input data according to the initialized sparse query and the sample image feature, and input the input data into a decoder of a Transformer network in the preset detection model to obtain a target BEV feature; wherein the decoder is used to upsample the sparse query to obtain a corresponding dense query, and update a hybrid query based on the sample image feature, the hybrid query including the sparse query and the dense query, and the updated hybrid query is used to determine the target BEV feature;
[0025] A detection module, configured to determine a sample target detection result of the multi-view sample image based on the target BEV feature by using a detection head in the preset detection model;
[0026] A training module is used to calculate a loss relationship based on the sample target detection results and the sample labels corresponding to the multi-view sample images, and to train the preset detection model based on the loss relationship.
[0027] According to another aspect of the present disclosure, there is provided an electronic device, comprising:
[0028] at least one processor; and
[0029] a memory communicatively connected to the at least one processor; wherein,
[0030] The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to perform the method described in the embodiment of the present disclosure.
[0031] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method described in the embodiment of the present disclosure.
[0032] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the method described in any embodiment of the present disclosure is implemented.
[0033] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0035] Figure 1 is a flow chart of a target detection method provided according to an embodiment of the present disclosure;
[0036] Figure 2 is a schematic diagram of a query propagation process provided according to an embodiment of the present disclosure;
[0037] Figure 3 is a schematic diagram of a query fusion process provided according to an embodiment of the present disclosure;
[0038] Figure 4 is a flow chart of another target detection method provided according to an embodiment of the present disclosure;
[0039] Figure 5 is a schematic diagram of the structure of a target detection model provided according to an embodiment of the present disclosure;
[0040] Figure 6 is a flowchart of a method for training a target detection model provided according to an embodiment of the present disclosure;
[0041] Figure 7 is a structural schematic diagram of a target detection device provided according to an embodiment of the present disclosure;
[0042] Figure 8 is a structural schematic diagram of a training device for a target detection model provided according to an embodiment of the present disclosure;
[0043] Fig. 9 The block diagram is a block diagram of an electronic device for implementing the method of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0044] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0045] In order to facilitate understanding of the technical solutions of the embodiments of the present disclosure, the relevant technologies are introduced below.
[0046] Humans perceive the three-dimensional world through vision, hearing, and touch. In order to improve the performance of perception models in various application scenarios, it is important to enable them to have 3D perception capabilities. Taking the autonomous driving scenario as an example, in order to ensure the safe driving of autonomous vehicles, the requirements for the precise positioning of the vehicle and the precise perception of the environment are becoming increasingly higher. Enabling the autonomous driving function to have 3D perception capabilities can effectively improve the accuracy of the vehicle's perception capabilities and improve the safety of autonomous driving. However, current 3D sensors, such as lidar and radar, are expensive and sensitive to weather conditions, which limits their scope of application. In addition, these sensors lack the ability to capture semantics (such as color). Therefore, multi-view image 3D object detection technology has a broader application prospect.
[0047] At present, multi-view image 3D object detection has been widely used in many fields and application scenarios. The following are some common application scenarios: (1) Autonomous driving scenarios. Multi-view image 3D object detection is crucial in the field of autonomous driving. By utilizing the image information of multiple cameras around the vehicle, the system can more accurately perceive pedestrians, vehicles, road signs and other objects in the surrounding environment, thereby achieving safer and more efficient autonomous driving; (2) Intelligent transportation scenarios. In urban traffic monitoring systems, multi-view image 3D object detection can be used to monitor traffic, pedestrians and other traffic participants on the road in real time, which helps to improve traffic smoothness, improve traffic safety, and support urban planning and management; (3) Industrial automation scenarios. In industrial environments, multi-view image 3D object detection can be used to detect objects in the surrounding environment, such as pedestrians, vehicles and road signs, in order to achieve safer and more efficient autonomous driving; (4) Intelligent transportation scenarios. In urban traffic monitoring systems, multi-view image 3D object detection can be used to detect objects in the surrounding environment, such as pedestrians, vehicles and road signs, in order to achieve safer and more efficient autonomous driving; (5) Intelligent transportation scenarios. In urban traffic monitoring systems, multi-view image 3D object detection can be used to monitor traffic, pedestrians and other traffic participants on the road in real time, which helps to improve traffic smoothness, improve traffic safety, and support urban planning and management; (6) Industrial automation scenarios. In industrial environments, multi-view image 3D object detection can be used to detect objects in the surrounding environment, such as pedestrians, vehicles and road signs, in order to achieve safer and more efficient autonomous driving; (7) Industrial automation scenarios. In industrial environments, multi-view image 3D object detection can be used to detect objects in the surrounding environment, such as pedestrians, vehicles and road signs, in order to achieve safer and more efficient autonomous driving; (8) Industrial automation scenarios. In industrial environments, multi-view image 3D object detection can be used to detect objects in the surrounding environment, such as pedestrians, vehicles and road signs, in order to achieve safer and more efficient autonomous driving; (9) 3D target detection can be used to monitor and manage objects, equipment and personnel on the production line, which helps to improve production efficiency, reduce accident risks and conduct intelligent factory management; (4) Security monitoring scenarios. In the security field, multi-view image 3D target detection can help monitor key areas, identify abnormal behaviors and respond in a timely manner. It can be applied to public places, commercial areas and airports to improve safety; (5) Virtual reality and augmented reality scenarios. In virtual reality and augmented reality applications, multi-view image 3D target detection helps to render virtual scenes more realistically and interact with the real world more accurately. It can be applied to games, training simulations and virtual navigation.
[0048] In the multi-view image 3D object detection method based on deep learning, a key aspect is to obtain an effective query representation by appropriately interacting with camera features (including image features of multi-view images). How to obtain efficient and accurate query representation becomes the key to accurately detect 3D objects. Given the lack of depth information in images, existing methods still face huge challenges in obtaining accurate query representation. In the disclosed embodiment, by constructing a hybrid query containing sparse queries and dense queries, multi-view information is fully mined, and query representation enhanced by learning is realized, thereby improving the accuracy of target detection, which can provide strong support for the technical evolution of various scenarios such as autonomous driving.
[0049] Figure 1 This is a flow chart of a target detection method provided according to an embodiment of the present disclosure. The present disclosure embodiment can be applied to the case of performing three-dimensional target detection based on multi-view images in scenes such as autonomous driving scenes, intelligent transportation scenes, industrial automation, and virtual reality and augmented reality scenes. The method can be executed by a target detection device, which can be implemented in hardware and / or software and can be configured in an electronic device. Figure 1 , the method specifically includes the following:
[0050] S101, extracting image features of a multi-view image, wherein the multi-view image is acquired by image acquisition devices with different viewpoints;
[0051] S102, position encoding the preset reference points in the bird's-eye view BEV space to obtain an initialized sparse query;
[0052] S103, determining input data according to the initialized sparse query and the image features, and inputting the input data into a decoder of a Transformer network to obtain a target BEV feature; wherein the decoder is used to upsample the sparse query to obtain a corresponding dense query, and update a hybrid query based on the image features, the hybrid query including the sparse query and the dense query, and the updated hybrid query is used to determine the target BEV feature;
[0053] S104: Determine a target detection result of the multi-view image based on the target BEV feature.
[0054] The multi-view images are acquired by image acquisition devices with different viewpoints. Specifically, the image acquisition devices may be cameras or video cameras. The number and location of the image acquisition devices may be set in a targeted manner for different application scenarios. For example, for an autonomous driving application scenario, cameras are installed at different locations on the autonomous driving vehicle. These cameras shoot from their respective viewpoints to acquire images of the vehicle's surroundings from different viewpoints.
[0055] In the disclosed embodiments, the method for extracting the image features of the multi-view image is not limited. For example, the feature extraction network in the target detection model can be used to extract the image features of the multi-view image. The specific type and network structure of the feature extraction network are not limited. For example, the image features of the multi-view image can be extracted through a backbone network; the multi-scale image features of the multi-view image can also be extracted through a backbone network and a feature pyramid network (FPN), and the extracted image features can include multiple feature layers.
[0056] Bird's Eye View (BEV) is a perspective of viewing an object or scene from above. BEV can simplify a complex three-dimensional environment into a two-dimensional image, which is particularly important for efficient computing in real-time systems. The query in the disclosed embodiment can be a BEV-based query, referred to as a BEV query, query feature or query, which can be in vector form. The query can contain interpretable physical meanings. For example, each query can be used to characterize an object in a 3D space, wherein each query is associated with a reference point related to a 3D position in the real world. Some reference points are pre-set in the BEV space, recorded as preset reference points, and the preset reference points are positionally encoded (Positional Encoding, PE) to obtain an initialized sparse query.
[0057] In the embodiment of the present disclosure, the target detection method is implemented based on a transformer network. The transformer network generally includes an encoder and a decoder. The transformer network in the embodiment of the present disclosure may include an encoder and a decoder, or may only include a decoder. For the implementation method that only includes a decoder, the initialized sparse query and image features can be input into the decoder as input data. This implementation method has been experimentally verified to effectively ensure the detection effect while reducing the amount of calculation and improving the efficiency of target detection; for the implementation method that includes an encoder and a decoder, the image features can be first input into the encoder, and then the output of the encoder and the initialized sparse query can be used as the determined input data and input into the decoder.
[0058] In the disclosed embodiment, the specific network structure of the decoder is not limited, and can be improved on the basis of the Detection Transformer (DETR). DETR is an end-to-end target detection model based on the Transformer architecture. Unlike traditional target detection methods, DETR no longer uses anchor boxes or region proposals for target detection, but directly inputs the entire image into the Transformer and outputs the target category and location information (such as a bounding box).
[0059] Exemplarily, a network for upsampling sparse queries can be set in the decoder, such as a query propagation network or a query propagation module. The query propagation network can be used to upsample sparse queries along a preset direction (such as the x-axis direction and / or the y-axis direction) to obtain corresponding dense queries. The upsampling operation can be understood as dense propagation in the preset direction. After obtaining the dense query, the dense query and the sparse query are used as hybrid queries and applied to the interaction with the image features at the same time. For example, sampling is performed from the corresponding positions in the image features according to the positions predicted by the dense query and the sparse query, and the dense query and the sparse query are updated respectively according to the sampling results. The dense query obtained after upsampling has a higher resolution than the sparse query, so it can be adapted to objects with small resolution, which is conducive to determining more dense sampling points, and then learning richer features from the image features, so that the hybrid query can interact with the image features more comprehensively.
[0060] Exemplarily, the updated hybrid query can be processed to obtain the target BEV features for output by the decoder, wherein the specific processing method is not limited, for example, it can be processed by a linear layer, such as the linear layer can be a feed-forward layer (Feed-Forward Layer, FFL), or it can be processed by fusion, etc.
[0061] Exemplarily, the target BEV features can be input into the prediction heads, which output the category and bounding box of the target as the target detection result of the multi-view image.
[0062] The target detection method provided by the embodiment of the present disclosure extracts the image features of the multi-view image, performs position encoding on the preset reference points in the BEV space, obtains the initialized sparse query, determines the input data according to the initialized sparse query and the image features, and inputs the input data into the decoder of the Transformer network to obtain the target BEV features, wherein the decoder is used to upsample the sparse query to obtain the corresponding dense query, and updates the hybrid query based on the image features, the hybrid query includes the sparse query and the dense query, the updated hybrid query is used to determine the target BEV features, and the target detection results of the multi-view image are determined based on the target BEV features. By adopting the above technical solution, the preset reference points in the BEV space are position encoded to obtain the initialized sparse query, the dense query is obtained by upsampling the sparse query, and the query representation capability is enhanced based on the hybrid query including the sparse query and the dense query, the multi-view information is fully mined, and the query representation of learning enhancement is realized, thereby improving the detection rate and accuracy of objects of different sizes and resolutions, that is, improving the accuracy of three-dimensional target detection in multi-view images, which can provide strong support for the technical evolution of various scenarios such as autonomous driving.
[0063] In an optional embodiment, the decoder may include multiple decoder layers, for example, 6 layers. Each decoder layer may include a self-attention network, a query propagation network, a cross attention network, and a forward network. The query is iteratively subjected to an attention mechanism to interact with image features through multiple decoder layers. For example, for the first decoder layer, the input sparse query is an initialized sparse query, and the BEV features output by the first decoder layer can be recorded as intermediate BEV features. For the second decoder layer to the last decoder layer, the input sparse query is the intermediate BEV features output by the previous decoder layer, and the BEV features output by the last decoder layer are the target BEV features.
[0064] In an optional implementation, the preset reference points are reference points in a preset grid uniformly fixed in the BEV space. The advantage of such a setting is that the reference points are fixed and evenly arranged in the BEV space, which is equivalent to each query corresponding to a fixed 3D position from the beginning, rather than constantly changing the learning position during the learning process. The disclosed technical solution can make each grid-based BEV query easier to perceive 3D space information, that is, to make it easier to learn positional relationships and improve computing efficiency.
[0065] In the disclosed embodiment, the number and size of the preset grids are not limited. For example, the preset grid may be a 30*30 grid, which is tiled to the origin (such as determined according to the location of the autonomous driving vehicle) in the area of -100 meters to 100 meters horizontally and -50 meters to 50 meters vertically, and the center point of each preset grid is used as the preset reference point.
[0066] Exemplarily, compared with the learnable reference point scheme, the disclosed embodiment provides accurate location for the initial grid-based query, that is, provides good prior information for network learning. Let the sparse query be Qs, and the initialized sparse query be EQ. Qs is initialized by the query embedding arranged in the grid, such as EQ=PE(Ps), where Ps∈Ws×Hs×2 represents a fixed reference point, that is, a preset reference point. PE represents position encoding, Ws represents the number of grids in the x-axis direction, Hs represents the number of grids in the y-axis direction, and each reference point is represented by BEV coordinates, and ×2 represents the specific coordinate position (x and y).
[0067] In an optional embodiment, the decoder is also used to upsample the sparse reference points to obtain dense reference points, the sparse reference points are obtained by adding a preset number of points in the vertical direction of the preset reference points, and the upsampling density for the sparse reference points is the same as the upsampling density for the sparse query; wherein the updating of the hybrid query based on the image feature includes: determining the corresponding target reference point according to the hybrid query, wherein the target reference point is determined from the sparse reference points and the dense reference points; determining the target sampling point of the target reference point in the image feature according to the internal and external parameters of the image acquisition device; sampling the image feature using the target sampling point to obtain a sampling result, and updating the hybrid query using the sampling result. The advantage of such a setting is that after adding a preset number of points in the vertical direction of the preset reference point, sparse reference points in the 3D space are obtained, and the sparse reference points are synchronously upsampled, so that the sparse reference points and dense reference points can be used to perform richer feature sampling in the image feature according to the position predicted by the query.
[0068] Exemplarily, each sparse query and each dense query in the hybrid query can predict a 3D object center point, which is selected from the sparse reference points and the dense reference points. For example, the sparse query selects a reference point from the sparse reference points as a 3D object center point, which is recorded as the target reference point corresponding to the sparse query, and the dense query selects a reference point from the dense reference points as a 3D object center point, which is recorded as the target reference point corresponding to the dense query. Based on each target reference point, the target sampling point obtained by projecting each target reference point in the image feature is determined according to the intrinsic and extrinsic parameters of the image acquisition device. For example, the 3D to 2D projection matrix is determined according to the intrinsic and extrinsic parameters of the camera, and the projection matrix is used to project each target reference point into the multi-view image space to obtain the target sampling point, and then the image feature is sampled using the target sampling point, so as to update the sparse query and the dense query in the hybrid query respectively using the sampling result. That is, the sparse query is updated using the sampling results corresponding to the target reference points corresponding to the sparse query to obtain an updated sparse query; the dense query is updated using the sampling results corresponding to the target reference points corresponding to the dense query to obtain an updated dense query.
[0069] Figure 2 is a schematic diagram of a query propagation process provided according to an embodiment of the present disclosure, illustrating the working process of the query propagation network (Query Propagation Module), and the sparse reference points obtained after adding a preset number of points in the z-axis direction are denoted as Ps∈R Ws×Hs×4×3 For 3D reference points, Ps is upsampled along the x-axis and y-axis by query propagation to obtain dense reference points, denoted as Pd = upsampling (Ps), where Pd ∈ R Wd×Hd×4×3 is a dense grid-based reference point distribution, where Wd represents the number of grids in the x-axis direction after upsampling, Hd represents the number of grids in the y-axis direction after upsampling, R refers to the dimensional space, and Ps and Pd are summarized as P 3d For query, sparse query is denoted as Qs∈R Ws×Hs×C , where C represents the number of channels, and Qs is upsampled along the x-axis and y-axis through query propagation to obtain a dense query, denoted as Q d = upsampling(Qs), Qd∈R Wd×Hd×X , Qs and Q d Summarized as mixed query Q, which can be recorded as Q q .
[0070] In an optional embodiment, the determining the corresponding target reference point according to the hybrid query includes: determining a predicted reference point according to the hybrid query, wherein the predicted reference point is determined from the sparse reference point and the dense reference point; processing the hybrid query using a linear layer to generate a three-dimensional offset; and determining the corresponding target reference point according to the predicted reference point and the three-dimensional offset. The advantage of such a setting is that a 3D offset is added on the basis of the reference point predicted by the query, so that more points can be sampled in the multi-view image features, providing richer information for query learning, and can help obtain more reliable and accurate multi-view image features in the cross-attention layer.
[0071] Exemplarily, the encoder includes multiple encoder layers, so that the hybrid query can iteratively interact with the multi-view image based on the attention mechanism. Therefore, the hybrid query can contain rich 3D information of the object of interest, such as position, size, and orientation, and the 3D offset can be directly generated by applying a linear layer to the hybrid query itself.
[0072] For example, the 3D offset can be expressed as: Δ 3d =Linear(Q q ).
[0073] Based on 3D offset, the target sampling point can be expressed as P 2d =K·(P 3d +Δ 3d ).
[0074] Among them, P 3d Represents the predicted reference point determined according to the hybrid query, and K represents the 3D to 2D projection matrix based on the intrinsic and extrinsic parameters of the camera.
[0075] In an optional implementation, the using the target sampling point to sample the image feature to obtain a sampling result, and using the sampling result to update the hybrid query includes: using a deformable multi-head cross attention network to sample the image feature using the target sampling point to obtain a sampling result, and adding the sampling result to the hybrid query to update the hybrid query. In this way, more abundant sampling results can be obtained efficiently and accurately, providing more abundant information for query learning and improving detection efficiency.
[0076] For example, let the q index have a mixed query feature Q q and the reference point P in image space 2d;q The query element, the deformable attention adopted can be expressed as:
[0077]
[0078] Among them, M is the number of heads of multi-head attention, m indexes the attention head; K is the number of target sampling points, k indexes the target sampling points; L is the number of levels of the feature layer, l indexes the feature level. m;qk Represents the attention weight of the kth sampling point and the mth attention head in the lth feature layer. Attention weight A mlqk The range of W is [0,1]. m and W m is a learnable parameter. l is the image feature of the lth layer, which is used to update the hybrid query.
[0079] In an optional embodiment, the decoder is also used to perform fusion processing on the updated mixed query to obtain a fusion processing result, and determine the target BEV feature according to the fusion processing result. The advantage of this setting is that the fusion processing of the updated sparse query and the updated dense query can avoid loss calculation for the target detection results corresponding to the sparse query and the target detection results corresponding to the dense query during the decoder training process, thereby improving training efficiency, reducing training costs, and improving the accuracy of the fused target BEV feature, thereby obtaining a more accurate target detection result.
[0080] The specific processing method of the fusion processing is not limited. After the fusion processing, the number of updated hybrid queries can be reduced to the same as the number of initialized sparse queries.
[0081] In an optional implementation, the updated hybrid query is subjected to fusion processing to obtain a fusion processing result, and the target BEV feature is determined based on the fusion processing result, including: downsampling the updated dense query to obtain a target dense query, wherein the target dense query has the same resolution as the updated sparse query; fusing the target dense query and the updated sparse query to obtain a fusion processing result, and determining the target BEV feature based on the fusion processing result. The advantage of this setting is that the updated dense query is downsampled to have the same resolution as the updated sparse query, so that it is convenient to quickly and accurately fuse with the updated sparse query.
[0082] Exemplarily, a stacking operation and an average (mean) operation may be performed on the target dense query and the updated sparse query, such as applying the stack function and the mean function to the target dense query and the updated sparse query in sequence to obtain the target BEV feature.
[0083] Optionally, the updated dense query is downsampled, specifically, the updated dense query is downsampled using a patch fusion (PatchMerging) layer, and multiple target dense sub-queries with the same resolution as the updated sparse query can be obtained, and the multiple target dense sub-queries are used for fusion with the updated sparse query.
[0084] In an optional embodiment, the target dense query and the updated sparse query are fused to obtain a fusion result, and the target BEV feature is determined based on the fusion result, including: using a linear layer and a preset activation function to process the updated sparse query to obtain an aggregation weight; based on the aggregation weight, the multiple target dense sub-queries are aggregated to obtain a dense query to be fused; the dense query to be fused and the updated sparse query are fused to obtain a fusion result, and the target BEV feature is determined based on the fusion result. The advantage of this setting is that the aggregation weight used for aggregating multiple target dense sub-queries is determined based on the updated sparse query, which can better achieve the fusion of dense query and sparse query.
[0085] Exemplarily, the preset activation function may be a Sigmoid function. In the cross-attention stage, sparse queries and dense queries generated by the query propagation strategy are used to better interact with image features. In order to interact with the two queries and aggregate them together, a query merging network, or a merging module, may be added to the encoder. Figure 3 FIG. 1 is a schematic diagram of a query fusion process provided according to an embodiment of the present disclosure. Figure 3 As shown, the query merging network provides updated hybrid queries, such as the updated dense queries (Dense BEV Queries) and the updated sparse queries (SparseBEV Queries) in the figure. In order to make them have the same resolution, a Patch Merging layer is used to downsample the updated dense BEV queries to the resolution of the sparse BEV queries, and 4 target dense sub-queries are obtained. The aggregation weights are learned by applying the linear layer (linear) and the Sigmoid function to the sparse BEV queries. The 4 target dense sub-queries are aggregated (Multiplication) based on the aggregation weights to obtain the dense queries to be fused. The Stack function and the mean function are applied to the dense queries to be fused and the updated sparse queries to obtain the output features (Output BEV Queries). For the decoder layers other than the last decoder layer, the query merging network outputs the intermediate BEV features described above. For the last decoder layer, the query merging network outputs the target BEV features.
[0086] In an optional implementation, the self-attention network may be a deformable self-attention network. Before upsampling the sparse query, the decoder is further used to process the sparse query using a deformable self-attention network to obtain a target sparse query; wherein upsampling the sparse query includes: upsampling the target sparse query; wherein the mixed query includes the target sparse query and the dense query. The advantage of this arrangement is that the initialized sparse query is determined based on a fixed reference point, so that the BEV query has a good spatial structure, so deformable attention can be used to greatly reduce calculations and further improve target detection efficiency.
[0087] Figure 4 It is a flowchart of another target detection method provided according to an embodiment of the present disclosure. This embodiment is optimized based on the optional schemes in the above embodiments. Taking the autonomous driving scenario as an example, the relevant steps are described by using the target detection model to perform target detection. Figure 5 is a schematic diagram of a target detection model provided according to an embodiment of the present disclosure, which can be combined with Figure 4 and Figure 5 Understand the technical solution of the embodiment of the present disclosure. Figure 4 As shown, the method may include:
[0088] S401. Extracting image features of a multi-view image through a feature extraction network in a target detection model, wherein the multi-view image is acquired by cameras with different viewpoints installed on an autonomous driving vehicle.
[0089] like Figure 5 As shown, the multi-view images acquired by cameras of different viewpoints on the vehicle are input into the backbone and FPN in the target detection model for feature extraction to obtain multi-scale image features.
[0090] S402: Position encoding is performed on preset reference points in the BEV space to obtain an initialized sparse query.
[0091] The preset reference points are reference points in a preset grid uniformly fixed in the BEV space. It should be noted that S402 may also be performed before S401, and is not specifically limited.
[0092] S403, determining input data according to the initialized sparse query and image features, and inputting the input data into the decoder of the Transformer network in the object detection model.
[0093] like Figure 5As shown in the figure, the initialized sparse query is the BEV features in the figure, which are input into the decoder Decoder together with the multi-scale image features.
[0094] S404: Process the sparse query through the deformable self-attention network in the decoder to obtain a target sparse query.
[0095] like Figure 5 As shown in the figure, the decoder includes 6 decoder layers, each of which includes a deformable self-attention network (Deformable Self-Attention), a query propagation network (Query Propagation Module), a three-dimensional offset deformable attention network (3D Offset D Deformable Attention, also known as a deformable multi-head cross attention network), a feed-forward layer (Feed-Forward Layer, FFL) and a query merging network (Query Merging Module) connected in sequence.
[0096] S405 . Upsample the target sparse query and the sparse reference points through the query propagation network in the decoder to obtain corresponding dense queries and dense reference points.
[0097] S406. Determine the corresponding target reference point according to the mixed query through the decoder, and determine the target sampling point of the target reference point in the image feature according to the internal parameters and external parameters of the image acquisition device.
[0098] S407, using the deformable multi-head cross attention network in the decoder, sample the image features using the target sampling points to obtain the sampling results, and add the sampling results to the hybrid query to update the hybrid query.
[0099] S408. Downsample the updated dense query through the query merging network in the decoder to obtain multiple target dense sub-queries, use a linear layer and a preset activation function to process the updated sparse query to obtain an aggregation weight, aggregate the multiple target dense sub-queries based on the aggregation weight to obtain a dense query to be fused, fuse the dense query to be fused and the updated sparse query to obtain a fusion processing result, and determine the target BEV feature based on the fusion processing result.
[0100] S409 , determining the target detection result of the multi-view image based on the target BEV features output by the decoder through the detection head in the target detection model.
[0101] like Figure 5As shown, the target BEV features are input into the detection heads Cls and Reg, and the detection heads output the target category (Cls) and bounding box (Bbox) respectively to obtain the target detection result.
[0102] The target detection method provided by the embodiment of the present disclosure obtains an initialized sparse query after position encoding of reference points in a preset grid uniformly fixed in the BEV space. By fixing the reference points, each query corresponds to a fixed 3D position from the beginning, which makes it easier to perceive 3D spatial information, that is, it makes it easier to learn positional relationships, and can support a deformable self-attention network to process sparse queries to reduce the amount of calculation. The sparse queries and sparse reference points of three-dimensional points with the z-axis dimension added are upsampled through a query propagation network to obtain dense queries and dense reference points. Based on a hybrid query including sparse queries and dense queries, a 3D offset deformable attention network is used to fully interact with image features to enhance the representation capability of the query, fully mine multi-view information, and realize learning enhanced query representation, thereby improving the detection rate and accuracy of objects of different sizes and resolutions. In addition, the updated sparse queries and dense queries are fused through a query merging network to output accurate enhanced target BEV features, so that the detection head can quickly and accurately output target detection results. A large number of experiments have been conducted on the Nuscenes benchmark dataset using the technical solution of the disclosed embodiment. The experimental results show that good detection effects have been achieved in various road scenes with low latency, which can better support the business development of related scenes.
[0103] Figure 6 This is a flowchart of a method for training a target detection model according to an embodiment of the present disclosure. The embodiment of the present disclosure can be applied to the training of a model for three-dimensional target detection based on multi-view images in scenarios such as autonomous driving scenarios, intelligent transportation scenarios, industrial automation, and virtual reality and augmented reality scenarios. The method can be executed by a training device for a target detection model, which can be implemented in hardware and / or software and can be configured in an electronic device. Figure 6 , the method specifically includes the following:
[0104] S601, extracting sample image features of a multi-view sample image through a feature extraction network in a preset detection model, wherein the multi-view sample image is acquired by image acquisition devices with different viewpoints;
[0105] S602, position encoding the preset reference points in the bird's-eye view BEV space to obtain an initialized sparse query;
[0106] S603, determining input data according to the initialized sparse query and the sample image features, and inputting the input data into the decoder of the Transformer network in the preset detection model to obtain target BEV features; wherein the decoder is used to upsample the sparse query to obtain a corresponding dense query, and update the hybrid query based on the sample image features, the hybrid query including the sparse query and the dense query, and the updated hybrid query is used to determine the target BEV features;
[0107] S604, determining a sample target detection result of the multi-view sample image based on the target BEV feature by using the detection head in the preset detection model;
[0108] S605: Calculate a loss relationship based on the sample target detection result and the sample labels corresponding to the multi-view sample images, and train the preset detection model based on the loss relationship.
[0109] Among them, the loss function used to calculate the loss relationship can be set according to actual needs, such as including Hungarian loss, etc.
[0110] Exemplarily, during the training of the preset detection model, the weight parameter values in the preset detection model can be continuously optimized with the goal of minimizing the target loss relationship until the preset training cutoff condition is met. The specific training cutoff condition can be set according to actual needs, and the embodiments of the present disclosure are not limited thereto. For example, it can be set based on the number of iterations, the degree of convergence of the loss value, or the model accuracy. The preset detection model after training can become the target detection model described above.
[0111] The training method of the target detection model provided in the embodiment of the present disclosure performs position encoding on the preset reference points in the BEV space to obtain an initialized sparse query, obtains a dense query by upsampling the sparse query, and enhances the query representation capability based on a hybrid query including sparse queries and dense queries, fully mines the multi-view information in the multi-view sample images, and realizes learning-enhanced query representation, so that the target detection model obtained after training can improve the detection rate and accuracy of objects of different sizes and resolutions, and can provide strong support for the technological evolution of various scenarios such as autonomous driving.
[0112] In an optional implementation, the preset reference points are reference points uniformly fixed in a preset grid in the BEV space.
[0113] In an optional embodiment, the decoder is also used to upsample sparse reference points to obtain dense reference points, and the sparse reference points are obtained by adding a preset number of points in the vertical direction of the preset reference points, and the upsampling density for the sparse reference points is the same as the upsampling density for the sparse query; wherein, the updating of the hybrid query based on the sample image features includes: determining a corresponding target reference point based on the hybrid query, wherein the target reference point is determined from the sparse reference points and the dense reference points; determining a target sampling point of the target reference point in the sample image features based on the intrinsic and extrinsic parameters of the image acquisition device; sampling the sample image features using the target sampling point to obtain a sampling result, and updating the hybrid query using the sampling result.
[0114] In an optional implementation, determining the corresponding target reference point based on the hybrid query includes: determining a predicted reference point based on the hybrid query, wherein the predicted reference point is determined from the sparse reference points and the dense reference points; processing the hybrid query using a linear layer to generate a three-dimensional offset; and determining the corresponding target reference point based on the predicted reference point and the three-dimensional offset.
[0115] In an optional implementation, the using the target sampling point to sample the sample image features to obtain a sampling result, and using the sampling result to update the hybrid query includes: using a deformable multi-head cross-attention network to sample the sample image features using the target sampling point to obtain a sampling result, and adding the sampling result to the hybrid query to update the hybrid query.
[0116] In an optional implementation, the decoder is further configured to perform fusion processing on the updated hybrid query to obtain a fusion processing result, and determine the target BEV feature according to the fusion processing result.
[0117] In an optional implementation, the updated hybrid query is fused to obtain a fusion result, and the target BEV feature is determined based on the fusion result, including: downsampling the updated dense query to obtain a target dense query, wherein the target dense query has the same resolution as the updated sparse query; fusing the target dense query and the updated sparse query to obtain a fusion result, and determining the target BEV feature based on the fusion result.
[0118] In an optional embodiment, the target dense query includes multiple target dense sub-queries; the target dense query and the updated sparse query are fused to obtain a fusion result, and the target BEV feature is determined based on the fusion result, including: using a linear layer and a preset activation function to process the updated sparse query to obtain an aggregation weight; based on the aggregation weight, the multiple target dense sub-queries are aggregated to obtain a dense query to be fused; the dense query to be fused and the updated sparse query are fused to obtain a fusion result, and the target BEV feature is determined based on the fusion result.
[0119] In an optional implementation, before upsampling the sparse query, the decoder is further used to process the sparse query using a deformable self-attention network to obtain a target sparse query; wherein upsampling the sparse query includes: upsampling the target sparse query; wherein the hybrid query includes the target sparse query and the dense query.
[0120] Figure 7 This is a schematic diagram of the structure of a target detection device provided according to an embodiment of the present disclosure. The embodiment of the present disclosure can be applied to the case of performing three-dimensional target detection based on multi-view images in scenes such as autonomous driving scenes, intelligent transportation scenes, industrial automation, and virtual reality and augmented reality scenes. The device can be implemented in hardware and / or software and can be configured in an electronic device. Figure 7 , the target detection device 700 comprises:
[0121] An image feature extraction module 701 is used to extract image features of a multi-view image, wherein the multi-view image is acquired by image acquisition devices of different view angles;
[0122] A position encoding module 702 is used to perform position encoding on a preset reference point in the bird's-eye view BEV space to obtain an initialized sparse query;
[0123] A target feature determination module 703 is used to determine input data according to the initialized sparse query and the image feature, and input the input data into a decoder of a Transformer network to obtain a target BEV feature; wherein the decoder is used to upsample the sparse query to obtain a corresponding dense query, and update a hybrid query based on the image feature, the hybrid query including the sparse query and the dense query, and the updated hybrid query is used to determine the target BEV feature;
[0124] The target detection module 704 is used to determine the target detection result of the multi-view image based on the target BEV feature.
[0125] The target detection device provided by the embodiment of the present disclosure performs position encoding on the preset reference points of the BEV space to obtain an initialized sparse query, obtains a dense query by upsampling the sparse query, and enhances the query representation capability based on a hybrid query including sparse queries and dense queries, fully mines multi-view information, and realizes learning-enhanced query representation, thereby improving the detection rate and accuracy of objects of different sizes and resolutions, that is, improving the accuracy of three-dimensional target detection in multi-view images, which can provide strong support for the technological evolution of various scenarios such as autonomous driving.
[0126] In an optional implementation, the preset reference points are reference points uniformly fixed in a preset grid in the BEV space.
[0127] In an optional embodiment, the decoder is also used to upsample sparse reference points to obtain dense reference points, and the sparse reference points are obtained by adding a preset number of points in the vertical direction of the preset reference points, and the upsampling density for the sparse reference points is the same as the upsampling density for the sparse query; wherein, the updating of the hybrid query based on the image feature includes: determining a corresponding target reference point based on the hybrid query, wherein the target reference point is determined from the sparse reference points and the dense reference points; determining a target sampling point of the target reference point in the image feature based on the intrinsic and extrinsic parameters of the image acquisition device; sampling the image feature using the target sampling point to obtain a sampling result, and updating the hybrid query using the sampling result.
[0128] In an optional implementation, determining the corresponding target reference point based on the hybrid query includes: determining a predicted reference point based on the hybrid query, wherein the predicted reference point is determined from the sparse reference points and the dense reference points; processing the hybrid query using a linear layer to generate a three-dimensional offset; and determining the corresponding target reference point based on the predicted reference point and the three-dimensional offset.
[0129] In an optional implementation, the using the target sampling point to sample the image features to obtain a sampling result, and using the sampling result to update the hybrid query includes: using a deformable multi-head cross-attention network to sample the image features using the target sampling point to obtain a sampling result, and adding the sampling result to the hybrid query to update the hybrid query.
[0130] In an optional implementation, the decoder is further configured to perform fusion processing on the updated hybrid query to obtain a fusion processing result, and determine the target BEV feature according to the fusion processing result.
[0131] In an optional implementation, the updated hybrid query is fused to obtain a fusion result, and the target BEV feature is determined based on the fusion result, including: downsampling the updated dense query to obtain a target dense query, wherein the target dense query has the same resolution as the updated sparse query; fusing the target dense query and the updated sparse query to obtain a fusion result, and determining the target BEV feature based on the fusion result.
[0132] In an optional embodiment, the target dense query includes multiple target dense sub-queries; the target dense query and the updated sparse query are fused to obtain a fusion result, and the target BEV feature is determined based on the fusion result, including: using a linear layer and a preset activation function to process the updated sparse query to obtain an aggregation weight; based on the aggregation weight, the multiple target dense sub-queries are aggregated to obtain a dense query to be fused; the dense query to be fused and the updated sparse query are fused to obtain a fusion result, and the target BEV feature is determined based on the fusion result.
[0133] In an optional implementation, before upsampling the sparse query, the decoder is further used to process the sparse query using a deformable self-attention network to obtain a target sparse query; wherein upsampling the sparse query includes: upsampling the target sparse query; the hybrid query includes the target sparse query and the dense query.
[0134] Figure 8 The present invention is a schematic diagram of a training device for a target detection model according to an embodiment of the present invention. The present invention can be applied to the training of a model for three-dimensional target detection based on multi-view images. The device can be implemented in hardware and / or software and can be configured in an electronic device. Figure 8 , the training device 800 of the target detection model includes:
[0135] A sample image feature extraction module 801 is used to extract sample image features of a multi-view sample image through a feature extraction network in a preset detection model, wherein the multi-view sample image is acquired by image acquisition devices of different viewpoints;
[0136] An encoding module 802 is used to perform position encoding on a preset reference point in the bird's-eye view BEV space to obtain an initialized sparse query;
[0137] A feature determination module 803 is used to determine input data according to the initialized sparse query and the sample image feature, and input the input data into the decoder of the Transformer network in the preset detection model to obtain the target BEV feature; wherein the decoder is used to upsample the sparse query to obtain a corresponding dense query, and update the hybrid query based on the sample image feature, the hybrid query includes the sparse query and the dense query, and the updated hybrid query is used to determine the target BEV feature;
[0138] A detection module 804 is used to determine a sample target detection result of the multi-view sample image based on the target BEV feature by using a detection head in the preset detection model;
[0139] The training module 805 is used to calculate the loss relationship based on the sample target detection results and the sample labels corresponding to the multi-view sample images, and train the preset detection model based on the loss relationship.
[0140] The training device of the target detection model provided by the embodiment of the present disclosure performs position encoding on the preset reference points of the BEV space to obtain an initialized sparse query, obtains a dense query by upsampling the sparse query, and enhances the query representation capability based on a hybrid query including sparse queries and dense queries, fully mines the multi-view information in the multi-view sample images, and realizes learning-enhanced query representation, so that the target detection model obtained after training can improve the detection rate and accuracy of objects of different sizes and resolutions, and can provide strong support for the technological evolution of various scenarios such as autonomous driving.
[0141] In an optional implementation, the preset reference points are reference points uniformly fixed in a preset grid in the BEV space.
[0142] In an optional embodiment, the decoder is also used to upsample sparse reference points to obtain dense reference points, and the sparse reference points are obtained by adding a preset number of points in the vertical direction of the preset reference points, and the upsampling density for the sparse reference points is the same as the upsampling density for the sparse query; wherein, the updating of the hybrid query based on the sample image features includes: determining a corresponding target reference point based on the hybrid query, wherein the target reference point is determined from the sparse reference points and the dense reference points; determining a target sampling point of the target reference point in the sample image features based on the intrinsic and extrinsic parameters of the image acquisition device; sampling the sample image features using the target sampling point to obtain a sampling result, and updating the hybrid query using the sampling result.
[0143] In an optional implementation, determining the corresponding target reference point based on the hybrid query includes: determining a predicted reference point based on the hybrid query, wherein the predicted reference point is determined from the sparse reference points and the dense reference points; processing the hybrid query using a linear layer to generate a three-dimensional offset; and determining the corresponding target reference point based on the predicted reference point and the three-dimensional offset.
[0144] In an optional implementation, the using the target sampling point to sample the sample image features to obtain a sampling result, and using the sampling result to update the hybrid query includes: using a deformable multi-head cross-attention network to sample the sample image features using the target sampling point to obtain a sampling result, and adding the sampling result to the hybrid query to update the hybrid query.
[0145] In an optional implementation, the decoder is further configured to perform fusion processing on the updated hybrid query to obtain a fusion processing result, and determine the target BEV feature according to the fusion processing result.
[0146] In an optional implementation, the updated hybrid query is fused to obtain a fusion result, and the target BEV feature is determined based on the fusion result, including: downsampling the updated dense query to obtain a target dense query, wherein the target dense query has the same resolution as the updated sparse query; fusing the target dense query and the updated sparse query to obtain a fusion result, and determining the target BEV feature based on the fusion result.
[0147] In an optional embodiment, the target dense query includes multiple target dense sub-queries; the target dense query and the updated sparse query are fused to obtain a fusion result, and the target BEV feature is determined based on the fusion result, including: using a linear layer and a preset activation function to process the updated sparse query to obtain an aggregation weight; based on the aggregation weight, the multiple target dense sub-queries are aggregated to obtain a dense query to be fused; the dense query to be fused and the updated sparse query are fused to obtain a fusion result, and the target BEV feature is determined based on the fusion result.
[0148] In an optional implementation, before upsampling the sparse query, the decoder is further used to process the sparse query using a deformable self-attention network to obtain a target sparse query; wherein upsampling the sparse query includes: upsampling the target sparse query; the hybrid query includes the target sparse query and the dense query.
[0149] In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0150] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0151] Fig. 9 A schematic block diagram of an example electronic device 900 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0152] like Fig. 9 As shown, the device 900 includes a computing unit 901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 902 or a computer program loaded from a storage unit 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the device 900 can also be stored. The computing unit 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0153] A number of components in the device 900 are connected to the I / O interface 905, including: an input unit 906, such as a keyboard, a mouse, etc.; an output unit 907, such as various types of displays, speakers, etc.; a storage unit 908, such as a disk, an optical disk, etc.; and a communication unit 909, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 909 allows the device 900 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0154] The computing unit 901 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 901 performs the various methods and processes described above, such as a target detection method and / or a training method for a target detection model. For example, in some embodiments, the target detection method and / or the training method for a target detection model may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 908. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 900 via the ROM 902 and / or the communication unit 909. When the computer program is loaded into the RAM 903 and executed by the computing unit 901, one or more steps of the target detection method and / or the training method for the target detection model described above may be performed. Alternatively, in other embodiments, the computing unit 901 may be configured to execute the target detection method and / or the target detection model training method in any other suitable manner (for example, by means of firmware).
[0155] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0156] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0157] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0158] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0159] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0160] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services. The server may also be a server of a distributed system, or a server combined with a blockchain.
[0161] Artificial intelligence is a discipline that studies how to use computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.). It includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, machine learning / deep learning technology, big data processing technology, knowledge graph technology, and other major directions.
[0162] Cloud computing refers to a technology system that uses network access to elastically scalable shared physical or virtual resource pools. Resources can include servers, operating systems, networks, software, applications, and storage devices, and can be deployed and managed on demand and in a self-service manner. Cloud computing technology can provide efficient and powerful data processing capabilities for technical applications such as artificial intelligence and blockchain, as well as model training.
[0163] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution provided by this disclosure can be achieved, and this document does not limit this.
[0164] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A target detection method, comprising: Extracting image features of multi-view images, wherein the multi-view images are acquired by image acquisition devices with different viewpoints; Position encoding of preset reference points in the bird's-eye view BEV space is performed to obtain an initialized sparse query; Determine input data according to the initialized sparse query and the image features, and input the input data into a decoder of a Transformer network to obtain a target BEV feature; wherein the decoder is used to upsample the sparse query to obtain a corresponding dense query, and update a hybrid query based on the image features, the hybrid query including the sparse query and the dense query, and the updated hybrid query is used to determine the target BEV feature; The target detection result of the multi-view image is determined based on the target BEV feature.
2. The method according to claim 1, wherein: The preset reference points are reference points uniformly fixed in a preset grid in the BEV space.
3. The method according to claim 1, wherein: The decoder is further configured to upsample the sparse reference points to obtain dense reference points, wherein the sparse reference points are obtained by adding a preset number of points in a vertical direction of the preset reference points, and the upsampling density for the sparse reference points is the same as the upsampling density for the sparse query; Wherein, updating the hybrid query based on the image feature includes: Determine a corresponding target reference point according to the hybrid query, wherein the target reference point is determined from the sparse reference points and the dense reference points; Determine a target sampling point of the target reference point in the image feature according to the internal parameters and external parameters of the image acquisition device; The image features are sampled using the target sampling points to obtain sampling results, and the hybrid query is updated using the sampling results.
4. The method according to claim 3, wherein: The determining the corresponding target reference point according to the hybrid query includes: Determining a prediction reference point according to the hybrid query, wherein the prediction reference point is determined from the sparse reference points and the dense reference points; Processing the hybrid query using a linear layer to generate a three-dimensional offset; A corresponding target reference point is determined according to the predicted reference point and the three-dimensional offset.
5. The method according to claim 3, wherein: The using the target sampling point to sample the image feature to obtain a sampling result, and using the sampling result to update the hybrid query includes: The image features are sampled using the target sampling points through a deformable multi-head cross attention network to obtain a sampling result, and the sampling result is added to the hybrid query to update the hybrid query.
6. The method according to claim 1, wherein: The decoder is further used to perform fusion processing on the updated hybrid query to obtain a fusion processing result, and determine the target BEV feature according to the fusion processing result.
7. The method according to claim 6, wherein: The step of performing fusion processing on the updated hybrid query to obtain a fusion processing result, and determining the target BEV feature according to the fusion processing result includes: Downsampling the updated dense query to obtain a target dense query, wherein the target dense query has the same resolution as the updated sparse query; The target dense query and the updated sparse query are fused to obtain a fusion result, and the target BEV feature is determined according to the fusion result.
8. The method according to claim 7, wherein: The target intensive query includes a plurality of target intensive sub-queries; The fusion processing is performed on the target dense query and the updated sparse query to obtain a fusion processing result, and the target BEV feature is determined according to the fusion processing result, including: The updated sparse query is processed using a linear layer and a preset activation function to obtain the aggregation weight; Aggregate the multiple target dense sub-queries based on the aggregation weights to obtain a dense query to be fused; The dense query to be fused and the updated sparse query are fused to obtain a fusion result, and the target BEV feature is determined according to the fusion result.
9. The method according to claim 2, wherein: The decoder is further used to process the sparse query using a deformable self-attention network before upsampling the sparse query to obtain a target sparse query; Wherein, upsampling the sparse query includes: upsampling the target sparse query; The hybrid query includes the target sparse query and the dense query.
10. A method for training a target detection model, comprising: Extracting sample image features of multi-view sample images through a feature extraction network in a preset detection model, wherein the multi-view sample images are acquired by image acquisition devices with different viewpoints; Position encoding of preset reference points in the bird's-eye view BEV space is performed to obtain an initialized sparse query; Determine input data according to the initialized sparse query and the sample image features, and input the input data into the decoder of the Transformer network in the preset detection model to obtain target BEV features; wherein the decoder is used to upsample the sparse query to obtain a corresponding dense query, and update the hybrid query based on the sample image features, the hybrid query includes the sparse query and the dense query, and the updated hybrid query is used to determine the target BEV features; Determine, by means of a detection head in the preset detection model, a sample target detection result of the multi-view sample image based on the target BEV feature; A loss relationship is calculated based on the sample target detection results and the sample labels corresponding to the multi-view sample images, and the preset detection model is trained based on the loss relationship.
11. The method according to claim 10, wherein: The preset reference points are reference points uniformly fixed in a preset grid in the BEV space.
12. The method according to claim 10, wherein: The decoder is further configured to upsample the sparse reference points to obtain dense reference points, wherein the sparse reference points are obtained by adding a preset number of points in a vertical direction of the preset reference points, and the upsampling density for the sparse reference points is the same as the upsampling density for the sparse query; Wherein, updating the hybrid query based on the sample image features includes: Determine a corresponding target reference point according to the hybrid query, wherein the target reference point is determined from the sparse reference points and the dense reference points; Determine a target sampling point of the target reference point in the sample image feature according to the internal and external parameters of the image acquisition device; The sample image features are sampled using the target sampling points to obtain sampling results, and the hybrid query is updated using the sampling results.
13. The method according to claim 12, wherein: The determining the corresponding target reference point according to the hybrid query includes: Determining a prediction reference point according to the hybrid query, wherein the prediction reference point is determined from the sparse reference points and the dense reference points; Processing the hybrid query using a linear layer to generate a three-dimensional offset; A corresponding target reference point is determined according to the predicted reference point and the three-dimensional offset.
14. The method according to claim 12, wherein: The using the target sampling point to sample the sample image feature to obtain a sampling result, and using the sampling result to update the hybrid query includes: The sample image features are sampled using the target sampling points through a deformable multi-head cross attention network to obtain a sampling result, and the sampling result is added to the hybrid query to update the hybrid query.
15. The method according to claim 10, wherein: The decoder is further used to perform fusion processing on the updated hybrid query to obtain a fusion processing result, and determine the target BEV feature according to the fusion processing result.
16. The method according to claim 15, wherein: The step of performing fusion processing on the updated hybrid query to obtain a fusion processing result, and determining the target BEV feature according to the fusion processing result includes: Downsampling the updated dense query to obtain a target dense query, wherein the target dense query has the same resolution as the updated sparse query; The target dense query and the updated sparse query are fused to obtain a fusion result, and the target BEV feature is determined according to the fusion result.
17. The method according to claim 16, wherein: The target intensive query includes a plurality of target intensive sub-queries; The fusion processing is performed on the target dense query and the updated sparse query to obtain a fusion processing result, and the target BEV feature is determined according to the fusion processing result, including: The updated sparse query is processed using a linear layer and a preset activation function to obtain the aggregation weight; Aggregate the multiple target dense sub-queries based on the aggregation weights to obtain a dense query to be fused; The dense query to be fused and the updated sparse query are fused to obtain a fusion result, and the target BEV feature is determined according to the fusion result.
18. The method according to claim 11, wherein: The decoder is further used to process the sparse query using a deformable self-attention network before upsampling the sparse query to obtain a target sparse query; Wherein, upsampling the sparse query includes: upsampling the target sparse query; The hybrid query includes the target sparse query and the dense query.
19. A target detection device, comprising: An image feature extraction module, used to extract image features of multi-view images, wherein the multi-view images are acquired by image acquisition devices with different view angles; A position encoding module is used to perform position encoding on preset reference points in the bird's-eye view BEV space to obtain an initialized sparse query; A target feature determination module, used to determine input data according to the initialized sparse query and the image feature, and input the input data into a decoder of a Transformer network to obtain a target BEV feature; wherein the decoder is used to upsample the sparse query to obtain a corresponding dense query, and update a hybrid query based on the image feature, the hybrid query including the sparse query and the dense query, and the updated hybrid query is used to determine the target BEV feature; The target detection module is used to determine the target detection result of the multi-view image based on the target BEV feature.
20. The device according to claim 19, wherein The preset reference points are reference points uniformly fixed in a preset grid in the BEV space.
21. The device according to claim 19, wherein The decoder is further configured to upsample the sparse reference points to obtain dense reference points, wherein the sparse reference points are obtained by adding a preset number of points in a vertical direction of the preset reference points, and the upsampling density for the sparse reference points is the same as the upsampling density for the sparse query; Wherein, updating the hybrid query based on the image feature includes: Determine a corresponding target reference point according to the hybrid query, wherein the target reference point is determined from the sparse reference points and the dense reference points; Determine a target sampling point of the target reference point in the image feature according to the internal parameters and external parameters of the image acquisition device; The image features are sampled using the target sampling points to obtain sampling results, and the hybrid query is updated using the sampling results.
22. The device according to claim 21, wherein The determining the corresponding target reference point according to the hybrid query includes: Determining a prediction reference point according to the hybrid query, wherein the prediction reference point is determined from the sparse reference points and the dense reference points; Processing the hybrid query using a linear layer to generate a three-dimensional offset; A corresponding target reference point is determined according to the predicted reference point and the three-dimensional offset.
23. The device according to claim 21, wherein The using the target sampling point to sample the image feature to obtain a sampling result, and using the sampling result to update the hybrid query includes: The image features are sampled using the target sampling points through a deformable multi-head cross attention network to obtain a sampling result, and the sampling result is added to the hybrid query to update the hybrid query.
24. The device according to claim 19, wherein The decoder is further used to perform fusion processing on the updated hybrid query to obtain a fusion processing result, and determine the target BEV feature according to the fusion processing result.
25. The device according to claim 24, wherein: The step of performing fusion processing on the updated hybrid query to obtain a fusion processing result, and determining the target BEV feature according to the fusion processing result includes: Downsampling the updated dense query to obtain a target dense query, wherein the target dense query has the same resolution as the updated sparse query; The target dense query and the updated sparse query are fused to obtain a fusion result, and the target BEV feature is determined according to the fusion result.
26. The device according to claim 25, wherein The target intensive query includes a plurality of target intensive sub-queries; The fusion processing is performed on the target dense query and the updated sparse query to obtain a fusion processing result, and the target BEV feature is determined according to the fusion processing result, including: The updated sparse query is processed using a linear layer and a preset activation function to obtain the aggregation weight; Aggregate the multiple target dense sub-queries based on the aggregation weights to obtain a dense query to be fused; The dense query to be fused and the updated sparse query are fused to obtain a fusion result, and the target BEV feature is determined according to the fusion result.
27. The device according to claim 20, wherein: The decoder is further used to process the sparse query using a deformable self-attention network before upsampling the sparse query to obtain a target sparse query; Wherein, upsampling the sparse query includes: upsampling the target sparse query; The hybrid query includes the target sparse query and the dense query.
28. A training device for a target detection model, comprising: A sample image feature extraction module, used to extract sample image features of a multi-view sample image through a feature extraction network in a preset detection model, wherein the multi-view sample image is acquired by image acquisition devices of different viewpoints; An encoding module, used for encoding the positions of preset reference points in the bird's-eye view BEV space to obtain an initialized sparse query; A feature determination module, used to determine input data according to the initialized sparse query and the sample image feature, and input the input data into a decoder of a Transformer network in the preset detection model to obtain a target BEV feature; wherein the decoder is used to upsample the sparse query to obtain a corresponding dense query, and update a hybrid query based on the sample image feature, the hybrid query including the sparse query and the dense query, and the updated hybrid query is used to determine the target BEV feature; A detection module, configured to determine a sample target detection result of the multi-view sample image based on the target BEV feature by using a detection head in the preset detection model; A training module is used to calculate a loss relationship based on the sample target detection results and the sample labels corresponding to the multi-view sample images, and to train the preset detection model based on the loss relationship.
29. The device according to claim 28, wherein The preset reference points are reference points uniformly fixed in a preset grid in the BEV space.
30. The device according to claim 28, wherein The decoder is further configured to upsample the sparse reference points to obtain dense reference points, wherein the sparse reference points are obtained by adding a preset number of points in a vertical direction of the preset reference points, and the upsampling density for the sparse reference points is the same as the upsampling density for the sparse query; Wherein, updating the hybrid query based on the sample image features includes: Determine a corresponding target reference point according to the hybrid query, wherein the target reference point is determined from the sparse reference points and the dense reference points; Determine a target sampling point of the target reference point in the sample image feature according to the internal and external parameters of the image acquisition device; The sample image features are sampled using the target sampling points to obtain sampling results, and the hybrid query is updated using the sampling results.
31. The device according to claim 30, wherein The determining the corresponding target reference point according to the hybrid query includes: Determining a prediction reference point according to the hybrid query, wherein the prediction reference point is determined from the sparse reference points and the dense reference points; Processing the hybrid query using a linear layer to generate a three-dimensional offset; A corresponding target reference point is determined according to the predicted reference point and the three-dimensional offset.
32. The device according to claim 30, wherein: The using the target sampling point to sample the sample image feature to obtain a sampling result, and using the sampling result to update the hybrid query includes: The sample image features are sampled using the target sampling points through a deformable multi-head cross attention network to obtain a sampling result, and the sampling result is added to the hybrid query to update the hybrid query.
33. The apparatus of claim 28, wherein: The decoder is further used to perform fusion processing on the updated hybrid query to obtain a fusion processing result, and determine the target BEV feature according to the fusion processing result.
34. The device according to claim 33, wherein The step of performing fusion processing on the updated hybrid query to obtain a fusion processing result, and determining the target BEV feature according to the fusion processing result includes: Downsampling the updated dense query to obtain a target dense query, wherein the target dense query has the same resolution as the updated sparse query; The target dense query and the updated sparse query are fused to obtain a fusion result, and the target BEV feature is determined according to the fusion result.
35. The device according to claim 34, wherein The target intensive query includes a plurality of target intensive sub-queries; The fusion processing is performed on the target dense query and the updated sparse query to obtain a fusion processing result, and the target BEV feature is determined according to the fusion processing result, including: The updated sparse query is processed using a linear layer and a preset activation function to obtain the aggregation weight; Aggregate the multiple target dense sub-queries based on the aggregation weights to obtain a dense query to be fused; The dense query to be fused and the updated sparse query are fused to obtain a fusion result, and the target BEV feature is determined according to the fusion result.
36. The apparatus of claim 29, wherein: The decoder is further used to process the sparse query using a deformable self-attention network before upsampling the sparse query to obtain a target sparse query; Wherein, upsampling the sparse query includes: upsampling the target sparse query; The hybrid query includes the target sparse query and the dense query.
37. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 18.
38. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-18.
