A cross network lane line detection method and device based on weight fusion
By introducing weight fusion and cross network technology into lane line detection and dynamically adjusting the feature layer attention, it solves the recognition challenges of existing models in diverse environments and improves detection accuracy and generalization performance.
Patent Information
- Application Number
- CN202311689863.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-11
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2043-12-11
AI Technical Summary
Existing lane line detection models have challenges when dealing with diverse driving environments and road conditions. In particular, they ignore the attention of different levels of feature maps, resulting in differences in learning capabilities under different detection conditions.
The cross network method based on weight fusion is adopted, through the proportional feature pyramid network and cross refinement network, combined with the weight fusion algorithm and anchor point generation algorithm, to dynamically adjust the degree of attention of the feature layer to adapt to different detection scenarios.
It improves the accuracy and generalization performance of lane line detection, enables the model to better adapt to different data sets and detection scenarios, and enhances the ability to recognize lane lines.
Smart Images

Figure CN117789144B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence recognition technology, and in particular to a method and device for detecting cross-network lane lines based on weight fusion. Background Art
[0002] Lane detection is one of the most important technologies in autonomous driving and driver assistance systems. It uses sensors (such as cameras, lidar, etc.) to identify lane lines on the road and provide relevant information to the vehicle control system.
[0003] In the autonomous driving system, lane line detection can help the vehicle understand the lane position and direction of the vehicle in real time, so as to perform autonomous navigation and path planning. By detecting the lane, the vehicle can determine whether it has deviated from the lane and take corresponding measures to keep driving in the correct lane, improving the safety and accuracy of driving. In the driving assistance system, lane line detection can provide the driver with information about the lane position of the vehicle, helping the driver to keep the vehicle in the correct lane. When the driver deviates from the lane, the system can remind the driver to correct the driving trajectory in time through sound, vibration or visual alarms, improving the safety and accuracy of driving.
[0004] Lane detection technology is usually implemented by combining image processing, computer vision, and machine learning technologies. By analyzing and processing road images, the location and features of lane lines can be extracted, and the lane line types can be classified to better understand road conditions.
[0005] However, most current lane detection models focus on deepening the depth of feature extraction networks, while neglecting the attention paid to feature maps at different levels. The model has different learning capabilities for feature maps at different levels under different detection conditions. For example, lane lines may present different characteristics under different locations, lighting conditions, and weather conditions. As a result, existing methods still face challenges in dealing with diverse driving environments and road conditions.
[0006] Therefore, the above-mentioned technical defects need to be changed urgently. Summary of the invention
[0007] In view of the shortcomings of the prior art, the present invention provides a method and device for detecting lane lines in a cross network based on weight fusion, aiming to improve the accuracy and reliability of lane line detection in autonomous driving and driving assistance systems.
[0008] In order to solve the above technical problems, the first aspect of the embodiment of the present application provides a cross network lane line detection method based on weight fusion, the method comprising:
[0009] Obtain a lane image, split the lane image into several frame images and input them into the scale feature pyramid network in sequence;
[0010] The semantic features of the frame image are extracted through the feature extraction network in the scale feature pyramid network to obtain a feature map;
[0011] The feature map is weighted fused by the weight fusion algorithm to obtain the lane feature image;
[0012] The lane feature image is input into the intersection refinement network, potential lane line anchor points are marked on the lane feature image through the anchor point generation algorithm, and a lane anchor point image is generated; wherein the input end of the intersection refinement network is connected to the output end of the scale feature pyramid network;
[0013] Assign positive samples to the lane anchor point images to obtain the detected lanes.
[0014] The cross network lane detection method based on weight fusion, wherein the weight fusion mechanism between adjacent feature layers in the proportional feature pyramid network is as follows:
[0015] ,
[0016] in represents a 1×1 convolution operation, Perform 2× upsampling on high-level feature maps, Represents the weight fusion factor between adjacent feature layers, represents the i-th level feature map, Represents the i-th level fused feature map in the scaled feature pyramid network.
[0017] The cross network lane line detection method based on weight fusion, wherein the step of performing weight fusion on the feature map through a weight fusion algorithm to obtain a lane feature image includes:
[0018] The initial feature pyramid network training model is adopted, where the weight fusion factor is 1 and the LIoULoss values of all feature layers are recorded;
[0019] pass Calculate the weights of each layer in the scale feature pyramid network, where represents Euler's number, a constant representing the basis of natural logarithms, represents the line intersection on the joint loss, α is a hyperparameter;
[0020] pass Calculate the weight fusion factor between adjacent layers, where is the weight ratio of layer i and i-1, represents the weight of the i-th layer;
[0021] Save the weight fusion factors and the index of the input image.
[0022] The weight fusion-based crossing network lane line detection method, wherein the lane feature image is input into the crossing refinement network, potential lane line anchor points are marked on the lane feature image by an anchor point generation algorithm, and the steps of generating a lane anchor point image include:
[0023] Set several anchor points evenly on the feature map and use cross-refinement blocks to refine the anchor points;
[0024] The refined anchor points are convolved and fully connected through the convolution layer, and aggregated to obtain aggregated anchor points;
[0025] Adjust the size of the feature map and flatten the feature map to obtain the transformed feature map;
[0026] Align the aggregate anchor points with the transformed feature map to obtain the attention matrix M, where: ,in is the representation of the anchor point, Represents the global feature map information; obtains the aggregation matrix of the refined feature map at the anchor point through a weighted process , .
[0027] The cross network lane line detection method based on weight fusion, wherein the step of performing positive sample allocation on the lane anchor point image to obtain the detected lane includes:
[0028] The anchors are ranked by the cost function and a selection of the top k predictions is performed for each target;
[0029] Calculate the sum of the linear intersection and union ratios of k predictions and round them up to get the number of samples of the target's positive prediction;
[0030] Use the cost function to designate the number of predictions with the minimum cost as positive samples;
[0031] The relative contribution of each criterion is modified using a predetermined weight fusion factor to obtain an initial detection lane;
[0032] The training loss is applied to the initial detection lane to obtain the detection lane.
[0033] The cross network lane line detection method based on weight fusion, wherein the cost function is: ;
[0034] in, , is the focal distance, which represents the distance between the expected trajectory and the actual path at their respective focal positions; the similarity cost Representation and three standards , and Similar related costs; variables represents the average pixel distance separating valid lane points, represents the distance between the initial points, represents the quantized horizontal angle difference, and Represents the predetermined weight fusion factor.
[0035] The cross network lane line detection method based on weight fusion, wherein the step of performing training loss on the initial detected lane to obtain the detected lane, further comprises:
[0036] Perform true value regression on the initial detected lanes;
[0037] The detection results of each layer are output through the cost function, and the detection results are input into the loss function optimization model to obtain the overall detection lane; the loss function of the loss function optimization model is: , where Lcls represents the classification loss, Lxy corresponds to the regression loss of the starting position, angle and length, and LLIoU.
[0038] A second aspect of an embodiment of the present application provides a computer-readable storage medium, which stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps in any of the weight fusion-based cross-network lane line detection methods described above.
[0039] A third aspect of the embodiments of the present application provides a cross network lane line detection device based on weight fusion, which includes:
[0040] An acquisition module is used to acquire a lane image, split the lane image into several frame images and input them into a proportional feature pyramid network in sequence;
[0041] A feature extraction module is used to extract semantic features of the frame image through the feature extraction network ResNet in the proportional feature pyramid network to obtain a feature map;
[0042] The weight fusion module is used to perform weight fusion on the feature map through the weight fusion algorithm to obtain the lane feature image;
[0043] The detection generation module is used to input the lane feature image into the intersection refinement network, mark potential lane line anchor points on the lane feature image through the anchor point generation algorithm, and generate a lane anchor point image; wherein the input end of the intersection refinement network is connected to the output end of the scale feature pyramid network;
[0044] The output module is used to assign positive samples to the lane anchor point images to obtain the detected lanes.
[0045] A fourth aspect of the embodiments of the present application provides a terminal device, comprising: a processor, a memory, and a communication bus; the memory stores a computer-readable program that can be executed by the processor;
[0046] The communication bus realizes the connection and communication between the processor and the memory;
[0047] When the processor executes the computer-readable program, the steps in any of the above-described cross-network lane line detection methods based on weight fusion are implemented.
[0048] Beneficial effects: Compared with the prior art, the present invention provides a method and device for detecting lane lines in a cross network based on weight fusion, wherein the method comprises: obtaining a lane image, splitting the lane image into a plurality of frame images and sequentially inputting them into a proportional feature pyramid network; extracting semantic features from the frame image through a feature extraction network in the proportional feature pyramid network to obtain a feature map; weight fusion of the feature map through a weight fusion algorithm to obtain a lane feature image; inputting the lane feature image into a cross refinement network, marking potential lane line anchor points on the lane feature image through an anchor point generation algorithm, and generating a lane anchor point image; performing positive sample allocation on the lane anchor point image to obtain a detected lane. By using the weight proportional coefficient, the model can dynamically adjust the degree of attention to different feature layers, thereby better adapting to the needs of different detection scenarios. By introducing a feature layer weight algorithm with adjustable parameters, the model can be personalized according to different data sets, thereby improving the accuracy and generalization performance of lane line detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 A flow chart of a cross network lane line detection method based on weight fusion provided by the present invention;
[0050] Figure 2 The experimental results of different hyperparameter α values in the cross-network lane detection method based on weight fusion provided by the present invention;
[0051] Figure 3 The experimental results of training loss in a cross-network lane detection method based on weight fusion provided by the present invention;
[0052] Figure 4 Visualization experimental results of a cross-network lane detection method based on weight fusion provided by the present invention;
[0053] Figure 5A partial workflow diagram of a proportional feature pyramid network in a cross-network lane detection method based on weight fusion provided by the present invention;
[0054] Figure 6 A partial workflow diagram of a cross network lane line detection method based on weight fusion provided by the present invention;
[0055] Figure 7 A schematic diagram of the structure of a cross network lane line detection device based on weight fusion provided by the present invention;
[0056] Figure 8 This is a structural principle diagram of the terminal device provided by the present invention. DETAILED DESCRIPTION
[0057] The present invention provides a method and device for detecting lane lines in a cross network based on weight fusion. In order to make the purpose, technical solution and effect of the present invention clearer and more specific, the present invention is further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0058] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present invention refers to the presence of features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. It should be understood that when the present application scheme states that an element is "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may also be an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.
[0059] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as generally understood by those skilled in the art in the art to which the present invention belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with the meanings in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as herein.
[0060] The invention is further described below by describing embodiments in conjunction with the accompanying drawings.
[0061] First of all, it should be noted that lane detection is one of the most important technologies in autonomous driving and driver assistance systems. It uses sensors (such as cameras, lidar, etc.) to identify lane lines on the road and provide relevant information to the vehicle control system.
[0062] In an autonomous driving system, lane line detection can help the vehicle understand the lane position and direction of the vehicle in real time, so as to perform autonomous navigation and path planning. By detecting the lane, the vehicle can determine whether it has deviated from the lane and take corresponding measures to stay in the correct lane, improving driving safety and accuracy.
[0063] However, most current lane detection models focus on deepening the depth of feature extraction networks, while neglecting the attention paid to feature maps at different levels. The model has different learning capabilities for feature maps at different levels under different detection conditions. For example, lane lines may present different characteristics under different locations, lighting conditions, and weather conditions. As a result, existing methods still face challenges in dealing with diverse driving environments and road conditions.
[0064] To this end, this solution provides a cross network lane line detection method and device based on weight fusion. Among them, the execution subject of the cross network lane line detection method based on weight fusion can be a lane line detection system deployed inside or outside the car, and a cross network lane line detection model based on weight fusion is set inside it. Among them, the lane line detection module is used to detect the lane in front of the car's driving route. It can be understood that the execution subject of this embodiment can also be an intelligent terminal connected to the lane line detection module, such as an on-board computer or a server host. For example, the on-board computer obtains the lane image, splits the lane image into several frame images and inputs them into the proportional feature pyramid network in sequence; the feature extraction network in the proportional feature pyramid network performs semantic feature extraction on the frame image to obtain a feature map; the feature map is weighted fused by the weight fusion algorithm to obtain a lane feature image; the lane feature image is input into the cross thinning network, and the potential lane line anchor points are marked on the lane feature image by the anchor point generation algorithm, and a lane anchor point image is generated; wherein the input end of the cross thinning network is connected to the output end of the proportional feature pyramid network; the lane anchor point image is assigned a positive sample to obtain a detected lane.
[0065] Among them, the lane line detection device is an important component used in autonomous driving or assisted driving systems, which is used to identify and track lane line information on the road. It can be achieved through image processing and computer vision technology. The working principle of the lane line detection device generally includes the following steps:
[0066] Perception: Using cameras or sensors to acquire images or videos of the vehicle’s surroundings.
[0067] Preprocessing: Preprocess the acquired images, such as image denoising, color space conversion, contrast enhancement, etc.
[0068] Feature extraction: Based on image processing technology, features that may contain lane lines are extracted, such as edge detection, color segmentation, etc.
[0069] Lane detection: Apply machine learning or computer vision algorithms to perform lane detection and segmentation on the extracted features to distinguish lanes from other objects.
[0070] Tracking and updating: For consecutive image frames, a tracking algorithm is used to track the position of the lane lines and update the lane line model based on the new information.
[0071] Output and display: The detected lane line information is output to the autonomous driving system or driver assistance display device to help the vehicle stay in the correct lane.
[0072] The performance and accuracy of lane detection devices are crucial to ensure safe driving of vehicles. Therefore, designing and implementing an efficient and accurate lane detection device requires full consideration of factors such as various road conditions, ambient lighting changes, and different vehicle driving conditions. However, lanes may present different characteristics in different locations, lighting conditions, and weather conditions, so the model needs to have strong adaptability and generalization performance. However, existing lane detection models usually tend to increase the depth of the network, while ignoring the fact that the model's learning ability for different feature layers may be different in different data sets and detection scenarios.
[0073] It should be noted that the above application scenarios are only shown to facilitate understanding of the present invention, and the embodiments of the present invention are not limited in this respect. On the contrary, the embodiments of the present invention can be applied to any applicable scenarios.
[0074] In order to further illustrate the content of the invention, the following is a detailed description of the embodiments in conjunction with the accompanying drawings. Specifically, the execution process of the lane line detection task based on the anchor point includes the following key steps:
[0075] Feature extraction: First, features are extracted from the input image to highlight road markings, lane lines, and information about the surrounding environment. This may involve image processing techniques such as edge detection, color filtering, and filtering to improve the visibility of lane lines.
[0076] Anchor point generation: Based on the extracted features, an anchor point generation algorithm is used to identify potential lane anchor points in the image. Anchor points are candidate points with specific geometric properties, usually located at prominent locations on the lane line, such as corners or intersections. This stage aims to reduce the complexity of the data and speed up subsequent processing steps.
[0077] Lane determination: After the anchor points are generated, relevant algorithms and models are used to determine which anchor points actually represent lane lines, and these anchor points are further merged to form complete lane lines. This step usually involves machine learning or deep learning methods, such as neural networks, to determine the geometric properties of lane lines, such as shape, direction, and curvature.
[0078] Output: The final output is a set of lane anchor point coordinates, usually expressed in pixel coordinates or world coordinates. These anchor points provide lane geometry information that can be used in navigation, autonomous driving, and vehicle assistance systems.
[0079] Anchor-based lane detection is a key computer vision task that helps vehicles locate and navigate on the road and improve driving safety. The complexity of the anchor-based lane detection task lies in accurately identifying and describing lane lines to ensure stable and reliable driving of vehicles in complex road environments.
[0080] The cross network lane line detection method based on weight fusion provided in this embodiment is as follows: Figure 1 As shown, the method includes:
[0081] Step S10, obtain the lane image, split the lane image into several frames and input them into the proportional feature pyramid network (P-FPN) in sequence; wherein the cross-network lane line detection model based on weight fusion includes the proportional feature pyramid network (P-FPN) and the cross-refinement network. In the proportional feature pyramid network (P-FPN), the traditional feature extraction network ResNet is used to extract semantic features. The model uses the last three layers of Resnet as the original input feature map. Then, according to the relative proportion of each feature, the high-level semantic features and the low-level semantic features are weighted fused. Therefore, the model of this scheme can pay more attention to the feature layer with more contextual information.
[0082] Step S20, extracting semantic features of the frame image through the feature extraction network ResNet in the proportional feature pyramid network (P-FPN) to obtain a feature map;
[0083] Specifically, in the Proportional Feature Pyramid Network (P-FPN), the traditional feature extraction network ResNet (He et al., 2016) is used to extract semantic features. The model of this scheme uses the last three layers of Resnet as the original input feature map. Then, according to the relative proportion of each feature, the high-level semantic features and the low-level semantic features are weighted and fused.
[0084] Step S30, performing weight fusion on the feature map through a weight fusion algorithm to obtain a lane feature image;
[0085] Step S40: input the lane feature image into the intersection thinning network, mark potential lane line anchor points on the lane feature image through an anchor point generation algorithm, and generate a lane anchor point image; wherein the input end of the intersection thinning network is connected to the output end of the proportional feature pyramid network;
[0086] Step S50: performing positive sample allocation on the lane anchor point image to obtain a detected lane.
[0087] Furthermore, the weight fusion mechanism between adjacent feature layers in the proportional feature pyramid network (P-FPN) is as follows:
[0088] ,
[0089] in represents a 1×1 convolution operation, Perform 2× upsampling on high-level feature maps, Represents the weight fusion factor between adjacent feature layers, represents the i-th level feature map, Represents the i-th level fused feature map in the proportional feature pyramid network (P-FPN). (Ref. Figure 5 )
[0090] Specifically, in the lane detection method based on the traditional Feature Pyramid Network (FPN), the performance is mainly affected by two factors: the downsampling factor and the weight fusion mechanism adopted between adjacent layers. Previous studies have concluded that lower downsampling factors lead to better performance, although the computational cost is huge. The weight fusion mechanism between adjacent feature layers in the traditional Feature Pyramid Network (FPN) is shown in Formula 3.1.
[0091] (3.1),
[0092] in represents a 1×1 convolution operation, which is used to ensure the consistency of the 134 channel dimension. Perform 2× upsampling on higher-level feature maps in order to align the resolutions of adjacent feature maps, Represents the weight fusion factor between adjacent feature layers, represents the i-th level feature map, Represents the i-th level fusion feature map in the P-FPN network. The purpose of P-FPN is to combine the appropriate weight fusion factors Added to the feature fusion process, such as Figure 6 shown.
[0093] in It is the scaling factor calculated by the proposed feature scaling algorithm. The scaling factor is multiplied by the high-level feature map after upsampling, and then fused with the low-level original feature map to generate a new fused feature map. The feature map weighted by the scaling factor will make the subsequent detection model pay more attention to the learning of a fused feature map with more knowledge, thereby enhancing the performance of the model.
[0094] Furthermore, the step of performing weight fusion on the feature map through a weight fusion algorithm to obtain a lane feature image includes:
[0095] Step S31, using the initial feature pyramid network (FPN) training model, where the weight fusion factor is 1, and recording the LIoULoss values of all feature layers;
[0096] Step S32: Calculate the weights of each layer in the proportional feature pyramid network (P-FPN), where represents Euler's number, a constant representing the basis of natural logarithms, represents the line intersection on the joint loss, α is a hyperparameter;
[0097] Step S33: Calculate the weight fusion factor between adjacent layers, where is the weight ratio of layer i and i-1, represents the weight of the i-th layer;
[0098] Step S34: Save the weight fusion factor and the index of the input image.
[0099] Specifically, in order to further explore how to obtain effective weight fusion factors ,Through the weight fusion algorithm, the weights assigned to different feature layers of each data are optimized to improve the ,accuracy of lane detection.,At different levels of the P-FPN network, the data distribution on the ,feature map is different.
[0100] The weight fusion algorithm is used to train the different weight features of each data point. The algorithm is as follows:
[0101] (1) Use the initial FPN training model with a weight fusion factor of 1. Record the LIoULoss values of all feature layers;
[0102] (2) The weight of each layer in the P-FPN network is calculated by Equation 3.2;
[0103] (3) Use formula 3.3 to calculate the weight fusion factor between adjacent layers;
[0104] (4) (4) Save the weight fusion factor and the index of the input image.
[0105] (3.2),
[0106] in represents the Euler number, which is a constant representing the basis of natural logarithms, represents the line intersection on the joint loss (Zheng et al., 2022), α is a hyperparameter that can be set to 0.1 to 0.9, and its optimal value for different datasets is selected through experiments, which will be elaborated in the following experimental section. The calculation method of the weight fusion factor is shown in Equation 3.3.
[0107] (3.3),
[0108] in is the weight ratio of layer i and i-1, Represents the weight of the i-th layer. i can be set to 3 or 2.
[0109] Furthermore, the lane feature image is input into the intersection refinement network, potential lane line anchor points are marked on the lane feature image by an anchor point generation algorithm, and the steps of generating a lane anchor point image include: (reference Figure 6 )
[0110] Step S41, evenly set a number of anchor points on the feature map, and use a cross-refinement block to refine the anchor points;
[0111] Step S42: performing convolution and full connection operations on the refined anchor points through the convolution layer, and aggregating them to obtain aggregated anchor points;
[0112] Step S43, adjusting the size of the feature map and flattening the feature map to obtain a converted feature map;
[0113] Step S44: align the aggregate anchor point with the transformed feature map to obtain the attention matrix M, where: ,in is the representation of the anchor point, Represents the global feature map information; obtains the aggregation matrix of the refined feature map at the anchor point through a weighted process , .
[0114] Specifically, n anchors are evenly set on the feature map, and then the anchors are refined using a cross refinement block, which takes the P-FPN fused feature maps and anchors as input. The anchors are refined using ROIAlign to obtain more precise features. The refined anchor features are aggregated through convolutional layers. Feature maps have different dimensions and sizes, so the feature maps are resized and flattened to adjust their size and dimensions, and the anchors are fine-grained by ROIAlign. After the convolution and fully connected operations are applied to align the size and shape with the converted feature maps. The anchors initially map the feature map to obtain the attention matrix M. Among them, ROIAlign is a computer vision algorithm for object detection and instance segmentation, which is used to extract features through the region of interest (ROI) in the image. It is a key technology used in popular object detection frameworks such as Faster R-CNN and Mask R-CNN.
[0115] As shown in formula 3.4.
[0116] (3.4),
[0117] in is the representation of the anchor point, Represents the global feature map information, and obtains the aggregation matrix of the refined feature map at the anchor point through a weighted process , as shown in formula 3.5.
[0118] (3.5),
[0119] Finally, add the output to the anchor middle.
[0120] Furthermore, the lane anchor point image is assigned positive samples to obtain the steps of detecting lanes, including:
[0121] Step S51, sorting the anchor points by the cost function, and performing the selection of the top k predictions for each target;
[0122] Step S52, calculating the sum of the linear intersection over union (LIoU) values of k predictions, and rounding it off to obtain the number of samples (kpos) of the target positive prediction;
[0123] Step S53, using the cost function to designate the number of samples (kpos) with the minimum cost as positive samples;
[0124] Step S54: modify the relative contribution of each standard using a predetermined weight fusion factor to obtain an initial detection lane;
[0125] Step S55: Perform training loss on the initial detection lane to obtain the detection lane.
[0126] Specifically, during training, the selection of the top k predictions is performed for each target by ranking all anchors using the following cost function. The sum of the LIoU values of the k predictions is calculated and rounded to produce a positive prediction of the target, called kpos. The kpos predictions with the smallest cost are then designated as positive samples using the cost function. The cost function is expressed by Equation 3.6, Equation 3.7
[0127] (3.6),
[0128] (3.7),
[0129] in Represents the focal distance, which is the distance between the expected trajectory and the actual path at their respective focal positions. Similarity cost Representation and three standards , and Similar related costs. represents the average pixel distance separating valid lane points, represents the distance between the initial points, Represents the quantized horizontal angle difference. The value has been adjusted to be in the range of [0, 1]. In addition, a predetermined weight fusion factor is used and to modify the relative contribution of each criterion.
[0130] Furthermore, the cost function is: ;
[0131] in, , is the focal distance, which represents the distance between the expected trajectory and the actual path at their respective focal positions; the similarity cost Representation and three standards , and Similar related costs; variables represents the average pixel distance separating valid lane points, represents the distance between the initial points, represents the quantized horizontal angle difference, and Represents the predetermined weight fusion factor.
[0132] Furthermore, the step of performing training loss on the initial detection lane to obtain the detection lane also includes:
[0133] Step S551, performing true value regression on the initial detected lane;
[0134] Step S552: Output the detection results of each layer through the cost function, and input the detection results into the loss function optimization model to obtain the overall detection lane; the loss function of the loss function optimization model is: , where Lcls represents the classification loss, Lxy corresponds to the regression loss of the starting position, angle and length, and LLIoU.
[0135] Specifically, as mentioned above, lanes can be represented as discrete points that need to be regressed with true values. Distance loss is usually used to regress these points, which will lead to inaccurate regression. Refer to Zheng et al. (Line Intersection over Union loss, LIoU), which is the ratio of the intersection to the union between two line segments, as shown in Equation 3.7.
[0136] (3.7),
[0137] The calculation of LIoU is shown in formula 3.8.
[0138] (3.8),
[0139] Where dθi represents the intersection of the predicted and labeled lines, and dui represents the union of the predicted and labeled lines. In the context of optimizing non-overlapping line segments, the value of dθi may be negative, so the value of LIoU is in the range of (-1, 1).
[0140] Three types of loss functions are used in this application to jointly supervise the training process. Lcls represents the classification loss, Lxy corresponds to the regression loss of the starting position, angle and length, and LLIoU, as proposed by Zheng et al., to regress the lane line as a whole. The overall loss function is shown in Equation 3.9.
[0141] (3.9),
[0142] During the training process, the detection results of each layer are output through the cost function and input into the loss function optimization model. During the testing process, the model only outputs the detection results of the last layer in the testing process.
[0143] In addition, in order to more intuitively and effectively prove the advantages of the solution of the present invention, experiments are conducted to verify it.
[0144] Experimental setup
[0145] 1. Dataset
[0146] (1) CULane
[0147] The CULane dataset is a well-known and widely used lane detection dataset, which was originally proposed in SCNN (Pan et al., 2018). A total of 133,235 frames were extracted from more than 55 hours of video. The dataset contains nine challenging categories, namely normal, crowded, highlighted, shadow, no line, arrow, curve, cross, and night. The dataset consists of 88,800 samples for training, 9,675 for validation, and 34,680 for testing. The test data contains eight different categories. All images have 1640×590 pixels. If the predicted point is within 30 pixels of the ground truth, the point is considered to be the correct point. If the number of correctly predicted points for a lane is greater than 50%, the predicted lane is considered to be a true positive (TP).
[0148] (2) TuSimple
[0149] TuSimple dataset is one of the widely used datasets in lane detection, which includes multiple traffic scenes. This dataset contains 3268 images of highway scenes for training, 2782 for testing, and 358 for validation. All images have 1280×720 pixels. In this dataset, lanes are considered as 20-pixel width lines. If the predicted point is on the 20-pixel width line, the point is considered to be the correct point. If the number of correctly predicted points for a lane is greater than 85%, the lane prediction is considered to be a true positive (TP).
[0150] The details of the CULane and TuSimple datasets are shown in Table 3.1. The proportion of challenge classes in the CULane test set is shown in Table 3.2.
[0151] Table 3.1 CULane and TuSimple dataset statistics
[0152] ,
[0153] Table 3.2 Proportion of challenging scenarios in the CULane test set
[0154] ,
[0155] 2. Experimental Setup
[0156] The model of this application scheme is implemented based on PyTorch 1.8 and CUDA 11.2 on Ubuntu 20.04 and RTX3080 GPU to run all experiments. All input images are normalized to 320×800 pixels. To enhance the data, this application scheme uses random affine transformation (Polson and Scott, 2011) and random horizontal flipping. The number of anchors is set to 72. The distribution cost is defined as Wcls = 1 and Wsim = 3.
[0157] The proposed scheme trained the model for 30 epochs for the CULane dataset and 70 epochs for the TuSimple dataset. During the optimization process, the proposed scheme used the AdamW (Loshchilov and Hutter, 2019) optimizer with an initial learning rate of 1e-3. The learning rate was decayed by a cosine annealing learning rate strategy with a decay factor of 0.9 (Loshchilov and Hutter, 2017).
[0158] 3. Evaluation indicators
[0159] The evaluation indicators of the Tusimple dataset include accuracy and F1 score. The F1 score is used as the evaluation statistic for the CULane dataset. Accuracy is defined as the ratio of the number of correctly predicted instances to the total number of samples. This can be expressed by a formula, as shown in Equation 3.10.
[0160] (3.10),
[0161] The F1 score is a value representing the harmonic mean, which is considered to be a reliable indicator combining precision and recall. The F1 score is the harmonic mean of accuracy and recall. It provides a balance between precision and recall and is particularly suitable when there is an imbalance in the distribution of class labels. The formula for calculating the F1 score is shown in Equation 3.11.
[0162] (3.11),
[0163] The recall rate is defined as the ratio of the correctly classified values to the total number of values in the data set. The formula is shown in Equation 3.12.
[0164] (3.12),
[0165] Precision is given as the ratio of the correct predictions to the total number of predictions. The formula is shown in Equation 3.13.
[0166] (3.13),
[0167] In the experiments of this application, both accuracy and F1 score are used for the Tusimple dataset. F1 score is used as the evaluation metric for the CULane dataset.
[0168] 4. Experimental results and analysis
[0169] 4.1 Comparative Experiments and Analysis
[0170] The present application scheme conducted a comprehensive comparative experiment with existing lane detection methods on two lane detection datasets: TuSimple dataset and CULane dataset.
[0171] TuSimple Dataset
[0172] The performance comparison on the TuSimple dataset with the current popular methods is shown in Table 3.3. As can be seen from the table, their results are very good among all the compared methods, and the performance difference on this dataset is very small, indicating that the results of this dataset seem to have been saturated. However, the method of the present application scheme still performs best among all the compared methods, especially on the Resnet18 backbone, with a 98.01% F1 score and a 96.91% accuracy. This improvement shows that the lane detection method of the present application scheme is effective. In addition, it can be seen from Table 3.3 that on the Resnet101 backbone, the method of the present application scheme obtains the highest False Negative (FN) ratio of 3.09%, which shows that the model of the present application scheme successfully reduces the learning of erroneous samples and can more accurately determine the wrong lane lines during the detection process. Comprehensive comparative experiments show that the method of the present application scheme outperforms the previous state-of-the-art methods in the TuSimple dataset.
[0173] Table 3.3 Experimental results of TuSimple dataset
[0174] ,
[0175] CULane Dataset
[0176] Comparative experiments between the method of the present application and other popular lane detection methods were conducted on three different backbone networks on the CULane dataset. As shown in Table 3.4, using the Resnet18 backbone, the method proposed in the present application achieved the highest detection accuracy with an F1 score of 79.86% and in the most challenging detection scenario, and the method of the present application was also significantly better than other methods. At the same time, the method of the present application can achieve a detection speed of 157 FPS, which is a competitive detection speed and is effective for real-time lane detection.
[0177] Table 3.4 Experimental results of Resnet18 backbone network of CULane dataset
[0178] ,
[0179] When using the Resnet34 backbone, the comparative experimental results are shown in Table 3.5. As can be seen from the table, the method proposed in this application has the highest F1 score of 79.94% and a detection speed of 126 FPS, indicating that the method of this application has better performance. In addition, in the most challenging detection scenario, the method of this application surpasses other popular methods in the Resnet34 backbone network.
[0180] Table 3.5 Experimental results of Resnet34 backbone network of CULane dataset
[0181] ,
[0182] When using a deeper feature extraction network Resnet101, the comparison results are shown in Table 3.6. As can be seen from this table, the method proposed in the present application scheme obtains the highest F1 score of 80.31% and the fastest detection speed of 67. In addition, in all 9 challenging scenes of the CUlane dataset, the method of the present application scheme achieved the best performance, which shows that when using a deep feature extraction network, the method of the present application scheme is easier to reduce the confusion caused by challenging noise than the existing methods.
[0183] Table 3.6 Experimental results of Resnet101 backbone network on CULane dataset
[0184] ,
[0185] In summary, comparative experiments were conducted on different backbone networks for lane detection on the CULane dataset. By analyzing the experimental results of Resnet18, Resnet34, and Resnet101 backbone networks, the method of the present application scheme achieved the highest F1 score and achieved a competitive detection speed compared with other popular lane line detection methods. Comprehensive analysis shows that the method proposed in the present application scheme performs better than the most advanced lane detection method, which proves the effectiveness and robustness of the lane detection method proposed in the present application scheme.
[0186] 4.2 Ablation Experiment Results and Analysis
[0187] (1) Hyperparameter α value analysis
[0188] The weight calculation formula based on the hyperparameter α is shown in Equation 3.2. A higher α value imposes a greater penalty on model misdetection, making the model more suitable for learning complex samples. However, a lower α value imposes a smaller penalty on false positives, making the model easier to learn simple data. The α value is different for different data sets. Figure 2 As shown in (a), the present application scheme experiments on the validation set of the CULane dataset. It can be seen that when the α value is 0.8, the F1 score reaches a peak. On the TuSimple dataset, the present application scheme randomly divides 20% of the training set into the validation set. Figure 2 As shown in (b), it can be seen from the experimental results when the α value is 0.2 that the F1 score reaches a peak. Therefore, in the following experiments, the present application scheme sets the α value of 0.8 for the CULane dataset and 0.2 for the TuSimple dataset.
[0189] (2) Ablation experiment of weight fusion mechanism
[0190] A series of ablation experiments were conducted to test the effectiveness of the P-FPN network proposed in this application. In these experiments, three settings were considered, layers P3 → P2, P2 → P1 and P3 → P2 → P1, and were refined, and comparative experiments were designed between the method proposed in this application (P-FPN) and the baseline method (CLRNet). The experimental results are shown in Table 3.7. As the application can see from the results, the detection performance of the method (P-FPN) of the application scheme exceeds the baseline method in all three settings, which proves the effectiveness of the weight fusion mechanism of the application scheme. In addition, the improvement of P3 to P2 is adopted to P1 (P3 → P2 → P1) is much better than other settings, which verifies that the final weight fusion mechanism of the application scheme can better utilize low-level and high-level features.
[0191] Table 3.7 Ablation experiment results of weight fusion mechanism
[0192] ,
[0193] (3) Training loss analysis
[0194] A comparative experiment of training loss was conducted between the method proposed in this application and the CLRNet method, because the two methods have similar backbone networks. Therefore, the CLRNet method was selected as the baseline method for comparative experiments. During the training process, the loss curve between the method proposed in this application and the baseline method is shown in Figure 2. Figure 3As shown in the figure, it can be seen that the training loss of the solution of the present application is lower than the baseline method on the CULane and TuSimple datasets, and it can be concluded that the improvement strategy of the solution of the present application is effective.
[0195] 4.3. Dataset Example Visualization Results Analysis
[0196] We selected samples of severe weather conditions (such as street lights at night, strong light reflection, and no street lights at night) and good weather conditions, and used RESA (Zheng et al., 2021), LaneAtt (Tabelini et al., 2021a), CondLane (Liu et al., 2021a), CLRNet (Zheng et al., 2022), and the method of the present application on the CULane test set as follows: Figure 4 As shown in Figure 1, under night detection conditions with street lights in the first row, it can be observed that the RESA method exhibits uneven lane detection, while the other methods show superior detection results. Figure 4 As can be seen from the second line, the RESA method still has the problem of detection distortion, and the LaneAtt method cannot detect the left lane line. However, the method of this application scheme has achieved good detection performance. Figure 4 As shown in the third row, it can be observed that the method of the present application accurately detects and locates the rightmost lane line, while the other four methods fail to detect it. Figure 4 In the last row, the proposed method can be seen in good weather conditions. In this case, all five methods successfully detected four lane lines, however, the proposed method still showed more robustness and accuracy. From the visual analysis, it can be seen that the proposed method performs better regardless of extremely challenging weather or good weather conditions.
[0197] In summary, this embodiment provides a cross network lane line detection method based on weight fusion. It includes: obtaining a lane image, splitting the lane image into several frame images and inputting them into the proportional feature pyramid network in sequence; extracting semantic features from the frame image through the feature extraction network in the proportional feature pyramid network to obtain a feature map; weight fusion of the feature map through the weight fusion algorithm to obtain a lane feature image; inputting the lane feature image into the cross refinement network, marking potential lane line anchor points on the lane feature image through the anchor point generation algorithm, and generating a lane anchor point image; performing positive sample allocation on the lane anchor point image to obtain the detected lane. By using the weight proportional coefficient, the model can dynamically adjust the degree of attention to different feature layers, so as to better adapt to the needs of different detection scenarios. By introducing a feature layer weight algorithm with adjustable parameters, the model can be personalized according to different data sets, thereby improving the accuracy and generalization performance of lane line detection.
[0198] In order to better implement the above method, the embodiment of the present application also provides a cross network lane line detection device 100 based on weight fusion, which can be integrated in an electronic device, and the electronic device can be a terminal, a server, a personal computer and other devices. For example, in this embodiment, the device may include: 101 acquisition module, 102 feature extraction module, 103 weight fusion module, 104 detection generation module and 105 output module, which are as follows (such as Figure 7 ):
[0199] 101 acquisition module, used for acquiring lane images, splitting the lane images into several frame images and sequentially inputting them into a proportional feature pyramid network (P-FPN);
[0200] 102 feature extraction module, used for extracting semantic features of the frame image through a feature extraction network ResNet in a proportional feature pyramid network (P-FPN) to obtain a feature map;
[0201] 103 weight fusion module, used for weight fusion of feature maps through weight fusion algorithm to obtain lane feature image;
[0202] 104 detection generation module, used for inputting the lane feature image into the intersection refinement network, marking potential lane line anchor points on the lane feature image through an anchor point generation algorithm, and generating a lane anchor point image; wherein the input end of the intersection refinement network is connected to the output end of the scale feature pyramid network;
[0203] 105 output module, used for assigning positive samples to the lane anchor point image to obtain the detected lane.
[0204] In some embodiments, a cross network lane line detection device 100 based on weight fusion includes 101 acquisition module, 102 feature extraction module, 103 weight fusion module, 104 detection generation module and 105 output module, wherein 101 acquisition module acquires lane image, splits the lane image into several frame images and sequentially inputs them into proportional feature pyramid network (P-FPN); 102 feature extraction module extracts semantic features of frame image through feature extraction network ResNet in proportional feature pyramid network (P-FPN) to obtain feature map; 103 weight fusion module performs weight fusion on feature map through weight fusion algorithm to obtain lane feature image; 104 detection generation module inputs lane feature image into cross refinement network, marks potential lane line anchor points on lane feature image through anchor point generation algorithm, and generates lane anchor point image; wherein, the input end of cross refinement network is connected with the output end of proportional feature pyramid network; 105 output module performs positive sample allocation on lane anchor point image to obtain detected lane.
[0205] In specific implementation, the above units can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above units can refer to the previous method embodiments, which will not be repeated here.
[0206] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0207] Based on the above-mentioned cross-network lane line detection method based on weight fusion, this embodiment provides a computer-readable storage medium, which stores one or more programs, and one or more programs can be executed by one or more processors to implement the steps in the cross-network lane line detection method based on weight fusion as in the above-mentioned embodiment. For example, execute the method steps S10 to S50, method steps S31 to S34, method steps S41 to S44, method steps S51 to S55, and method steps S551 to S552 described above. The specific steps are as follows:
[0208] Obtain the lane image, split the lane image into several frames and input them into the proportional feature pyramid network (P-FPN) in sequence;
[0209] The feature extraction network ResNet in the proportional feature pyramid network (P-FPN) is used to extract semantic features from the frame image to obtain a feature map;
[0210] The feature map is weighted fused by the weight fusion algorithm to obtain the lane feature image;
[0211] The lane feature image is input into the intersection refinement network, potential lane line anchor points are marked on the lane feature image through the anchor point generation algorithm, and a lane anchor point image is generated; wherein the input end of the intersection refinement network is connected to the output end of the scale feature pyramid network;
[0212] Assign positive samples to the lane anchor point images to obtain the detected lanes.
[0213] In some embodiments, the step of performing weight fusion on the feature map by a weight fusion algorithm to obtain a lane feature image includes:
[0214] The initial feature pyramid network (FPN) training model is used, where the weight fusion factor is 1 and the LIoULoss values of all feature layers are recorded;
[0215] pass Calculate the weights of each layer in the proportional feature pyramid network (P-FPN), where represents Euler's number, a constant representing the basis of natural logarithms, represents the line intersection on the joint loss, α is a hyperparameter;
[0216] pass Calculate the weight fusion factor between adjacent layers, where is the weight ratio of layer i and i-1, represents the weight of the i-th layer;
[0217] Save the weight fusion factors and the index of the input image.
[0218] In some embodiments, the steps of inputting the lane feature image into the intersection thinning network, marking potential lane line anchor points on the lane feature image by an anchor point generation algorithm, and generating a lane anchor point image include:
[0219] Set several anchor points evenly on the feature map and use cross-refinement blocks to refine the anchor points;
[0220] The refined anchor points are convolved and fully connected through the convolution layer, and aggregated to obtain aggregated anchor points;
[0221] Adjust the size of the feature map and flatten the feature map to obtain the transformed feature map;
[0222] Align the aggregate anchor points with the transformed feature map to obtain the attention matrix M, where: ,in is the representation of the anchor point, Represents the global feature map information; obtains the aggregation matrix of the refined feature map at the anchor point through a weighted process , .
[0223] In some embodiments, the step of performing positive sample allocation on the lane anchor point image to obtain the detected lane includes:
[0224] The anchors are ranked by the cost function and a selection of the top k predictions is performed for each target;
[0225] Calculate the sum of the linear intersection over union (LIoU) of the k predictions and round it to get the number of samples (kpos) of positive predictions of the target;
[0226] Use the cost function to designate the number of samples (kpos) with the minimum cost as positive samples;
[0227] The relative contribution of each criterion is modified using a predetermined weight fusion factor to obtain an initial detection lane;
[0228] The training loss is applied to the initial detection lane to obtain the detection lane.
[0229] In some embodiments, the step of performing training loss on the initial detected lane to obtain the detected lane further includes:
[0230] Perform true value regression on the initial detected lanes;
[0231] The detection results of each layer are output through the cost function, and the detection results are input into the loss function optimization model to obtain the overall detection lane; the loss function of the loss function optimization model is: , where Lcls represents the classification loss, Lxy corresponds to the regression loss of the starting position, angle and length, and LLIoU.
[0232] Based on the above-mentioned cross network lane line detection method based on weight fusion, the present invention also provides a terminal device, such as Figure 8 As shown, it includes at least one processor 20; a display screen 21; and a memory 22, and may also include a communications interface 23 and a bus 24. The processor 20, the display screen 21, the memory 22, and the communications interface 23 may communicate with each other through the bus 24. The display screen 21 is configured to display a preset user guide interface in the initial setting mode. The communications interface 23 may transmit information. The processor 20 may call the logic instructions in the memory 22 to execute the method in the above embodiment.
[0233] In addition, the logic instructions in the memory 22 can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product.
[0234] The memory 22 is a computer-readable storage medium that can be configured to store software programs, computer executable programs, such as program instructions or modules corresponding to the methods in the embodiments of the present disclosure. The processor 20 executes functional applications and data processing by running the software programs, instructions or modules stored in the memory 22, that is, implementing the methods in the above embodiments.
[0235] The memory 22 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal device, etc. In addition, the memory 22 may include a high-speed random access memory and may also include a non-volatile memory. For example, a variety of media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, may also be a transient storage medium.
[0236] In addition, the specific process of loading and executing the plurality of instructions in the storage medium and the processor in the mobile terminal has been described in detail in the method above, and will not be described one by one here.
[0237] In summary, compared with the prior art, the present invention has the following beneficial effects: a method and device for detecting lane lines in a cross network based on weight fusion, the present invention uses weight proportional coefficients to enable the model to dynamically adjust the degree of attention to different feature layers, so as to better adapt to the needs of different detection scenarios. By introducing a feature layer weight algorithm with adjustable parameters, the model can be personalized according to different data sets, thereby improving the accuracy and generalization performance of lane line detection.
[0238] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A cross network lane line detection method based on weight fusion, characterized in that: The method comprises: Acquire a lane image, split the lane image into a plurality of frame images and sequentially input the frame images into a scale feature pyramid network; Extracting semantic features from the frame image through a feature extraction network in the scale feature pyramid network to obtain a feature map; Performing weight fusion on the feature map through a weight fusion algorithm to obtain a lane feature image; Inputting the lane feature image into a cross thinning network, marking potential lane line anchor points on the lane feature image through an anchor point generation algorithm, and generating a lane anchor point image; wherein the input end of the cross thinning network is connected to the output end of the scale feature pyramid network; Performing positive sample allocation on the lane anchor point image to obtain a detected lane; The step of weighting and fusing the feature map by a weight fusion algorithm to obtain a lane feature image includes: using an initial feature pyramid network training model, wherein the weight fusion factor is 1, and recording the LIoULoss values of all feature layers; Calculate the weight of each layer in the scale feature pyramid network, where represents Euler's number, a constant representing the basis of natural logarithms, represents the line intersection on the joint loss, α is a hyperparameter; Calculate the weight fusion factor between adjacent layers, where is the weight ratio of layer i and i-1, Represents the weight of the i-th layer; saves the weight fusion factor and the index of the input image.
2. The cross network lane line detection method based on weight fusion according to claim 1 is characterized in that: The weight fusion mechanism between adjacent feature layers in the proportional feature pyramid network is as follows: , in represents a 1×1 convolution operation, Perform 2× upsampling on high-level feature maps, Represents the weight fusion factor between adjacent feature layers, represents the i-th level feature map, Represents the i-th level fused feature map in the scale feature pyramid network.
3. The cross network lane line detection method based on weight fusion according to claim 1 is characterized in that: The step of inputting the lane feature image into a cross thinning network, marking potential lane line anchor points on the lane feature image by an anchor point generation algorithm, and generating a lane anchor point image comprises: Evenly setting a number of anchor points on the lane feature image, and using a cross refinement block to refine the anchor points; The refined anchor points are convolved and fully connected through a convolution layer, and aggregated to obtain aggregated anchor points; Adjusting the size of the lane feature image and flattening the lane feature image to obtain a transformed feature map; Align the aggregate anchor point with the transformed feature map to obtain the attention matrix M, where: ,in is the representation of the aggregation anchor point, Represents the global feature map information of the converted feature map; the aggregation matrix of the global feature map is obtained by paying attention to the matrix M and the global feature map information of the converted feature map , .
4. The cross network lane line detection method based on weight fusion according to claim 3 is characterized in that: The step of performing positive sample allocation on the lane anchor point image to obtain a detected lane includes: Sorting the anchors by a cost function, performing a selection of the top k predictions for each target; Calculate the sum of the linear intersection and union ratios of k predictions and round them up to get the number of samples of the target's positive prediction; Use the cost function to designate the number of predictions with the minimum cost as positive samples; The relative contribution of each criterion is modified using a predetermined weight fusion factor to obtain an initial detection lane; A training loss is performed on the initial detection lane to obtain a detection lane.
5. The cross network lane line detection method based on weight fusion according to claim 4 is characterized in that: The cost function is: ; in, , is the focal distance, which represents the distance between the expected trajectory and the actual path at their respective focal positions; the similarity cost Representation and three standards , and Similar related costs; variables represents the average pixel distance separating valid lane points, represents the distance between the initial points, Represents the quantized horizontal angle difference, and Represents the predetermined weight fusion factor.
6. The cross network lane line detection method based on weight fusion according to claim 5 is characterized in that: The step of performing training loss on the initial detection lane to obtain the detection lane also includes: Performing true value regression on the initial detected lane; The detection results of each layer are output through the cost function, and the detection results are input into the loss function optimization model to obtain the overall detection lane; the loss function of the loss function optimization model is: , where Lcls represents the classification loss, and Lxy corresponds to the regression loss of the starting position, angle and length, and the regression loss of LLIoU.
7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps in a cross-network lane line detection method based on weight fusion as described in any one of claims 1 to 6.
8. A cross network lane line detection device based on weight fusion, characterized in that: include: An acquisition module, used for acquiring a lane image, splitting the lane image into a plurality of frame images and sequentially inputting the frame images into a proportional feature pyramid network; A feature extraction module, used for extracting semantic features from the frame image through the feature extraction network in the scale feature pyramid network to obtain a feature map; A weight fusion module, used for performing weight fusion on the feature map through a weight fusion algorithm to obtain a lane feature image; The initial feature pyramid network training model is adopted, in which the weight fusion factor is 1 and the LIoULoss values of all feature layers are recorded; Calculate the weight of each layer in the scale feature pyramid network, where represents Euler's number, a constant representing the basis of natural logarithms, represents the line intersection on the joint loss, α is a hyperparameter; Calculate the weight fusion factor between adjacent layers, where is the weight ratio of layer i and i-1, Represents the weight of the i-th layer; saves the weight fusion factor and the index of the input image; A detection generation module, used for inputting the lane feature image into a cross thinning network, marking potential lane line anchor points on the lane feature image by an anchor point generation algorithm, and generating a lane anchor point image; wherein the input end of the cross thinning network is connected to the output end of the scale feature pyramid network; The output module is used to assign positive samples to the lane anchor point image to obtain a detected lane.
9. A terminal device, characterized in that: include: Processor, memory and communication bus; The memory stores a computer-readable program executable by the processor; The communication bus realizes the connection and communication between the processor and the memory; When the processor executes the computer-readable program, the steps in the cross-network lane line detection method based on weight fusion as described in any one of claims 1-6 are implemented.
