Lane line detection method and apparatus, and electronic device

The neural network is used to extract features in lane line detection and calculate the representation vector of the instance attention map, which solves the problem of insufficient real-time and generalization of lane line detection in the existing technology, and realizes efficient and accurate lane lines and pavement markings. detection.

WO2024199101A1PCT designated stage expired Publication Date: 2024-10-03HUAWEI TECH CO LTD

Patent Information

Application Number
PCT/CN2024/083182
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-03-29
Filing Date
2024-03-22
Publication Date
2024-10-03

AI Technical Summary

Technical Problem

Existing lane line detection technology has shortcomings in real-time, accuracy and generalization, especially when detecting curve lines and road markings. It also requires high computing power and is difficult to implement in real-time on end-side devices. detection.

Method used

Use neural networks to extract features from lane line images, distinguish instance attention maps at the channel level of feature maps, calculate instance representation vectors, and achieve joint detection of lane lines and road signs, getting rid of high-resolution feature calculations and complex post-processing. Dependence, improves the real-time performance of the algorithm, and can detect lane lines of any shape.

Benefits of technology

It improves the real-time performance and accuracy of lane line detection, enables efficient detection on end-side devices, has high generalization, and realizes joint detection of lane lines and road markings.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024083182_03102024_PF_FP_ABST
    Figure CN2024083182_03102024_PF_FP_ABST
Patent Text Reader

Abstract

A lane line detection method, comprising: acquiring an image of a road ahead of a vehicle; processing a feature map of the image by means of N convolution kernels, so as to obtain N attention maps, wherein one attention map is used for representing the weight of one instance in the image at the position of a pixel point in the feature map of the image; on the basis of the feature map and the attention maps of the image, calculating representation vectors of instances corresponding to the attention maps; on the basis of the representation vectors of the instances, calculating the categories and positions of the instances; and when the categories of the instances are lane lines, displaying the lane lines on the image on the basis of the positions of the lane lines. Thus, instances in a feature map are distinguished at a channel level, and representation vectors of the instances are used for detection, such that the reliance on high-resolution feature calculation and complex post-processing is fundamentally eliminated, thereby ensuring the precision of detection while improving the real-time performance of an algorithm; and no assumptions are made about lane lines, such that lane lines in any shapes can be detected, thereby achieving a higher generalization performance.
Need to check novelty before this filing date? Find Prior Art

Description

Lane line detection method, device and electronic equipment

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on March 29, 2023, with application number 202310328836.3 and application name “A lane line detection method, device and electronic device”, the entire contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of artificial intelligence (AI) technology, and in particular to a lane line detection method, device, and electronic device. Background Art

[0003] Currently, technologies such as map navigation and autonomous driving have gradually become part of people's daily lives and are becoming auxiliary tools for daily travel. In these technologies, lane marking information on the road surface provides route reference for users and vehicles, preventing them from straying from their routes and thus avoiding accidents. Therefore, improving the real-time, accuracy, and generalizability of lane marking detection is a pressing technical challenge.

[0004] Summary of the Invention

[0005] The present application provides a lane line detection method, device, electronic device, computer storage medium and computer product, which can improve the real-time, accuracy and generalization of lane line detection.

[0006] In a first aspect, the present application provides a lane line detection method, including: acquiring a first image of a road in front of a vehicle; processing a feature map of the first image through a first number of convolution kernels to obtain a first number of attention maps, where an attention map is used to represent the weight of a pixel position of an instance in the first image in the feature map of the first image; calculating a representation vector of the instance corresponding to the attention map based on the feature map and the attention map of the first image; calculating the category and position of the instance corresponding to the attention map based on the representation vector of the instance corresponding to the attention map; when the category of the instance corresponding to the attention map is a lane line, displaying the lane line on the first image based on the position of the lane line.

[0007] In this way, during lane line detection, the attention maps of some instances contained in the feature map of the image to be detected (i.e., the first image) are distinguished at the channel level. Then, the representation vector of each instance is calculated using the attention map of each instance and the feature map of the image to be detected. Lane line detection is performed using the representation vector of each instance. In principle, this eliminates the reliance on high-resolution feature calculation and complex post-processing, improving the real-time performance of the algorithm while ensuring high-precision lane line detection. At the same time, during the detection process, no simplifying assumptions are made about the lane lines, so it can detect lane lines of any shape and has high generalization.

[0008] For example, the attention map can be used to identify the locations of pixels that need to be focused on in subsequent tasks. The representation vector of the instance can be the feature of the instance. The location of the instance can be the location of the instance in the first image.

[0009] In one possible implementation, the method may further include: when the category of the instance corresponding to the attention map is road marking, displaying the road marking on the first image based on the position of the road marking. In this way, road markings can be detected simultaneously with lane markings, achieving joint detection of lane markings and road markings. Exemplarily, road markings may include one or more of directional arrows, road traffic markings, road traffic signs, crosswalks, guide strips, and poles on the road.

[0010] In one possible implementation, the maximum number of instances displayed on the first image is a first number. Since the number of convolution kernels is predetermined, the number of instances distinguished at the channel level is also predetermined, and therefore, the maximum number of instances ultimately identified is also predetermined.

[0011] In one possible implementation, a representation vector of an instance corresponding to the attention map is calculated based on the feature map and the attention map of the first image. Specifically, the method includes: obtaining a feature map of the instance corresponding to the attention map based on the feature map and the attention map of the first image; and obtaining a representation vector of the instance corresponding to the attention map based on the feature map of the instance corresponding to the attention map. This allows calculation of the representation vector of the instance, thereby facilitating subsequent identification of the instance's category and location.

[0012] In one possible implementation, based on the representation vector of the instance corresponding to the attention map, the category and position of the instance corresponding to the attention map are calculated, specifically including: processing the representation vector of the instance corresponding to the attention map through a classification network to obtain the category of the instance corresponding to the attention map; based on the feature map of the first image and the representation vector of the instance corresponding to the attention map, calculating the weight of the pixel position of the instance corresponding to the attention map in the feature map of the first image to obtain a heat map of the instance corresponding to the attention map, the heat map is used to represent the weight of the pixel position of the instance corresponding to the attention map in the feature map of the first image; mapping the position of the pixel corresponding to the weight greater than a preset value in the heat map to the first image to obtain the position of the instance corresponding to the attention map. In this way, the classification and position of the instance can be realized, thereby facilitating the subsequent identification of whether the instance is a lane line, and when the instance is a lane line, displaying the lane line according to the position of the lane line.

[0013] Furthermore, it also includes: based on the representation vector of the instance corresponding to the feature map of the first image and the attention map, calculating the offset of the pixel position of the instance corresponding to the attention map in the feature map of the first image, and obtaining the offset map of the instance corresponding to the attention map, the offset map is used to represent the deviation between the actual position of the instance corresponding to the attention map on the first image and the position of the instance corresponding to the attention map mapped to the first image.

[0014] At this time, the positions of the pixels corresponding to the weights greater than the preset value in the heat map are mapped to the first image to obtain the position of the instance corresponding to the attention map, specifically including: based on the offset map of the instance corresponding to the attention map, the positions of the pixels corresponding to the weights greater than the preset value in the heat map are corrected, and the corrected positions are mapped to the first image to obtain the position of the instance corresponding to the attention map. In this way, the offset map can be used to correct the position of the instance indicated by the heat map, thereby improving the accuracy of detection.

[0015] In one possible implementation, the method can be executed by a terminal device such as a vehicle, an on-board terminal, or a mobile phone. In this case, the method may further include: obtaining the number of iterations required to calculate the category and position of the instance corresponding to the attention map based on the computing power of the terminal device; calculating the category and position of the instance corresponding to the attention map based on the number of iterations, wherein, when the number of iterations is greater than or equal to 1, the input data of each iteration are the feature map of the first image and the heat map of the instance corresponding to the attention map obtained in the previous calculation, and the output data of each iteration include the heat map of the instance corresponding to the attention map. In this way, when the computing power of the terminal device is high, multiple iterations can be used to improve the accuracy of detection.

[0016] In one possible implementation, the attention map, representation vector, and the category and position of the instance corresponding to the attention map in this method are all calculated using a neural network model. In this case, the method may further include: processing a second image using the neural network model to obtain the category and position of the instance in the second image, where the second image is transformed based on the first image; obtaining a first loss based on the category and position of the instance corresponding to the attention map, and the category and position of the instance in the second image; and updating the parameters of the neural network model with the goal of minimizing the first loss. This allows the neural network model to be updated and its generalization to be improved.

[0017] In a second aspect, the present application provides a lane line detection device, comprising: an acquisition module and a processing module. The acquisition module is used to acquire a first image of the road in front of the vehicle. The processing module is used to process the feature map of the first image through a first number of convolution kernels to obtain a first number of attention maps, where an attention map is used to characterize the weight of the position of the pixel point of an instance in the feature map of the first image. The processing module is also used to calculate the representation vector of the instance corresponding to the attention map based on the feature map and the attention map of the first image. The processing module is also used to calculate the category and position of the instance corresponding to the attention map based on the representation vector of the instance corresponding to the attention map. The processing module is also used to display the lane line on the first image based on the position of the lane line when the category of the instance corresponding to the attention map is a lane line.

[0018] In a possible implementation, the processing module is further configured to: when the category of the instance corresponding to the attention map is a road sign, display the road sign on the first image based on the position of the road sign.

[0019] In a possible implementation manner, the maximum number of instances displayed on the first image is the first number.

[0020] In one possible implementation, when the processing module calculates the representation vector of the instance corresponding to the attention map based on the feature map and the attention map of the first image, it is specifically used to: obtain the feature map of the instance corresponding to the attention map based on the feature map and the attention map of the first image; obtain the representation vector of the instance corresponding to the attention map based on the feature map of the instance corresponding to the attention map.

[0021] In one possible implementation, when the processing module calculates the category and position of the instance corresponding to the attention map based on the representation vector of the instance corresponding to the attention map, it is specifically used to: process the representation vector of the instance corresponding to the attention map through a classification network to obtain the category of the instance corresponding to the attention map; calculate the weight of the pixel position of the instance corresponding to the attention map in the feature map of the first image and the representation vector of the instance corresponding to the attention map based on the feature map of the first image to obtain a heat map of the instance corresponding to the attention map, and the heat map is used to represent the weight of the pixel position of the instance corresponding to the attention map in the feature map of the first image; map the position of the pixel corresponding to the weight greater than a preset value in the heat map to the first image to obtain the position of the instance corresponding to the attention map.

[0022] In one possible implementation, the processing module is further used to: calculate the offset of the pixel position of the instance corresponding to the attention map in the feature map of the first image based on the representation vector of the instance corresponding to the attention map and the attention map, and obtain an offset map of the instance corresponding to the attention map, wherein the offset map is used to represent the deviation between the actual position of the instance corresponding to the attention map on the first image and the position of the instance corresponding to the attention map mapped to the first image.

[0023] At this time, when the processing module maps the positions of the pixel points corresponding to the weights greater than the preset value in the heat map to the first image to obtain the positions of the instances corresponding to the attention map, it is specifically used to: based on the offset map of the instance corresponding to the attention map, correct the positions of the pixel points corresponding to the weights greater than the preset value in the heat map, and map the corrected positions to the first image to obtain the positions of the instances corresponding to the attention map.

[0024] In one possible implementation, the lane line detection device is deployed on a terminal device, and the processing module is further used to: obtain the number of iterations required to calculate the category and position of the instance corresponding to the attention map based on the computing power of the terminal device; calculate the category and position of the instance corresponding to the attention map based on the number of iterations, wherein, when the number of iterations is greater than or equal to 1, the input data of each iteration are the feature map of the first image and the heat map of the instance corresponding to the attention map obtained in the previous calculation, and the output data of each iteration include the heat map of the instance corresponding to the attention map.

[0025] In one possible implementation, the attention map, the representation vector, and the category and position of the instance corresponding to the attention map are all calculated using a neural network model. In this case, the processing module is further configured to: process the second image using the neural network model to obtain the category and position of the instance in the second image, where the second image is transformed based on the first image; obtain a first loss based on the category and position of the instance corresponding to the attention map and the category and position of the instance in the second image; and update the parameters of the neural network model with the goal of minimizing the first loss.

[0026] In a third aspect, the present application provides an electronic device comprising: at least one memory for storing programs; and at least one processor for executing the programs stored in the memory; wherein, when the program stored in the memory is executed, the processor is used to execute the method described in the first aspect or any possible implementation of the first aspect.

[0027] In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program. When the computer program runs on a processor, the processor executes the method described in the first aspect or any possible implementation of the first aspect.

[0028] In a fifth aspect, the present application provides a computer program product, which, when executed on a processor, enables the processor to execute the method described in the first aspect or any possible implementation of the first aspect.

[0029] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] The following is a brief introduction to the drawings required for describing the embodiments or prior art.

[0031] FIG1 is a schematic diagram of the architecture of a lane detection system provided in an embodiment of the present application;

[0032] FIG2 is a schematic diagram of the structure of some modules of a lane detection system provided in an embodiment of the present application;

[0033] FIG3 is a schematic diagram of a feature map and an attention map provided in an embodiment of the present application;

[0034] FIG4 is a schematic diagram of the structure of a network in an example attention calculation module provided in an embodiment of the present application;

[0035] FIG5 is a schematic diagram of the architecture of another lane detection system provided in an embodiment of the present application;

[0036] FIG6 is a schematic diagram of the structure of an iterative optimization module in a lane detection system provided in an embodiment of the present application;

[0037] FIG7 is a schematic diagram of the architecture of another lane detection system provided in an embodiment of the present application;

[0038] FIG8 is a schematic diagram of a process for calculating the optimal match between a true value and a predicted value provided by an embodiment of the present application;

[0039] FIG9 is a schematic diagram of a process for calculating loss provided in an embodiment of the present application;

[0040] FIG10 is a schematic diagram of the architecture of another lane detection system provided in an embodiment of the present application;

[0041] FIG11 is a schematic diagram of the architecture of a training system provided in an embodiment of the present application;

[0042] FIG12 is a flow chart of a lane detection method provided in an embodiment of the present application;

[0043] FIG13 is a schematic structural diagram of a lane detection device provided in an embodiment of the present application;

[0044] FIG14 is a schematic structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0045] The term "and / or" as used herein describes an association between related objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A exists alone, A and B exist simultaneously, or B exists alone. The symbol " / " as used herein indicates that the related objects are in an "or" relationship, for example, A / B means either A or B.

[0046] The terms "first" and "second" in this specification and claims are used to distinguish different objects rather than to describe a specific order of objects. For example, "first response message" and "second response message" are used to distinguish different response messages rather than to describe a specific order of response messages.

[0047] In the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of this application should not be interpreted as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0048] In the description of the embodiments of the present application, unless otherwise specified, "multiple" means two or more, for example, multiple processing units means two or more processing units, etc.; multiple elements means two or more elements, etc.

[0049] Generally, lane line detection can be achieved using either semantic segmentation or non-semantic segmentation methods. Semantic segmentation primarily uses a neural network designed for semantic segmentation to classify the input image pixel by pixel, determining the category of each pixel in the image (e.g., background, lane line, person, or vehicle), thereby performing region segmentation and ultimately detecting lane lines. However, this method requires determining the category of each pixel in the image for precise segmentation. Therefore, achieving good detection results requires a large amount of accurately labeled data, which is costly. Furthermore, this method uses a large model and requires significant computing power. However, computing power on the device side (e.g., vehicle, mobile phone, dashcam, etc.) is often limited, resulting in poor real-time performance when used on the device side.

[0050] Non-semantic segmentation methods primarily assume multiple lane lines at various locations on the input image. They then extract features from these assumed lane lines and determine whether they are actual lane lines. If they are, their positions are corrected. While these methods offer good real-time performance, since the assumed lane lines are straight, they can only detect straight lane lines. They are less effective for detecting curved lanes, have difficulty processing stop lines, and exhibit poor generalization. Furthermore, when detecting road markings simultaneously, these methods require the addition of additional subnetworks, increasing computational effort and reducing real-time detection performance.

[0051] In view of this, an embodiment of the present application provides a lane line detection method, which can use a neural network to extract features from the image to be detected and distinguish the lane lines to be detected at the channel level of the extracted feature map. Therefore, this method does not need to distinguish different lane lines on a single feature map, which reduces the resolution requirements for the features required for intermediate calculations and the amount of computation required for extracting a large number of intermediate features. This essentially improves the real-time performance of the algorithm and ensures high accuracy of lane line detection. In addition, since this method does not need to make any simplifying assumptions about the lane lines to be detected, it can detect lane lines of any shape, improving the generalization of lane line detection.

[0052] For example, Figure 1 shows a schematic diagram of the architecture of a lane detection system provided by an embodiment of the present application. As shown in Figure 1, the lane detection system 100 may include: an image acquisition module 110, a feature extraction module 120, an instance attention map calculation module 130, a representation vector extraction module 140, a representation vector classification module 150, a representation vector positioning module 160, and an instance display module 170.

[0053] Among them, the image acquisition module 110 is mainly used to acquire the image p0 to be detected. Exemplarily, when the lane line detection system 100 is configured on an on-board terminal in a vehicle, the image acquisition module 110 can be, but is not limited to, an image acquisition device such as a camera on the vehicle for acquiring images of the road in front of the vehicle. When the lane line detection system 100 is configured on an electronic device such as a mobile phone, the image acquisition module 110 can be, but is not limited to, a camera on the electronic device. In some embodiments, in addition to directly acquiring the image p0, the image acquisition module 110 can also receive the image p0 acquired by other image acquisition devices. The specific method can be determined according to actual conditions and is not limited here.

[0054] The feature extraction module 120 mainly uses a neural network or the like to perform feature extraction on the image p0 acquired by the image acquisition module 110 to obtain a feature map p1. The neural network used by the feature extraction module 120 may be, but is not limited to, a convolutional neural network. For example, taking the neural network used by the feature extraction module 120 as a convolutional neural network and the image p0 having a size of 800x320 as an example, as shown in FIG2 , the process of extracting features from the image p0 is as follows: performing a convolution operation through the subnetwork 211 in the convolutional neural network 210 to obtain a feature map of 100x40x64, and performing a convolution operation through the subnetwork 212 to obtain a feature map of 100x40x64; then, these two feature maps are spliced ​​together to obtain a feature map of 100x40x128 (i.e., feature map p1); finally, the spliced ​​feature map is optimized through the subnetwork 213 and output, i.e., feature map p1 is obtained. Stages 1 to 5 in the convolutional neural network 210 shown in FIG2 are all residual networks, and their number of feature channels is 16, 32, 64, 128, and 128, respectively. In FIG2 , axaxbxc Conv means: the convolution kernel size is axa, the convolution kernel channel is b, and the number of convolution kernels is c; BN refers to the batch normalization layer; ReLu refers to the linear rectifier function; pool refers to the pooling layer; Concat refers to the feature concatenation layer; Sigmoid is the activation function; Bilinearup refers to bilinear upsampling. In the convolutional neural network 210 shown in FIG2 , the depth of subnetwork 21 is relatively shallow, so the feature map it extracts can retain some detail information; the depth of subnetwork 22 is relatively deep, so the feature map it extracts can contain higher-level semantic information; finally, the feature maps extracted by the two are spliced ​​so that the final feature map can retain the detail information of the original image and contain the semantic information of the original image, thereby facilitating subsequent processing.

[0055] The instance attention map calculation module 130 is mainly used to calculate the feature map p1 extracted by the feature extraction module 120 through N convolution kernels to obtain the attention maps of N instances, so as to distinguish the instances to be detected at the channel level. Among them, the value of N can be set in advance. The attention map of an instance is used to characterize the weight of the position of each pixel point of the instance on the feature map p1. In some embodiments, the attention map can be used to identify the positions of pixel points that need to be paid attention to in subsequent tasks, and the weights corresponding to these positions on the attention map can be greater than the preset value.

[0056] For example, as shown in FIG3 (A), the feature map 31 contains 36 pixels, and the feature map 31 only contains one instance of line 32. At this time, the attention map shown in FIG3 (B) can be obtained by calculating the feature map 31 through the instance attention map calculation module 130; in FIG3 (B), the weight of the position where the line 32 passes through the pixel in the feature map 31 is 1, and the weight of the position where the line 32 does not pass through the pixel in the feature map 31 is 0. Exemplarily, the network structure of the instance attention map calculation module 130 can be mainly composed of N convolution kernels and some activation functions. For example, referring to FIG2 again, the network used by the instance attention map calculation module 130 is network 220, which includes 21 convolution kernels with a size of 3x3 and a convolution kernel channel of 128, as well as a Sigmoid function. In the network 220 shown in FIG2, when its input is the output of the convolutional neural network 210, its output can be 21 attention maps with a size of 100x40. In addition, in order to improve the accuracy of the instance attention map calculation, the extracted feature map can be optimized first, and then the optimized feature map can be calculated. In this case, a network for feature optimization can be added to the instance attention map calculation module 130. For example, as shown in Figure 4, a network 41 for feature optimization can be added before the network 220.

[0057] The representation vector extraction module 140 is mainly used to extract the representation vector of each instance in the N instances based on the feature map p1 extracted by the feature extraction module 120 and the attention map of the N instances calculated by the instance attention map calculation module 130. A representation vector is used to represent an instance and can be understood as a feature of an instance. Exemplarily, the representation vector extraction module 140 can first use the attention map of each instance and the feature map p1 to perform matrix multiplication to obtain the feature map of each instance, and then perform average calculation on the feature map of each instance to obtain the representation vector of the N instances. Exemplarily, referring to Figure 2, the network used by the representation vector extraction module 140 can be network 230. In the network 230, the attention map of each instance can first be matrix multiplied with the feature map p1, and then the average calculation of each calculation result can be performed through an average pooling layer to obtain 21 1x1x128 representation vectors, that is, 21 feature vectors with a size of 1x1 and a dimension of 128 are obtained. In some embodiments, the features of an image may include the features of all instances in the image.

[0058] The representation vector classification module 150 primarily classifies the representation vectors extracted by the representation vector extraction module 140 to obtain a category for each of the N instances. The preset instance categories include at least background and lane markings. Furthermore, the preset instance categories may also include road markings, such as guide arrows, road traffic markings, road traffic signs, crosswalks, guide strips, and poles on the road. This allows for simultaneous detection of road markings and lane markings, achieving joint detection of both. For example, referring again to FIG. 2 , the network used by the representation vector classification module 150 may be network 240. Network 240 may include a fully connected layer (FC) and a softmax layer. The representation vector classification module 150 may first classify the representation vectors of each instance using the FC layer, and then optimize the classification results using a softmax layer to obtain a category for each of the N instances. In some embodiments, the FC layer in network 240 may be replaced with a 1-dimensional convolution. The specific implementation depends on the actual situation and is not limited here. In some embodiments, the category of an instance can be understood as the type of the instance, that is, which category the instance belongs to. For example, the instance can belong to the lane line category, the background category, the guide arrow category, or the road traffic sign category.

[0059] The characterization vector positioning module 160 is mainly used to calculate the weight of the position of the pixel points of each instance in the N instances on the feature map p1 based on the various characterization vectors extracted by the characterization vector extraction module 140 and the feature map p1 extracted by the feature extraction module 120, so as to obtain a heat map (heatmap) of each instance on the feature map p1. The heat map of an instance is used to characterize the weight of the position of each pixel point of the instance on the feature map p1. Exemplarily, the characterization vector positioning module 160 can use the characterization vector of an instance to calculate a dynamic convolution kernel, and then use the convolution kernel to perform conditional convolution on the feature map p1 to obtain a heat map of the instance. For example, referring to Figure 2 again, the network used by the characterization vector positioning module 160 to calculate the heat map of the instance can be the subnetwork 251 in the network 250. In subnetwork 251, the FC layer can be used to calculate the representation vector of an instance to obtain the parameters of the convolution kernel (i.e., 1x1x128x1 Dynamic Conv) used subsequently. The feature map p1 is then optimized and the optimized feature map p1 is input into the calculated convolution kernel for calculation. The output of the convolution kernel is processed by the Sigmoid function to obtain a heat map of the corresponding instance. For example, the heat map can be called a positioning result.

[0060] In addition, the characterization vector positioning module 160 can also be used to calculate the offset of the position of the pixel point of each instance in the N instances on the feature map p1 based on the respective characterization vectors extracted by the characterization vector extraction module 140 and the feature map p1 extracted by the feature extraction module 120, so as to obtain the offset map of each instance on the feature map p1. The offset map of a certain instance is used to characterize the accuracy loss of mapping the instance to the original image, that is, the deviation between the position of the instance on the original image and the position of the instance mapped to the original image based on the instance heat map. Exemplarily, the characterization vector positioning module 160 can use the characterization vector of an instance to calculate a dynamic convolution kernel, and then use the convolution kernel to perform conditional convolution on the feature map p1 to obtain the offset map of the instance. For example, referring to Figure 2 again, the network used by the characterization vector positioning module 160 to calculate the offset map of the instance can be the subnetwork 252 in the network 250. In subnetwork 252, the FC layer can be used to calculate the representation vector of an instance to obtain the parameters of the convolution kernel (i.e., 1x1x128x2 Dynamic Conv) used subsequently. The feature map p1 is then optimized and the optimized feature map p1 is input into the calculated convolution kernel for calculation to obtain the offset map of the corresponding instance. For example, when using the offset map, the heat map and the offset map can be referred to as the positioning result.

[0061] The instance display module 170 is primarily used to display desired instances (e.g., lane lines, road markings, etc.) based on the categories of the N instances output by the representation vector classification module 150 and the heat map (or heat map and offset map) of the N instances output by the representation vector positioning module 160. For example, when the category of an instance is a pre-set category to be displayed, the location of the instance (i.e., the location of the instance in the original image p0) can be calculated based on the heat map (or heat map and offset map) of the instance, and the instance can be displayed in the image p0.

[0062] In some embodiments, when the position of an instance is calculated using the heat map of the instance, the position of each pixel corresponding to a weight greater than a preset value in the heat map of the instance is mapped to the original image p0, and the position of the instance in the image p0 can be obtained. When mapping the position of a certain pixel to the image p0, the mapping can be performed using a preset mapping ratio. For example, when the mapping ratio is 1:10, if the coordinates of a pixel corresponding to a weight greater than a preset value in the heat map of the instance are (x, y), then the coordinates of the instance in the original image p0 can be (10x, 10y). The preset mapping ratio can be obtained by the network structure of the neural network adopted by the lane line detection system 100. For example, when the neural network needs to reduce the original image by k times to obtain the heat map of an instance, the mapping ratio is 1:k.

[0063] In some embodiments, when calculating the instance's position using its heatmap and offset map, the instance's heatmap is first filtered to identify the locations of pixels with weights greater than a preset value. The offsets of these locations are then found in the offset map and used to correct them. Finally, the corrected locations are mapped to the original image p0 to obtain the instance's position in image p0.

[0064] In this embodiment, when displaying the instance based on its position in the original image p0, the instance display module 170 may mark the instance with a specific color, such as red, green, etc. In this way, the instance can be intuitively viewed in the original image p0.

[0065] The above is an introduction to the lane line detection system 100 provided in the embodiment of the present application. From the above description, it can be seen that in the process of detecting lane lines, after extracting the feature map, the system distinguishes the attention maps of some instances contained in the feature map from the channel level, and then calculates the characterization vector of each instance using the attention map of each instance and the extracted feature map, and uses the characterization vector of each instance for detection. During the detection process, it does not perform semantic segmentation, etc. Therefore, in principle, it gets rid of the dependence on high-resolution feature calculation and complex post-processing, improves the real-time performance of the algorithm, and also ensures the high accuracy of lane line detection. At the same time, during the detection process, it does not make any simplifying assumptions on the lane lines, so it can detect lane lines of any shape, and has high generalization.

[0066] In some embodiments, since the computing power of different devices is different, in order to further improve the accuracy of the detection results, an iterative optimization module can be added to the lane line detection system 100. The iterative optimization module can determine the number of iterative optimizations based on the computing power of the device equipped with the lane line detection system 100, so that the vehicle detection system 100 can match the device that hosts it. For example, when the computing power of the device is within the first computing power range, the number of iterative optimizations is 0, that is, the iterative optimization module is not enabled at this time; when the computing power of the device is within the second computing power range, the number of iterative optimizations is 2, that is, the iterative optimization module is enabled at this time, and the number of iterations is 2, wherein the lower limit value of the second computing power range is greater than the upper limit value of the first computing power range. The lane line detection system with the iterative optimization module added can be shown in Figure 5.

[0067] In Figure 5 , the iterative optimization module 180 is primarily used to perform iterative calculations based on the heatmaps of N instances calculated by the representation vector positioning module 160 and the feature map p1 output by the feature extraction module 120, in order to optimize the locations and categories of the N instances. The iterative optimization module 180 may primarily consist of the representation vector extraction module 140, the representation vector positioning module 160, and the representation vector classification module 150. For example, as shown in Figure 6 , the iterative optimization module 180 may include at least one representation vector extraction module 140, at least one representation vector positioning module 160, and at least one representation vector classification module 150. In Figure 6 , one representation vector extraction module 140, one representation vector positioning module 160, and one representation vector classification module 150 can be understood as a combination. Furthermore, each time the iterative optimization module 180 uses the feature map p1, it may first optimize the feature map and then use the optimized feature map for subsequent calculations. In Figure 6 , the output of the iterative optimization module 180 may be the result obtained after the mth iterative optimization.

[0068] In some embodiments, to further enhance the generalizability of the lane detection system 100, an inference update module can be added to the lane detection system 100. This inference update module can fine-tune the parameters of the network models in various modules of the lane detection system 100, thereby enabling the lane detection system 100 to achieve a better balance between computing power consumption and performance on devices with different computing power, thereby achieving better device generalization. The lane detection system with the added inference update module can be shown in Figure 7.

[0069] In Figure 7 , the inference update module 190 may include an image transformation module 191 and a loss calculation module 192. Image transformation module 191 is primarily used to perform random rotations (e.g., a rotation angle of -10° to 10°), left-right flipping, or translation (e.g., a vertical translation range of -20 pixels to 20 pixels) on image p0 acquired by image acquisition module 110 to generate a transformed image p2. After image transformation module 191 completes the image transformation, lane detection system 100 can detect instances in image p2 to determine the locations and categories of N instances.

[0070] The loss calculation module 192 is mainly used to calculate the loss using the detection result corresponding to the original image (i.e., image p0) as the true value and the transformed image (i.e., image p2) as the predicted value. When performing the loss calculation, you can first find the optimal match between the true value and the predicted value, that is, which predicted value is most similar to the true value, or which true value is most similar to the predicted value; then, the loss calculation is performed based on the optimal match between the true value and the predicted value, thereby reducing the amount of calculation and improving the calculation speed. For example, assuming the true value is: cls i、loc i and off i , the predicted value is cls j 、loc j and off j ;The values ​​of i and j are both [1, N]. Among them, cls i is the category of the i-th instance, loc i is the heat map of the i-th instance, off i is the offset map of the i-th instance. At this point, a cost function can be constructed and solved using an optimization algorithm to obtain the optimal match between the true value and the predicted value. For example, as shown in Figure 8, cross entropy, weighted cross entropy, and L2 distance can be used to calculate cls, loc, and off, respectively, to obtain the cost function between the true value and the predicted value. Then, the three cost functions are multiplied by their respective weight coefficients (i.e., W1, W2, and W3 in the figure) and added together. Finally, the Hungarian matching algorithm is used to solve the total cost function to obtain the optimal match.

[0071] After obtaining the optimal match between the true value and the predicted value, the loss calculation module 192 can calculate the loss between each predicted value and its optimal match to obtain the total loss. For example, the loss calculation module 192 can allocate and use cross entropy, weighted cross entropy and L2 distance as the loss functions of cls, loc and off respectively. After calculating each loss, these losses can be weighted and summed to obtain the total loss. For example, as shown in Figure 9, the cross entropy function can be used to calculate cls' i , and cls' j , the loss between them is calculated using the weighted cross entropy function loc' i , and loc' j , the loss between, using the weighted cross entropy function to calculate off i ' and off j 'Then, the calculated losses are weighted summed to obtain the total loss. Among them, cls' i , and cls' j , is the optimal match between the true value and the predicted value. In some embodiments, since instances of the background class often have no positioning results, for the detection results corresponding to the background in the original image, the positioning loss can be omitted and only the classification loss can be calculated.

[0072] After the loss calculation module 192 calculates the total loss, the parameters of the network in each module can be adjusted in a direction that minimizes the total loss, thereby updating the network in each module of the lane detection system 100 .

[0073] In some embodiments, the iterative optimization module 180 shown in FIG5 and the reasoning update module 190 shown in FIG7 may also be configured simultaneously in the lane detection system 100. Specifically, as shown in FIG10 , when the iterative optimization module 180 is used during the detection process, the input of the loss calculation module 192 may be the output of the iterative optimization module 180; when the iterative optimization module 180 is not used during the detection process, the input of the loss calculation module 192 may be the output of the representation vector positioning module 160 and the representation vector classification module 150.

[0074] It should be understood that in the lane detection system 100 described in the above embodiments, all modules except the image acquisition module 110, the example display module 170, and the inference update module 190 can be obtained through pre-training. The training system for these modules is described below.

[0075] Exemplarily, FIG11 shows a schematic diagram of the architecture of a training system provided by an embodiment of the present application. As shown in FIG11 , the training system 1100 includes: a loss calculation module 1101, as well as the feature extraction module 120, the instance attention map calculation module 130, the characterization vector extraction module 140, the characterization vector classification module 150, the characterization vector positioning module 160 and the iterative optimization module 180 in the aforementioned lane line detection system 100. For details of each module in the lane line detection system 100, please refer to the above description, which will not be repeated here. In addition, during the training process, the number of iterations of the iterative optimization module 180 can be pre-set.

[0076] The inputs to loss calculation module 1101 are the output of representation vector classification module 150, the output of representation vector localization module 160, the results of each iteration of iterative optimization module 180, and the labeled data. Loss calculation module 1101 can calculate the loss using the labeled data as the true value and the output of representation vector classification module 150, the output of representation vector localization module 160, and the results of each iteration of iterative optimization module 180 as the predicted values.

[0077] For ease of understanding, the following explanation is given by taking the case where the number of iterations of the iterative optimization module 180 is 3 as an example. During the training process, for each image, when the number of iterations of the iterative optimization module 180 is 3, the iterative optimization module 180 can output 3 groups of detection results (i.e., predicted values), the representation vector classification module 150 and the representation vector positioning module 160 can output 1 group of detection results, and each group of detection results can include the categories and thermal maps of N instances. Of course, each group of detection results can also include the offset maps of N instances, which is not limited here. The following introduction is based on the case where each group of results includes the categories, thermal maps, and offset maps of N instances. The detection results can be:

[0078] in, is the category of the i-th instance in the s-th group of detection results; is the heat map of the i-th instance in the s-th group of detection results; is the offset map of the i-th instance in the s-th group of detection results.

[0079] The labeled data can be a set of data (ie, true value) for an image, which can be written as:

[0080] in, is the category of the jth instance; is the heat map of the jth instance; is the offset map of the jth instance; M is the number of instances marked in the image.

[0081] After obtaining the predicted value and the true value, the loss calculation module 1101 can perform loss calculation. Similar to the loss calculation process of the loss calculation module 192 in the reasoning update module 190 described in Figure 7 above, the loss calculation module 1101 can also first find the optimal match between the true value and the predicted value; then, based on the optimal match between the true value and the predicted value, the loss calculation is performed, thereby reducing the amount of calculation and improving the calculation speed. Among them, for the i-th value in a certain set of predicted values, the optimal match result calculated by the loss calculation module 1101 can be: σ(i)∈[-1,M]

[0082] Here, σ(i) indicates that the true value corresponding to the i-th value in a set of predicted values ​​used to calculate the loss is the σ(i)th value. For example, when the i-th value in a set of predicted values ​​is a class, σ(i) = 3 indicates that the true value corresponding to the i-th value in a set of predicted values ​​used to calculate the loss is the third class among the true values. When σ(i) = -1, it indicates that the class of the i-th value in a set of predicted values ​​is background.

[0083] After obtaining the optimal match between the true value and the predicted value, loss calculation module 1101 can calculate the loss between the predicted value in each group and its optimal match to obtain the total loss. For details on this calculation process, see the description of loss calculation module 192 in reasoning update module 190 in Figure 7 above and will not be repeated here.

[0084] After the loss calculation module 1101 calculates the total loss, the parameters of the networks in each module can be adjusted in a direction that minimizes the total loss, thereby achieving training of the networks in the corresponding modules in the lane detection system 100 .

[0085] After the training system 1100 completes the training, the feature extraction module 120, the instance attention map calculation module 130, the representation vector extraction module 140, the representation vector classification module 150, the representation vector positioning module 160 and the iterative optimization module 180 can be sent to the corresponding end side to use these modules to detect instances such as lane lines on the end side.

[0086] The above is an introduction to the lane detection system 100 and the training system 1100 provided in the embodiment of the present application. Next, based on the contents of the above embodiment, a lane detection method provided in the embodiment of the present application is introduced.

[0087] For example, FIG12 shows a flow chart of a lane line detection method provided by an embodiment of the present application. It is understood that the method can be executed by any device, equipment, platform, or device cluster with computing and processing capabilities. As shown in FIG12, the lane line detection method may include the following steps:

[0088] S1201: Acquire a first image of the road ahead of the vehicle.

[0089] In this embodiment, the image of the road in front of the vehicle can be acquired in real time. For example, when the user is driving a vehicle and using map navigation software, the image of the road in front of the vehicle can be acquired in real time through an image acquisition device inside or outside the vehicle (such as a camera, etc.). Of course, the image of the road in front of the vehicle can also be acquired in advance. For example, when making a map, the vehicle can be driven in advance to acquire images on the road, etc. The specific method can be determined according to the actual situation and is not limited here. For example, the first image can be a static image or a frame of a video image. In some embodiments, the image of the road in front of the vehicle can be obtained by, but is not limited to, the image acquisition module 110 described in FIG. 1 .

[0090] S1202. Process the feature map of the first image using a first number of convolution kernels to obtain a first number of attention maps, where one attention map is used to represent the weight of a pixel position in the feature map of the first image for an instance in the first image.

[0091] In this embodiment, after acquiring the first image, feature extraction may be performed on the first image to obtain a feature map of the first image. For example, feature extraction may be performed on the first image by the feature extraction module 120 described in FIG1 .

[0092] After extracting the feature map of the first image, the feature map of the first image can be processed by N convolution kernels to obtain N attention maps. Among them, an attention map is used to characterize the weight of the pixel position of an instance in the first image in the feature map of the first image, which can identify the position of the pixel points that need to be paid attention to in subsequent tasks. In this way, the instance to be detected can be distinguished at the channel level. Exemplarily, N can also be called the first number, and the value can be pre-set. Exemplarily, the attention map can be, but is not limited to, calculated by the instance attention map calculation module 130 described in Figure 1 above.

[0093] S1203. Based on the feature map and the attention map of the first image, calculate a representation vector of the instance corresponding to the attention map.

[0094] In this embodiment, the feature map of the first image and each attention map can be used to obtain the feature map of the instance corresponding to each attention map. For example, for any attention map, the attention map and the feature map of the first image can be matrix multiplied to obtain the feature map of the instance corresponding to the attention map. Then, the representation vector of the instance corresponding to each attention map is obtained by using the feature map of the instance corresponding to each attention map. For example, for the representation vector of the instance corresponding to any attention map, the feature map of the instance corresponding to the attention map can be averaged to obtain the representation vector of the instance corresponding to the attention map. The representation vector of the instance can represent the characteristics of an instance. Exemplarily, the representation vector of the instance corresponding to the attention map can be, but is not limited to, calculated by the representation vector extraction module 140 described in FIG. 1 .

[0095] S1204. Based on the representation vector of the instance corresponding to the attention map, calculate the category and position of the instance corresponding to the attention map.

[0096] In this embodiment, after obtaining the representation vector of the instance corresponding to the attention map, the category and position of the instance corresponding to the attention map can be calculated through the representation vector of the instance corresponding to the attention map.

[0097] For the category of the instance corresponding to the attention map, the representation vector of the instance corresponding to the attention map can be input into the classification network, so that the representation vector of the instance corresponding to the attention map is processed by the classification network to obtain the category of the instance corresponding to the attention map. Exemplarily, the classification network can be, but is not limited to, a fully connected layer or a one-dimensional convolutional layer. Exemplarily, the representation vector of the instance corresponding to the attention map can be processed by, but is not limited to, the representation vector classification module 150 in FIG. 1 to obtain the category of the instance corresponding to the attention map.

[0098] For the position of the instance corresponding to the attention map, the weight of the pixel position of the instance corresponding to the attention map in the feature map of the first image and the representation vector of the instance corresponding to the attention map can be calculated based on the feature map of the first image and the representation vector of the instance corresponding to the attention map to obtain a heat map of the instance corresponding to the attention map. The heat map is used to characterize the weight of the pixel position of the instance corresponding to the attention map in the feature map of the first image. In addition, the position of the pixel corresponding to the weight greater than the preset value in the heat map is mapped (for example, mapped according to a certain ratio, etc.) to the first image to obtain the position of the instance. Exemplarily, the representation vector of the instance corresponding to the feature map of the first image and the attention map can be processed by, but not limited to, the representation vector positioning module 160 in FIG. 1 to obtain a heat map of the instance corresponding to the attention map.

[0099] In addition, when extracting the feature map of the first image, the first image is often processed by downsampling and other processing, and interpolation algorithms are often used during the processing. This makes the position of the pixel points in the feature map of the first image not necessarily completely corresponding to the position of the pixel points in the first image, and thus causes some deviations when mapping the position of the instance indicated in the heat map to the first image. Therefore, in order to improve the detection accuracy, these deviations can also be calculated so that the position of the instance can be corrected by these deviations. In which, when calculating these deviations, the offset of the pixel position of the instance corresponding to the attention map in the feature map of the first image can be calculated based on the representation vector of the instance corresponding to the feature map of the first image and the attention map, and the offset map of the instance corresponding to the attention map is obtained. The offset map is used to represent the deviation between the actual position of the instance corresponding to the attention map on the first image and the position of the instance corresponding to the attention map mapped to the first image. In this embodiment, the position of the instance corresponding to the attention map can be first corrected based on the offset map of the instance, and then the position of the pixel point corresponding to the weight greater than the preset value in the heat map of the instance is mapped to the position obtained in the first image. For example, for a weight in the heat map that is greater than a preset value, the position of the pixel corresponding to the weight is (x, y), and in the offset map, the offset corresponding to the position is (Δx, Δy). The calculated position of the pixel corresponding to the weight is (x+Δx, y+Δy). If the mapping ratio is 1:k, the position obtained by mapping (x+Δx, y+Δy) to the first image is (k(x+Δx), k(y+Δy)). For example, the representation vector positioning module 160 in FIG. 1 can be used, but is not limited to, to process the representation vectors of the instances corresponding to the feature map and the attention map of the first image to obtain the offset map of the instance corresponding to the attention map.

[0100] S1205. When the category of the instance corresponding to the attention map is a lane line, display the lane line on the first image based on the position of the lane line.

[0101] In this embodiment, when the category of the instance corresponding to the attention map is a lane line, the lane line can be displayed on the first image based on the position of the lane line. For example, corresponding to a certain pixel point on the lane line, when the position of the pixel point is (x+Δx, y+Δy), the position (x+Δx, y+Δy) on the first image can be marked with a specific color. In this way, when all the pixels on the lane line are marked, the lane line can be displayed on the first image. Exemplarily, but not limited to, the lane line can be displayed on the first image using the example display module 170 described in FIG. 1 .

[0102] In this way, during lane line detection, the attention maps of some instances contained in the feature map of the image to be detected (i.e., the first image) are distinguished at the channel level. Then, the representation vector of each instance is calculated using the attention map of each instance and the feature map of the image to be detected. Lane line detection is performed using the representation vector of each instance. In principle, this eliminates the reliance on high-resolution feature calculation and complex post-processing, improving the real-time performance of the algorithm while ensuring high-precision lane line detection. At the same time, during the detection process, no simplifying assumptions are made about the lane lines, so it can detect lane lines of any shape and has high generalization.

[0103] In some embodiments, when the category of the instance corresponding to the attention map is road markings, the road markings can be displayed on the first image based on their positions. This allows for simultaneous detection of lane markings and road markings, thus achieving joint detection of lane markings and road markings.

[0104] In some embodiments, the maximum number of instances displayed in the first image is the number of convolution kernels used in step S1202. Because the number of convolution kernels is predetermined, the number of instances distinguished at the channel level is also predetermined, and therefore, the maximum number of instances ultimately identified is also predetermined. For example, if the number of convolution kernels is 10 and the number of lane lines in the first image is 20, if the background instance must be displayed, then the number of lane lines ultimately displayed is 9.

[0105] In some embodiments, the lane line detection method described in FIG. 12 can be executed by a terminal device (such as a vehicle, an on-board terminal in a vehicle, a mobile phone, etc.). At this time, based on the computing power of the terminal device, a pre-set relationship table between computing power and number of iterations can be queried to obtain the number of iterations required to calculate the category and position of the instance corresponding to the attention map on the terminal device. Then, based on the obtained number of iterations, the category and position of the instance corresponding to the attention map are calculated. Wherein, when the number of iterations is greater than or equal to 1, the input data of each iteration are the feature map of the first image and the heat map of the instance corresponding to the attention map obtained in the previous calculation, and the output data of each iteration include the heat map of the instance corresponding to the attention map. In this way, when the computing power of the terminal device is high, multiple iterations can be used to improve the accuracy of detection. Exemplarily, the number of iterations can be calculated by the aforementioned iterative optimization module 180 and / or the category and position of the instance corresponding to the attention map can be calculated based on the number of iterations, but is not limited to.

[0106] In some embodiments, the feature map, attention map, representation vector, and the category and location of the instance corresponding to the attention map of the first image described in FIG12 can all be calculated using a neural network model. Exemplarily, the neural network model may be composed of, but not limited to, the aforementioned feature extraction module 120, instance attention map calculation module 130, representation vector extraction module 140, representation vector classification module 150, and representation vector localization module 160, or may be composed of the feature extraction module 120, instance attention map calculation module 130, representation vector extraction module 140, representation vector classification module 150, representation vector localization module 160, and iterative optimization module 180. After completing lane line detection in the first image, the first image may be subjected to a transformation such as random rotation to obtain a second image. The second image is then processed using the neural network model to obtain the category and location of the instance in the second image. Subsequently, a loss calculation may be performed using the category and location of the instance corresponding to the attention map calculated from the first image as the true value, and the category and location of the instance in the second image as the predicted value, to obtain a first loss. Finally, the parameters of the neural network model can be updated with the goal of minimizing the first loss. This can update the neural network model and improve its generalization. Exemplarily, this process can be performed by, but is not limited to, the aforementioned inference update module 190.

[0107] The above is an introduction to the lane line detection method provided in the embodiment of the present application. Next, based on the method in the above embodiment, a lane line detection device provided in the embodiment of the present application is introduced.

[0108] Exemplarily, FIG13 shows a schematic structural diagram of a lane line detection device provided in an embodiment of the present application. As shown in FIG13 , the lane line detection device may include: an acquisition module 1301 and a processing module 1302. The acquisition module 1301 is used to acquire a first image of the road in front of the vehicle. The processing module 1302 is used to process the feature map of the first image through a first number of convolution kernels to obtain a first number of attention maps, where an attention map is used to characterize the weight of the position of the pixel point of an instance in the feature map of the first image. The processing module 1302 is also used to calculate the representation vector of the instance corresponding to the attention map based on the feature map and the attention map of the first image. The processing module 1302 is also used to calculate the category and position of the instance corresponding to the attention map based on the representation vector of the instance corresponding to the attention map. The processing module 1302 is also used to display the lane line on the first image based on the position of the lane line when the category of the instance corresponding to the attention map is a lane line.

[0109] In some embodiments, the processing module 1302 is further configured to: when the category of the instance corresponding to the attention map is a road sign, display the road sign on the first image based on the position of the road sign.

[0110] In some embodiments, the maximum number of instances displayed on the first image is the first number.

[0111] In some embodiments, when the processing module 1302 calculates the representation vector of the instance corresponding to the attention map based on the feature map and the attention map of the first image, it is specifically used to: obtain the feature map of the instance corresponding to the attention map based on the feature map and the attention map of the first image; obtain the representation vector of the instance corresponding to the attention map based on the feature map of the instance corresponding to the attention map.

[0112] In some embodiments, when the processing module 1302 calculates the category and position of the instance corresponding to the attention map based on the representation vector of the instance corresponding to the attention map, it is specifically used to: process the representation vector of the instance corresponding to the attention map through a classification network to obtain the category of the instance corresponding to the attention map; calculate the weight of the pixel position of the instance corresponding to the attention map in the feature map of the first image and the representation vector of the instance corresponding to the attention map based on the feature map of the first image to obtain a heat map of the instance corresponding to the attention map, and the heat map is used to represent the weight of the pixel position of the instance corresponding to the attention map in the feature map of the first image; map the position of the pixel corresponding to the weight greater than the preset value in the heat map to the first image to obtain the position of the instance corresponding to the attention map.

[0113] In some embodiments, the processing module 1302 is further used to: calculate the offset of the pixel position of the instance corresponding to the attention map in the feature map of the first image based on the representation vector of the instance corresponding to the feature map of the first image and the attention map, and obtain the offset map of the instance corresponding to the attention map, the offset map being used to characterize the deviation between the actual position of the instance corresponding to the attention map on the first image and the position of the instance corresponding to the attention map mapped to the first image. At this time, when the processing module maps the position of the pixel corresponding to the weight greater than the preset value in the heat map to the first image to obtain the position of the instance corresponding to the attention map, it is specifically used to: correct the position of the pixel corresponding to the weight greater than the preset value in the heat map based on the offset map of the instance corresponding to the attention map, and map the corrected position to the first image to obtain the position of the instance corresponding to the attention map.

[0114] In some embodiments, the lane line detection device is deployed on a terminal device, and the processing module 1302 is further used to: obtain the number of iterations required to calculate the category and position of the instance corresponding to the attention map based on the computing power of the terminal device; calculate the category and position of the instance corresponding to the attention map based on the number of iterations, wherein, when the number of iterations is greater than or equal to 1, the input data of each iteration are the feature map of the first image and the heat map of the instance corresponding to the attention map obtained in the previous calculation, and the output data of each iteration include the heat map of the instance corresponding to the attention map.

[0115] In some embodiments, the attention map, the representation vector, and the category and position of the instance corresponding to the attention map are all calculated by a neural network model. In this case, the processing module 1302 is further configured to: process the second image using the neural network model to obtain the category and position of the instance in the second image, where the second image is transformed based on the first image; obtain a first loss based on the category and position of the instance corresponding to the attention map and the category and position of the instance in the second image; and update the parameters of the neural network model with the goal of minimizing the first loss.

[0116] It should be understood that the above-mentioned device is used to execute the method in the above-mentioned embodiment. The implementation principle and technical effect of the corresponding program module in the device are similar to those described in the above-mentioned method. The working process of the device can refer to the corresponding process in the above-mentioned method and will not be repeated here.

[0117] Based on the methods in the above embodiments, an embodiment of the present application further provides an electronic device 1400. As shown in Figure 14, electronic device 1400 includes a bus 1402, a processor 1404, a memory 1406, and a communication interface 1408. Processor 1404, memory 1406, and communication interface 1408 communicate with each other via bus 1402. Electronic device 1400 can be, but is not limited to, the vehicle described above, an onboard terminal in a vehicle, a mobile phone, etc. It should be understood that this application does not limit the number of processors and memories in electronic device 1400.

[0118] Bus 1402 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, among others. Buses may be classified as address buses, data buses, control buses, and the like. For ease of illustration, FIG14 illustrates a single bus line, but this does not imply a single bus or type of bus. Bus 1404 may include a path for transmitting information between various components of electronic device 1400 (e.g., memory 1406, processor 1404, and communication interface 1408).

[0119] The processor 1404 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0120] The memory 1406 may include volatile memory, such as random access memory (RAM). The processor 1404 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).

[0121] Memory 1406 stores executable program code, which processor 1404 executes to implement the functions of the modules described above in FIG. 13 , thereby performing all or part of the steps of the method in the above-described embodiment. In other words, memory 1406 stores instructions for executing all or part of the steps of the method in the above-described embodiment.

[0122] Alternatively, the memory 1406 stores executable code, and the processor 1404 executes the executable code to implement the functions of the lane detection device 1300 described above, thereby implementing all or part of the steps in the above-described embodiment method. In other words, the memory 1406 stores instructions for executing all or part of the steps in the above-described embodiment method.

[0123] The communication interface 1403 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the electronic device 1400 and other devices or a communication network.

[0124] Based on the method in the above embodiment, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program runs on a processor, the processor executes the method in the above embodiment.

[0125] Based on the method in the above embodiment, an embodiment of the present application provides a computer program product. When the computer program product runs on a processor, the processor executes the method in the above embodiment.

[0126] It is understood that the processor in the embodiments of the present application may be a central processing unit (CPU), or may be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. The general-purpose processor may be a microprocessor or any conventional processor.

[0127] The method steps in the embodiments of the present application can be implemented by hardware or by a processor executing software instructions. The software instructions can be composed of corresponding software modules, which can be stored in random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, mobile hard disks, CD-ROMs or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an ASIC.

[0128] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted via the computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state drive (SSD)).

[0129] It will be understood that the various numerical numbers involved in the embodiments of the present application are merely distinctions for the convenience of description and are not intended to limit the scope of the embodiments of the present application.

Claims

1. A lane line detection method, characterized in that: The method comprises: Acquire a first image of a road ahead of the vehicle; Processing the feature map of the first image by using a first number of convolution kernels to obtain a first number of attention maps, where one attention map is used to represent a weight of a position of a pixel point of an instance in the first image in the feature map of the first image; Based on the feature map of the first image and the attention map, calculating a representation vector of the instance corresponding to the attention map; Based on the representation vector of the instance corresponding to the attention map, calculating the category and position of the instance corresponding to the attention map; When the category of the instance corresponding to the attention map is a lane line, the lane line is displayed on the first image based on the position of the lane line.

2. The method according to claim 1, characterized in that The method further comprises: When the category of the instance corresponding to the attention map is a road sign, the road sign is displayed on the first image based on the position of the road sign.

3. The method according to claim 1 or 2, characterized in that: The maximum value of the number of instances displayed on the first image is the first number.

4. The method according to any one of claims 1 to 3, characterized in that: The calculating, based on the feature map of the first image and the attention map, a representation vector of the instance corresponding to the attention map specifically includes: Based on the feature map of the first image and the attention map, obtaining a feature map of the instance corresponding to the attention map; Based on the feature map of the instance corresponding to the attention map, a representation vector of the instance corresponding to the attention map is obtained.

5. The method according to any one of claims 1 to 4, characterized in that: The calculating, based on the representation vector of the instance corresponding to the attention map, the category and position of the instance corresponding to the attention map, specifically includes: Processing the representation vector of the instance corresponding to the attention map through a classification network to obtain the category of the instance corresponding to the attention map; Based on the feature map of the first image and the characterization vector of the instance corresponding to the attention map, the weight of the pixel position of the instance corresponding to the attention map in the feature map of the first image is calculated to obtain a heat map of the instance corresponding to the attention map, where the heat map is used to characterize the weight of the pixel position of the instance corresponding to the attention map in the feature map of the first image; The positions of the pixels corresponding to the weights greater than the preset value in the heat map are mapped to the first image to obtain the positions of the instances corresponding to the attention map.

6. The method according to claim 5, characterized in that The method further comprises: Based on the feature map of the first image and the representation vector of the instance corresponding to the attention map, calculating the offset of the pixel position of the instance corresponding to the attention map in the feature map of the first image, to obtain an offset map of the instance corresponding to the attention map, wherein the offset map is used to represent the deviation between the actual position of the instance corresponding to the attention map on the first image and the position of the instance corresponding to the attention map mapped to the first image; Mapping the positions of the pixels corresponding to the weights greater than the preset value in the heat map to the first image to obtain the positions of the instances corresponding to the attention map specifically includes: Based on the offset map of the instance corresponding to the attention map, the positions of the pixels corresponding to the weights greater than the preset values ​​in the heat map are corrected, and the corrected positions are mapped to the first image to obtain the positions of the instances corresponding to the attention map.

7. The method according to claim 5 or 6, characterized in that: The method is performed by a terminal device, and the method further includes: Based on the computing power of the terminal device, obtaining the number of iterations required to calculate the category and position of the instance corresponding to the attention map; Based on the number of iterations, the category and position of the instance corresponding to the attention map are calculated, wherein when the number of iterations is greater than or equal to 1, the input data of each iteration are the feature map of the first image and the heat map of the instance corresponding to the attention map calculated last time, and the output data of each iteration includes the heat map of the instance corresponding to the attention map.

8. The method according to any one of claims 1 to 7, characterized in that: The attention map, the representation vector, and the category and position of the instance corresponding to the attention map are all calculated by a neural network model; The method further comprises: Processing a second image by the neural network model to obtain a category and a position of an instance in the second image, wherein the second image is obtained based on a transformation of the first image; Obtaining a first loss based on the category and position of the instance corresponding to the attention map and the category and position of the instance in the second image; The parameters in the neural network model are updated with the goal of minimizing the first loss.

9. A lane line detection device, characterized in that: include: An acquisition module, used to acquire a first image of the road ahead of the vehicle; A processing module, configured to process the feature map of the first image by using a first number of convolution kernels to obtain a first number of attention maps, wherein one of the attention maps is used to represent a weight of a position of a pixel point of an instance in the first image in the feature map of the first image; The processing module is further configured to calculate a representation vector of an instance corresponding to the attention map based on the feature map of the first image and the attention map; The processing module is further used to calculate the category and position of the instance corresponding to the attention map based on the representation vector of the instance corresponding to the attention map; The processing module is further configured to display the lane line on the first image based on the position of the lane line when the category of the instance corresponding to the attention map is a lane line.

10. The device according to claim 9, characterized in that The processing module is further used for: When the category of the instance corresponding to the attention map is a road sign, the road sign is displayed on the first image based on the position of the road sign.

11. The device according to claim 9 or 10, characterized in that The maximum value of the number of instances displayed on the first image is the first number.

12. The device according to any one of claims 9 to 11, characterized in that: When the processing module calculates the representation vector of the instance corresponding to the attention map based on the feature map of the first image and the attention map, the processing module is specifically used to: Based on the feature map of the first image and the attention map, obtaining a feature map of the instance corresponding to the attention map; Based on the feature map of the instance corresponding to the attention map, a representation vector of the instance corresponding to the attention map is obtained.

13. The device according to any one of claims 9 to 12, characterized in that: When the processing module calculates the category and position of the instance corresponding to the attention map based on the representation vector of the instance corresponding to the attention map, it is specifically used to: Processing the representation vector of the instance corresponding to the attention map through a classification network to obtain the category of the instance corresponding to the attention map; Based on the feature map of the first image and the characterization vector of the instance corresponding to the attention map, the weight of the pixel position of the instance corresponding to the attention map in the feature map of the first image is calculated to obtain a heat map of the instance corresponding to the attention map, where the heat map is used to characterize the weight of the pixel position of the instance corresponding to the attention map in the feature map of the first image; The positions of the pixels corresponding to the weights greater than the preset value in the heat map are mapped to the first image to obtain the positions of the instances corresponding to the attention map.

14. The device according to claim 13, characterized in that The processing module is further used for: Based on the feature map of the first image and the representation vector of the instance corresponding to the attention map, calculating the offset of the pixel position of the instance corresponding to the attention map in the feature map of the first image, to obtain an offset map of the instance corresponding to the attention map, wherein the offset map is used to represent the deviation between the actual position of the instance corresponding to the attention map on the first image and the position of the instance corresponding to the attention map mapped to the first image; When the processing module maps the positions of the pixels corresponding to the weights greater than the preset value in the heat map to the first image to obtain the positions of the instances corresponding to the attention map, it is specifically used to: Based on the offset map of the instance corresponding to the attention map, the positions of the pixels corresponding to the weights greater than the preset values ​​in the heat map are corrected, and the corrected positions are mapped to the first image to obtain the positions of the instances corresponding to the attention map.

15. The device according to claim 13 or 14, characterized in that The lane line detection device is deployed on a terminal device, and the processing module is further used for: Based on the computing power of the terminal device, obtaining the number of iterations required to calculate the category and position of the instance corresponding to the attention map; Based on the number of iterations, the category and position of the instance corresponding to the attention map are calculated, wherein when the number of iterations is greater than or equal to 1, the input data of each iteration are the feature map of the first image and the heat map of the instance corresponding to the attention map calculated last time, and the output data of each iteration includes the heat map of the instance corresponding to the attention map.

16. The device according to any one of claims 9 to 15, characterized in that: The attention map, the representation vector, and the category and position of the instance corresponding to the attention map are all calculated by a neural network model; The processing module is further used for: Processing a second image by the neural network model to obtain a category and a position of an instance in the second image, wherein the second image is obtained based on a transformation of the first image; Obtaining a first loss based on the category and position of the instance corresponding to the attention map and the category and position of the instance in the second image; The parameters in the neural network model are updated with the goal of minimizing the first loss.

17. An electronic device, characterized in that: include: at least one memory for storing a program; at least one processor, configured to execute the program stored in the memory; Wherein, when the program stored in the memory is executed, the processor is used to execute the method according to any one of claims 1-8.

18. A computer-readable storage medium storing a computer program, wherein when the computer program is executed on a processor, the processor is caused to execute the method according to any one of claims 1 to 8.

19. A computer program product, characterized in that When the computer program product runs on a processor, the processor is caused to execute the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Neural network training method, lane line detection method and device and electronic equipment

    CN112307850A

  • Lane line detection and segmentation method based on attention space convolutional neural network

    CN112633177A

  • Intelligent vehicle lane line detection method based on ResNeSt and self-attention distillation

    CN113158768A

  • Lane line detection method and system based on sliding window self-attention mechanism

    CN113361447A

  • Lane line segmentation method and device based on spatial context, and storage medium

    CN115205681A

Cited By

  • Automatic channel system identification method and system based on artificial intelligence

    CN120673263A