Lane number detection method, and lane number detection model training method and device
By constructing a parallel lane number detection model, the accuracy problem of lane number detection in complex scenarios is solved, achieving high-accuracy detection and self-evaluation end-to-end, and improving the robustness and reliability of lane number detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING CHANGDIWANFANG TECH CO LTD
- Filing Date
- 2025-12-04
- Publication Date
- 2026-05-01
AI Technical Summary
Existing lane number detection methods have significant errors in identifying lane lines or lane areas when there are complex road divisions and unclear lane lines, resulting in inaccurate lane number detection.
A lane number detection model is constructed, which includes an encoder, a decoder, a lane number detection branch, and a detection quality confidence detection branch. Image features are processed in parallel to obtain the lane number and detection quality confidence scores. The model parameters are optimized to improve detection accuracy.
It achieves end-to-end lane number detection, avoids errors in intermediate steps, and improves the accuracy and robustness of detection. Especially in complex scenarios, it can self-assess the reliability of detection results and provide a basis for credibility.
Smart Images

Figure CN121963116A_ABST
Abstract
Description
Lane number detection method, lane number detection model training method and device Technical Field
[0001] This disclosure relates to the field of artificial intelligence technology, specifically to the field of image processing technology, and in particular to a method for detecting the number of lanes, a method and apparatus for training a lane number detection model, an electronic device, a computer-readable storage medium, and a computer program product. Background Technology
[0002] In both autonomous driving and map update scenarios, detecting the number of lanes a vehicle is in is a crucial step. The number of lanes refers to the total number of lanes on the road the vehicle is on. In autonomous driving, the detected lane count determines the vehicle's current lane and other available lanes, aiding in the decision-making process for lane changes. In map update scenarios, the detected lane count is compared to the lane count displayed on the map. If a discrepancy exists, an update to the map's lane count is triggered, automatically updating the map and improving update efficiency.
[0003] Current lane number detection methods are not accurate enough. For example, one method requires first identifying lane lines or lane regions within a road image, and then calculating the lane number based on these identifications. This type of method is easily affected by the results of lane line and lane region identification. In cases of complex road divisions or when lane lines in the road image are unclear, the identified lane lines or lane regions may contain significant errors, leading to incorrect lane number detections and insufficient accuracy. Summary of the Invention
[0004] This disclosure provides a method for detecting the number of lanes, a method and apparatus for training a lane number detection model, an electronic device, a computer-readable storage medium, and a computer program product.
[0005] According to a first aspect, a lane number detection method is provided, the method comprising: acquiring a road image to be processed; acquiring a lane number detection model, the lane number detection model including an encoder, a decoder, and a lane number detection branch and a detection quality confidence detection branch set in parallel; inputting the road image to be processed into the lane number detection model, processing the road image to be processed by the encoder to obtain image features, processing the image features by the decoder to obtain lane number features and detection quality confidence features, processing the lane number features by the lane number detection branch to obtain a lane number detection result, and simultaneously processing the detection quality confidence features by the detection quality confidence detection branch to obtain a detection quality confidence score corresponding to the lane number detection result, the lane number detection result including the number of lanes included in the image to be processed, and the detection quality confidence score being used to measure the confidence of the lane number detection result under the image quality of the road image to be processed.
[0006] According to the second aspect, a method for training a lane number detection model is provided, comprising the following steps: Step 1. Constructing a lane number detection model, the lane number detection model including an encoder, a decoder, and a parallel lane number detection branch and a detection quality confidence detection branch; Step 2. Inputting a training image into the lane number detection model, processing the training image through the encoder to obtain image features, processing the image features through the decoder to obtain lane number features and detection quality confidence features, processing the lane number features through the lane number detection branch to obtain a lane number detection result, and simultaneously processing the detection quality confidence features through the detection quality confidence detection branch to obtain a detection quality confidence score corresponding to the lane number detection result, the detection quality confidence score being used to measure the confidence of the lane number detection result given the image quality of the training image; Step 3. Adjusting the model parameters of the lane number detection model based on the lane number detection result, the detection quality confidence score, and the label corresponding to the training image, the label including a lane number label and a detection quality confidence score label; Step 4. Repeat steps 2-3 until the model training converges, resulting in the optimized lane number detection model.
[0007] According to a third aspect, a lane number detection device is provided, the device comprising: a first acquisition unit for acquiring a road image to be processed; a second acquisition unit for acquiring a lane number detection model, the lane number detection model including an encoder, a decoder, and parallel lane number detection branches and detection quality confidence detection branches; and a detection unit for inputting the road image to be processed into the lane number detection model, processing the road image to be processed by the encoder to obtain image features, processing the image features by the decoder to obtain lane number features and detection quality confidence features, processing the lane number features by the lane number detection branches to obtain a lane number detection result, and simultaneously processing the detection quality confidence features by the detection quality confidence detection branches to obtain a detection quality confidence score corresponding to the lane number detection result, the lane number detection result including the number of lanes included in the image to be processed, and the detection quality confidence score being used to measure the confidence of the lane number detection result under the image quality of the road image to be processed.
[0008] According to a fourth aspect, a lane number detection model training device is provided. The device includes: a construction unit for constructing a lane number detection model, the lane number detection model including an encoder, a decoder, and a parallel lane number detection branch and a detection quality confidence detection branch; and a training unit for repeatedly executing the following steps until the model training converges to obtain an optimized lane number detection model: inputting a training image into the lane number detection model; processing the training image through the encoder to obtain image features; processing the image features through the decoder to obtain lane number features and detection quality confidence features; processing the lane number features through the lane number detection branch to obtain a lane number detection result; and simultaneously processing the detection quality confidence features through the detection quality confidence detection branch to obtain a detection quality confidence score corresponding to the lane number detection result, the detection quality confidence score being used to measure the confidence of the lane number detection result given the image quality of the training image; and adjusting the model parameters of the lane number detection model based on the lane number detection result, the detection quality confidence score, and the label corresponding to the training image, the label including a lane number label and a detection quality confidence score label.
[0009] According to a fifth aspect, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor, wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform a method as described in any implementation of the first aspect, or to perform a method as described in any implementation of the second aspect.
[0010] According to a sixth aspect, a non-transitory computer-readable storage medium is provided that stores computer instructions for causing a computer to perform a method as described in any implementation of the first aspect, or to perform a method as described in any implementation of the second aspect.
[0011] According to a seventh aspect, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the method described in any implementation of the first aspect, or implements the method described in any implementation of the second aspect.
[0012] The lane number detection method and lane number detection model training method disclosed herein construct and train a lane number detection model including an encoder, a decoder, and parallel lane number detection branches and detection quality confidence detection branches. The lane number detection model, including the parallel lane number detection branches and detection quality confidence detection branches, is then used for model inference to obtain lane number detection results and detection quality confidence scores.
[0013] The learning objective of the lane number detection model includes the lane number detection task, which aligns with the final lane number prediction objective. The trained lane number detection model can achieve end-to-end lane number detection, avoiding error propagation from intermediate steps, eliminating the influence of intermediate steps on lane number prediction, and improving the accuracy of the detected lane numbers. A detection quality confidence detection branch, running parallel to the lane number detection branch, can independently determine the detection quality confidence score, reflecting the reliability of the model's self-evaluation of the lane number detection results based on image quality. The detection quality confidence score can be used during training to optimize model parameters by combining lane number detection results and labels, further improving the richness and accuracy of the features extracted by the lane number detection model. The detection quality confidence score can also assist downstream systems processing lane numbers in evaluating the reliability of lane number prediction, providing a basis and explanation for subsequent lane number-based decisions.
[0014] It should be understood that the description in this section is not intended to represent key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0015] The accompanying drawings are provided for a better understanding of this solution and do not constitute a limitation of this disclosure. Specifically: Figure 1 illustrates an application scenario of the lane number detection model training method and the lane number detection method provided in this disclosure; Figure 2 is a flowchart of a lane number detection model training method provided in this disclosure; Figure 3 is a schematic diagram of the training process of a lane number detection model to be trained provided in this disclosure; Figure 4 is a schematic diagram of the module structure of a decoder module provided in this disclosure; Figure 5 is a schematic diagram of sample road images provided in this disclosure; Figures 6a-6c are schematic diagrams of sample road images corresponding to three detection quality confidence score labels provided in this disclosure; Figure 7 is a flowchart of another lane number detection model training method provided in this disclosure. Figure 8 is a schematic diagram of the training process of another lane number detection model to be trained provided in an embodiment of this disclosure; Figure 9 is a schematic diagram of the module structure of another decoder module provided in an embodiment of this disclosure; Figure 10 is a flowchart of a lane number detection method provided in an embodiment of this disclosure; Figure 11 is a schematic diagram of the inference process of a lane number detection model provided in an embodiment of this disclosure; Figure 12 is a schematic diagram of the inference process of another lane number detection model provided in an embodiment of this disclosure; Figure 13 is a schematic diagram of the structure of a lane number detection device provided in an embodiment of this disclosure; Figure 14 is a schematic diagram of the structure of a lane number detection model training device provided in an embodiment of this disclosure; Figure 15 is a block diagram of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0016] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0017] Lanes are designated driving areas on roads to facilitate traffic management. Lanes can be divided into various types, such as motor vehicle lanes, non-motor vehicle lanes, and emergency lanes, to distinguish different types of vehicles or different driving situations.
[0018] The number of lanes defined by a road is the total number of lanes within the road's boundaries. The number of lanes plays a crucial role in autonomous driving and map update scenarios. Currently, the number of lanes is derived from lane lines or lane regions.
[0019] In the method for determining the number of lanes based on lane lines, the road image is semantically segmented to detect the lane lines and their types included in the road image. Then, based on the prior relationship between lane lines and the number of lanes, the number of lanes of the road is derived.
[0020] In methods for determining the number of lanes based on lane regions, firstly, instance segmentation techniques are used to label and separate different lane regions, and then the number of lanes is determined according to the category and quantity of lane regions. A lane region is the area where a lane is located, including, for example, motor vehicle lane regions and non-motor vehicle lane regions.
[0021] Both of the aforementioned methods for detecting the number of lanes involve an intermediate step: first, lane lines or lane areas are identified, and then the number of lanes is deduced based on these lines or areas. The accuracy of the lane number detection is affected by this intermediate step. In certain scenarios, such as when road markings in road images are unclear, worn, or dirty, the identified lane lines are prone to errors, leading to inaccurate lane number detection. Similarly, in road images corresponding to scenarios with complex road markings, such as intersections and ramp merging / dividing points, the identified lane areas may be incorrect, resulting in incorrect lane number detection.
[0022] To address the aforementioned technical issues, this disclosure proposes a lane quantity detection model training method and a lane quantity detection method.
[0023] It is understood that the lane number detection model training method and lane number detection method proposed in this disclosure can be integrated into various computing devices, including but not limited to terminal devices with image processing capabilities (such as smartphones, tablets, personal computers, etc.) and servers (such as application servers, web servers, whether single servers or clustered server systems). This method does not depend on a specific hardware platform or software architecture. During the execution of the lane number detection model training method and lane number detection method, whether running independently on a terminal device or in a terminal-server architecture working collaboratively via a network, the method of this disclosure can be effectively utilized. When executed independently on a terminal device, this method does not rely on an external network. In scenarios requiring higher processing performance or broader data resource support, the method of this invention also supports communication between the terminal device and the server, utilizing the server's powerful computing capabilities and abundant data resources to jointly complete the method. This method can adapt to different operating systems and platform environments, including mobile operating systems such as iOS, Android, and HarmonyOS; desktop operating systems such as Windows and macOS; and server operating systems such as Linux and Unix.
[0024] For ease of understanding, Figure 1 illustrates the application scenarios of the lane number detection model training method and the lane number detection method as shown in the embodiments of this disclosure.
[0025] During the training of the lane number detection model, a lane number detection model is first constructed, which includes an encoder, a decoder, and a lane number detection branch and a detection quality confidence detection branch set in parallel.
[0026] The following steps are repeated on the lane number detection model until the model training converges, resulting in an optimized lane number detection model: Training images are input into the lane number detection model. Specifically, the encoder processes the training images to obtain image features. The decoder processes the image features to obtain lane number features and detection quality confidence features. The lane number detection branch processes the lane number features to obtain the lane number detection result, and the detection quality confidence detection branch processes the detection quality confidence features to obtain the detection quality confidence score corresponding to the lane number detection result. The detection quality confidence score measures the confidence of the lane number detection result given the image quality of the training images. Based on the lane number detection result, the detection quality confidence score, and the lane number labels and detection quality confidence score labels corresponding to the training images, the model parameters of the lane number detection model are adjusted.
[0027] The trained lane number detection model can be used to detect the number of lanes. First, acquire the road image to be processed and obtain the lane number detection model. The lane number detection model includes an encoder, a decoder, and parallel settings for lane number detection branches and detection quality confidence detection branches.
[0028] The road image to be processed is input into the lane number detection model. Specifically, the road image is processed by an encoder to obtain image features. The image features are then processed by a decoder to obtain lane number features and detection quality confidence features. The lane number detection branch processes the lane number features to obtain the lane number detection result, and the detection quality confidence detection branch processes the detection quality confidence features to obtain a detection quality confidence score corresponding to the lane number detection result. The lane number detection result includes the number of lanes included in the image to be processed. The detection quality confidence score is used to measure the confidence of the lane number detection result given the image quality of the road image to be processed.
[0029] The various embodiments disclosed herein are not isolated entities, but rather complementary. The solutions involved in each embodiment are intended to exemplify the overall solution from a specific aspect or dimension. The content of each embodiment in this disclosure can be integrated with other embodiments to constitute one of the many feasible solutions disclosed herein. This design makes this disclosure an organic whole, providing comprehensive and systematic technical support for achieving the inventive objectives, meeting the needs of different application scenarios, and ensuring the integrity and effectiveness of the technical solutions of this disclosure in multiple dimensions and levels.
[0030] The training method for the lane quantity detection model provided in the embodiments of this disclosure is described below.
[0031] Referring to Figure 2, which is a flowchart of a lane number detection model training method provided in an embodiment of this disclosure, the method includes S201-S204: S201: Constructing a lane number detection model that includes an encoder, a decoder, and a lane number detection branch and a detection quality confidence detection branch set in parallel.
[0032] The lane quantity detection model is an artificial intelligence model that needs to be trained. The lane quantity detection model consists of multiple modules.
[0033] In one possible implementation, this disclosure provides a model structure for a lane quantity detection model. Referring to Figure 3, Figure 3 is a schematic diagram of the training process for this lane quantity detection model.
[0034] The lane quantity detection model includes an encoder, a decoder, a lane quantity detection branch, and a detection quality confidence detection branch. The lane quantity detection branch and the detection quality confidence detection branch are configured in parallel.
[0035] The encoder extracts features from the input image. As an example, the encoder employs a High Performance GPU Network (PPHG-Net) based on a convolutional neural network. The encoder includes multi-scale feature extraction layers. For example, the multi-scale feature extraction layers consist of three layers with different scales: a large-scale feature extraction layer, a medium-scale feature extraction layer, and a small-scale feature extraction layer. The large-scale feature layer captures the global lane topology, extracting global features of the image. The medium-scale feature extraction layer extracts lane region boundary features. The small-scale feature extraction layer extracts local texture features, such as features of blurred markings and features of locally occluded areas. The different features extracted by the multi-scale feature extraction layers are concatenated and fused to obtain the image features. The image features extracted and concatenated based on the multi-scale feature extraction layers can include both global and local features. The image features extracted by the encoder contain relatively rich information, which helps to determine a more accurate number of lanes based on the image features.
[0036] The decoder generates lane number features and detection quality confidence features based on the features of the input image. Lane number features contain information related to the number of lanes. Detection quality confidence features contain information related to the confidence level of the input lane number detection model's image.
[0037] The decoder can employ a deformable attention-based transformer network. The decoder uses a collaborative attention mechanism. The deformable attention transformer network includes deformable cross-attention layers and deformable self-attention layers. The attention mechanism allows the lane number detection model to focus on lane-related features. The deformable cross-attention layer dynamically aggregates features from the multi-scale images output by the encoder, improving spatial feature alignment through adaptive sampling of keypoints. The deformable self-attention layer establishes inter-task dependencies, enhancing the discriminative power of task-specific features.
[0038] The module structure of the decoder is shown in Figure 4. The query vector used by the decoder is related to the learning task of the lane number detection model. For the lane number detection model corresponding to Figure 3, the query vector includes a query vector for the number of lanes and a query vector for the detection quality confidence.
[0039] The lane number detection branch is used to generate lane number detection results based on the input lane number features. The lane number detection branch can consist of linear layers.
[0040] The detection quality confidence branch generates a detection quality confidence score based on the input detection quality confidence features. The detection quality confidence score measures the confidence level of the lane number detection result corresponding to the quality of the image input to the lane number detection model. The detection quality confidence branch can consist of linear layers.
[0041] S202: Input the training image into the lane number detection model, process the training image through the encoder to obtain image features, process the image features through the decoder to obtain lane number features and detection quality confidence features, process the lane number features through the lane number detection branch to obtain lane number detection results, and process the detection quality confidence features through the detection quality confidence detection branch to obtain the detection quality confidence score corresponding to the lane number detection results.
[0042] The training images are images that include the lanes of the road. As an example, the training images are images of the front of a vehicle captured by a vehicle camera. See Figure 5, which is a schematic diagram of the training images.
[0043] In one possible implementation, the training images can be generated based on raw road images. The raw road images are unprocessed and include lane markings. Image enhancement is performed on the raw road images to obtain the training images. Image enhancement includes operations such as cropping the upper 20% region of the image, random region occlusion, and resizing.
[0044] Image enhancement using the original road images, and training the lane detection model with the obtained training images, can improve the lane detection model's attention to lane regions and its robustness to image occlusion and image scale changes. This further enhances the multi-scene adaptive capability of the trained lane number detection model and makes it more robust to road images with changes in lighting, partial occlusion, and blurred markings.
[0045] The training image is input into the lane number detection model shown in Figure 3. Through the encoder, decoder, lane number detection branch and detection quality confidence detection branch, the lane number detection result and the detection quality confidence score are obtained.
[0046] Specifically, the training image is input into the encoder to obtain the image features output by the encoder. These image features are then input into the decoder to obtain the lane number features and detection quality confidence features output by the decoder. The lane number features are input into the lane number detection branch to obtain the lane number detection result. Simultaneously, the detection quality confidence features are input into the detection quality confidence detection branch to obtain the detection quality confidence score. The detection quality confidence score corresponds to the lane number detection result. The detection quality confidence score measures the confidence level of the lane number detection result given the quality of the training image.
[0047] S203: Adjust the model parameters of the lane number detection model based on the lane number detection results, the detection quality confidence score, and the labels corresponding to the training images.
[0048] The training images have corresponding labels. These labels define the target values that the lane quantity detection model needs to learn, serving as a reference for supervised training. The labels include lane quantity labels and detection quality confidence score labels. The lane quantity labels indicate the number of lanes included in the training image. These labels can be pre-defined. It should be noted that the lane quantity can be the number of lanes in the direction of vehicle travel (i.e., the number of one-way lanes) or the number of two-way lanes on the road. The lane quantity can also include only motor vehicle lanes, or it can include motor vehicle lanes, non-motor vehicle lanes, and emergency lanes. This disclosure does not impose any limitations on this; the quantity can be flexibly set based on the needs of detecting the number of lanes.
[0049] The detection quality confidence score label is used to measure the confidence level of the lane number label corresponding to the training image. This disclosure does not limit the type of detection quality confidence score label. In one possible implementation, the detection quality confidence score label is a specific percentage value, such as 80%, 40%, etc. In another possible implementation, the detection quality confidence score label includes three levels of labels: high, medium, and low. Referring to Figure 6a, the training image corresponding to the high-level label has high image quality; the training image is relatively clear and sharp, and the number of lanes can be accurately determined. Referring to Figure 6b, the training image corresponding to the medium-level label contains objects obstructing the lanes; the number of lanes cannot be directly determined based on the training image, but it can be determined through other information. Referring to Figure 6c, the training image corresponding to the low-level label is of low quality and relatively blurry, and the number of lanes cannot be detected. It should be noted that setting three levels of detection quality confidence score labels is only an example; multiple levels can be flexibly set according to the confidence required to evaluate the number of lanes.
[0050] Using lane number detection results, detection quality confidence scores, lane number labels, and detection quality confidence score labels, a lane detection model is trained, and its model parameters are adjusted. In one possible implementation, the total loss value of the lane number detection model is determined based on the lane number detection results, detection quality confidence scores, and labels corresponding to the training images. The model parameters are then adjusted based on this total loss value.
[0051] The formula for calculating the total loss value of the lane number detection model is as follows: (1) (2) (3) Among them, , which is the sub-loss value of the lane number detection result. The probability of the category representing the number of lanes detected. It is an adjustment parameter for adjusting the weights of training images that are easy to classify. It can be set to 2. It is used to balance the weights of positive and negative samples. It can be set to 0.25.
[0052] , is the sub-loss value of the confidence score for detection quality. The probability of the category representing the detection quality confidence score predicted by the model. It is an adjustment parameter for adjusting the weights of training images that are easy to classify. It can be set to 2. It is used to balance the weights of positive and negative samples. It can be set to 0.25.
[0053] The sub-loss values for lane number detection results and detection quality confidence scores can be calculated using the Focal Loss function. The Focal Loss function effectively allows the lane number detection model to focus on learning from challenging training images, thus effectively mitigating the problem of lane number imbalance.
[0054] This represents the total loss value of the lane number detection model. It is a weighted sum of the sub-loss values of the lane quantity detection result and the sub-loss values of the detection quality confidence score. This is the weighted sum of the sub-loss values of the lane number detection results. This is a weighted average of the sub-loss values used to assess the quality confidence score. As an example, It is 1.2. It is 1.2.
[0055] S204: Repeat S202-S203 until the model training converges, and obtain the optimized lane number detection model.
[0056] Steps S202 and S203 constitute a model training process. The lane detection model is trained multiple times, repeating steps S202 and S203 until the model training converges. Model convergence can be determined based on the change in the total loss value obtained in each training iteration. The lane number detection model corresponding to the embodiment in Figure 2 has a learning objective that includes lane number detection, consistent with the final lane number prediction objective. The features learned by the model can serve the final lane number detection. The trained lane number detection model can achieve end-to-end lane number detection, avoiding error propagation from intermediate steps and eliminating the influence of intermediate steps on lane number. It can also directly determine the lane number based on the information learned by the lane number detection model, improving the accuracy of the detected lane number, especially in special scenarios such as intersections, ramp merging / diverging scenarios, and lane line occlusion, thus improving the accuracy of lane number detection.
[0057] By establishing a detection quality confidence detection branch parallel to the lane number detection branch, a training-driven mechanism linking confidence and accuracy can be constructed. This branch independently determines the detection quality confidence, reflecting the reliability of the model's self-evaluation of lane number detection results based on image quality. The detection quality confidence detection branch can also be used to optimize model parameters during training. Thus, by implementing multi-tasks for lane number detection and the detection quality confidence detection branch, the performance of determining the detection quality confidence related to image quality and lane number detection is optimized, ensuring a strong statistical correlation between the output detection quality confidence score and the accuracy of lane number detection. Jointly training multiple tasks improves the richness of features extracted by the lane number detection model and its ability to capture the inherent relationships within complex road structures.
[0058] Furthermore, the trained lane number detection model can output the number of lanes and a detection quality confidence score. The detection quality confidence score can also help downstream systems that process lane numbers to evaluate the reliability of the lane number, providing a basis and explanation for subsequent lane number-based decisions.
[0059] In one possible implementation, referring to Figure 7, this disclosure provides a flowchart of another lane number detection model training method, which includes S701-S704: S701: Constructing a lane number detection model that includes an encoder, a decoder, a lane number detection branch, a detection quality confidence detection branch, and a lane division object detection branch.
[0060] This disclosure provides a model structure for a lane quantity detection model. Referring to Figure 8, Figure 8 is a schematic diagram of the training process for another lane quantity detection model provided in this disclosure.
[0061] The encoder of the lane number detection model in Figure 8 can be the same as the encoder of the lane number detection model in Figure 3 above, and will not be described again here.
[0062] The decoder is used to generate lane number features, detection quality confidence features, and lane segmentation object features based on the features of the input image. For the lane number features and detection quality confidence features, please refer to the relevant descriptions in Figure 3 above, which will not be repeated here.
[0063] Lane division object features contain information related to lane division objects. Lane division objects are objects used to divide lanes on a road. Lane division objects can be identifiers or areas. For example, lane division objects can include one or more types of objects such as lane lines, lane indicator arrows, and guide zones. Correspondingly, the object features of lane division objects include one or more of the object features of lane lines, lane indicator arrows, and guide zones. Referring to Figure 9, taking a lane division object including lane lines, lane indicator arrows, and guide zones as an example, the decoder outputs the object features of the lane division object, including the object features of lane lines, lane indicator arrows, and guide zones.
[0064] The input decoder's query vector can include a query vector for the number of lanes, a query vector for the detection quality confidence score, and a query vector for lane segmentation objects. The types of query vectors included in the lane segmentation object query vector correspond one-to-one with the types of objects included in the lane segmentation object. For example, the lane segmentation object query vector may include one or more of the following: lane line query vector, lane indicator arrow query vector, and guide zone query vector.
[0065] Taking a lane division object that only includes lane lines as an example, the query vector of the lane division object includes the lane line query vector. Taking a lane division object that includes lane lines, lane indicator arrows, and guide zones as an example, as shown in Figure 9, the query vector of the lane division object includes the lane line query vector, the lane indicator arrow query vector, and the guide zone query vector.
[0066] The lane quantity detection branch and the detection quality confidence detection branch can be the same as the encoder of the lane quantity detection model in Figure 3 above, and will not be described again here.
[0067] The lane segmentation object detection branch outputs the detection results of lane segmentation objects based on the input lane segmentation object features. The lane segmentation object detection branch can consist of linear layers.
[0068] As an example, the lane segmentation object detection branch may include one or more of the following: a lane line detection branch, a lane indicator arrow detection branch, and a guide zone detection branch. Specifically, the lane line detection branch generates lane line detection results based on the object features of lane lines. The lane indicator arrow detection branch generates lane line detection results based on the object features of lane indicator arrows. The guide zone detection branch generates guide zone detection results based on the object features of guide zones.
[0069] S702: Input the training image into the lane number detection model, obtain image features through the encoder, process the image features through the decoder to obtain lane number features, detection quality confidence features and lane division object features, process the lane number features through the lane number detection branch to obtain the lane number detection result, process the detection quality confidence features through the detection quality confidence detection branch to obtain the detection quality confidence score corresponding to the lane number detection result, and process the lane division object features through the lane division object detection branch to obtain the lane division object detection result.
[0070] The training images are input into the lane number detection model shown in Figure 8. Through the encoder, decoder, lane number detection branch, detection quality confidence detection branch, and lane division object detection branch, the lane number detection results, detection quality confidence scores, and lane division object detection results are obtained respectively.
[0071] Specifically, the training image is input into the encoder to obtain the image features output by the encoder. These image features are then input into the decoder to obtain the lane number features, detection quality confidence features, and lane segmentation object features output by the decoder. The lane number features are input into the lane number detection branch to obtain the lane number detection result. Simultaneously, the detection quality confidence features are input into the detection quality confidence detection branch to obtain the detection quality confidence score. The detection quality confidence score corresponds to the lane number detection result. The detection quality confidence score measures the confidence level of the lane number detection result given the quality of the training image. Simultaneously, the lane segmentation object features are input into the lane segmentation object detection branch to obtain the lane segmentation object detection result.
[0072] S703: Adjust the model parameters of the lane number detection model based on the lane number detection results, the detection quality confidence score, the detection results of lane division objects, and the labels corresponding to the training images.
[0073] The labels include lane quantity labels, detection quality confidence score labels, and lane division object labels.
[0074] Lane division object labels are used to indicate the lane division objects included in the sample road image. The type of label included in the lane division object label corresponds one-to-one with the type of object included in the lane division object. As an example, if the lane division object only includes lane lines, the lane division object label includes a lane line label. As another example, if the lane division object includes lane lines, lane indicator arrows, and guide zones, the lane division object label includes a lane line label, a lane indicator arrow label, and a guide zone label.
[0075] Based on the lane number detection results, detection quality confidence score, lane division object detection results, lane number labels, detection quality confidence score labels, and lane division object labels, the model parameters of the lane number detection model are adjusted.
[0076] In one possible implementation, the total loss value of the lane number detection model is determined based on the lane number detection results, the detection quality confidence score, the detection results of lane segmentation objects, the lane number labels, the detection quality confidence score labels, and the lane segmentation object labels. The model parameters of the lane number detection model are then adjusted based on the total loss value.
[0077] The total loss value of the lane number detection model can be a weighted sum of the sub-loss values of the lane number detection results, the sub-loss value of the detection quality confidence score, and the sub-loss value of the object detection results.
[0078] First, let's introduce the sub-loss values of the object detection results. The types of results included in the object detection results correspond one-to-one with the types of objects included in the lane division objects.
[0079] For lane detection results, sub-loss values are calculated based on the lane detection results and lane labeling. The calculation method for the sub-loss values corresponding to the lane detection results is as follows: (4) Among them, This represents the instance-level matching loss value. The Hungarian algorithm is used to obtain the matching cost, and the loss function is to minimize the matching cost using cross-entropy loss. This represents the point-level matching loss value. The L2 loss function is used to minimize the distance between the points in the predicted lane line detection results and the points in the lane division object labels, including the lane line labels. These are the weighting coefficients. Set it to 0.8.
[0080] For the lane indicator arrow detection results, a sub-loss value is calculated based on the lane indicator arrow detection results and the lane indicator arrow labels. The sub-loss value corresponding to the lane indicator arrow detection results can be calculated using the IOU (Intersection over Union) loss function.
[0081] For the diversion zone detection results, a sub-loss value is calculated based on the diversion zone detection results and the diversion zone label. The sub-loss value corresponding to the diversion zone detection results can be calculated using a classification loss function.
[0082] Taking lane division objects including lane lines, lane indicator arrows, and guide zones as an example, the formula for calculating the total loss value of the lane quantity detection model is as follows: (5) Among them, This represents the total loss value of the lane number detection model.
[0083] , is the sub-loss value for predicting the number of lanes. The calculation formula is shown in formula (1) above.
[0084] , which is the sub-loss value for predicting confidence. The calculation formula is shown in formula (2) above. This is a weighted average of the sub-loss values used to predict confidence. As an example, It is 1.2.
[0085] This represents the sub-loss value corresponding to the lane line detection result. for The weighting coefficients.
[0086] This is the sub-loss value corresponding to the lane indicator arrow detection result. for The weighting coefficients.
[0087] This represents the sub-loss value corresponding to the detection result of the diversion zone. for The weighting coefficients.
[0088] When lane delineation includes lane lines, lane indicator arrows, and guide zones, lane lines are more helpful for lane quantity detection than lane indicator arrows or guide zones. The value is set to be greater than The values of and greater than The possible values of . As an example, The value is 0.8. The value is 0.5. The value is 0.5.
[0089] S704: Repeat S702-S703 until the model training converges, and obtain the optimized lane number detection model.
[0090] The lane detection model is trained multiple times, repeating steps S702 and S703 until the model training converges. Model convergence can be determined based on the change in the total loss value obtained in each training iteration.
[0091] The lane number detection model corresponding to the embodiment in Figure 7 adds an auxiliary task of lane division object detection, forming a multi-task framework. Through a multi-task collaborative optimization mechanism, the auxiliary task forms a virtuous cycle of "feature complementarity - constraint reinforcement" with the main tasks of lane number detection and determining the detection quality confidence score. The features extracted by the auxiliary task of lane division object detection help improve the robustness of lane number prediction in difficult scenarios. For example, lane line-related features can contain lane division-related information, lane indicator arrow-related features can contain intersection-related information, and merging / diverging area features can contain information related to ramp merging and diverging. All of this information is related to lane number. By adding auxiliary tasks, the lane number detection model to be trained can learn more information related to lane number detection, improve the ability of the trained lane number detection model to capture the inherent correlation of complex road structures, and further improve the model's accuracy and generalization ability in different scenarios.
[0092] The learning objective of the lane quantity detection model is not to pursue the highest accuracy output of the auxiliary task itself, but to use the strong geometric structure prior and rich local detail information provided by the auxiliary task to guide and constrain the shared encoding and decoding layers at the feature learning level. This enables the model to learn deeper feature representations that are more discriminative, robust, and highly correlated with lane geometry for the main task. This promotes the implicit integration of information that is crucial to lane structure and scene complexity, rather than relying on pre-set logical rules for derivation. This can solve the problem that a single task cannot fully explore lane-related features and improve the scene adaptability of the main task.
[0093] The above is an introduction to the lane number detection model training method provided in this disclosure. Based on the lane number detection model training method, a lane number detection model is trained. The following describes the process of using the lane number detection model to detect the number of lanes.
[0094] Referring to Figure 10, which is a flowchart of a lane number detection method provided in an embodiment of this disclosure, the method includes S1001-S1003: S1001: Acquire a road image to be processed.
[0095] The road image to be processed is a road image for which lane number detection is required. This disclosure does not limit the source of the road image to be processed. The road image to be processed can be an image of the front of a vehicle captured by a vehicle camera.
[0096] S1002: Obtain the lane number detection model, which includes the encoder, decoder, and parallel settings of the lane number detection branch and the detection quality confidence detection branch.
[0097] The lane number detection model can be trained using the method shown in Figure 2. The lane number detection model includes an encoder, a decoder, a lane number detection branch, and a detection quality confidence detection branch. The lane number detection branch and the detection quality confidence detection branch are set up in parallel.
[0098] The encoder extracts image features. The decoder processes these features, generating lane number features and detection quality confidence features. The lane number detection branch generates lane number detection results based on the lane number features. The detection quality confidence detection branch generates a detection quality confidence score based on the detection quality confidence features. The detection quality confidence score corresponds to the lane number detection results and measures the reliability of the lane number detection results given the quality of the image input to the model.
[0099] For details regarding the specific structures of the encoder, decoder, lane quantity detection branch, and detection quality confidence detection branch, please refer to the relevant descriptions in the embodiment corresponding to Figure 2 above, which will not be repeated here.
[0100] S1003: Input the road image to be processed into the lane number detection model. The encoder processes the road image to obtain image features. The decoder processes the image features to obtain lane number features and detection quality confidence features. The lane number detection branch processes the lane number features to obtain the lane number detection result. At the same time, the detection quality confidence detection branch processes the detection quality confidence features to obtain the detection quality confidence score corresponding to the lane number detection result.
[0101] The lane number detection model is invoked to process the image to be processed, and lane number detection results and detection quality confidence scores are generated.
[0102] Specifically, as shown in Figure 11, the image to be processed is input into the encoder to obtain the image features of the road image to be processed, which is output by the encoder. Then, the image features of the image to be processed are input into the decoder to obtain the lane number features and detection quality confidence features output by the decoder. The lane number features are input into the lane number detection branch to obtain the lane number detection result. The lane number detection result includes the number of lanes included in the image to be processed, such as two, four, or eight lanes. Simultaneously, the detection quality confidence feature is input into the detection quality confidence detection branch to obtain the detection quality confidence score corresponding to the lane number detection result. The detection quality confidence score is used to measure the confidence of the lane number detection result given the image quality of the road image to be processed. Based on the detection quality confidence score, the impact of the image quality of the image to be processed on the lane number detection result can be determined, clarifying the reliability and accuracy of the lane number detection result. The detection quality confidence score can also assist downstream systems processing lane numbers in evaluating the reliability of the lane number output by the lane number model, providing a basis and explanation for subsequent lane number-based decisions.
[0103] By utilizing a lane number detection model, the number of lanes can be obtained directly end-to-end, skipping intermediate steps and avoiding error propagation from them. This model can directly determine the number of lanes based on features extracted from the road image, improving the accuracy of lane number detection, especially in special scenarios such as intersections, ramp merging / diverging, and lane line occlusion.
[0104] In some other possible implementations, the obtained lane quantity detection model can be trained based on the lane quantity detection model training method in the embodiment corresponding to Figure 7. That is, during the training phase, the lane quantity detection model includes a lane division object detection branch. The lane division object detection branch is used to detect lane division objects. Lane division objects include one or more of lane lines, lane indicator arrows, and guide zones. During the training phase, based on the lane division object detection branch, the main tasks of detecting the number of lanes and the detection quality confidence score, as well as the auxiliary task of detecting lane division objects, can be achieved. The auxiliary task of detecting lane division objects can help the model focus on information related to lane division objects, thereby obtaining richer information related to lane division and improving the accuracy of lane quantity detection.
[0105] When using the lane quantity detection model for model inference, only the main task is considered, namely, the number of lanes and the detection quality confidence score. This allows the lane segmentation object detection branch to be removed during the inference phase. Correspondingly, as shown in Figure 12, the decoder processes image features to obtain lane quantity features, detection quality confidence features, and lane segmentation object features. The lane segmentation object features are used to optimize the lane quantity detection model during the model training phase. The processing flow of the encoder, decoder, lane quantity detection branch, and detection quality confidence detection branch included in the lane detection model in Figure 12 is the same as in the embodiment corresponding to Figure 11, as described above.
[0106] Removing the lane segmentation object detection branch can reduce the number of model parameters involved in inference calculations, reduce the amount of computation in inference, lower inference costs, and improve inference speed.
[0107] As shown in Figure 13, this embodiment provides a lane number detection device 1300, comprising: a first acquisition unit 1301 for acquiring a road image to be processed; a second acquisition unit 1302 for acquiring a lane number detection model, the lane number detection model including an encoder, a decoder, and parallel lane number detection branches and detection quality confidence detection branches; and a detection unit 1303 for inputting the road image to be processed into the lane number detection model, processing the road image to be processed by the encoder to obtain image features, processing the image features by the decoder to obtain lane number features and detection quality confidence features, processing the lane number features by the lane number detection branches to obtain lane number detection results, and simultaneously processing the detection quality confidence features by the detection quality confidence detection branches to obtain a detection quality confidence score corresponding to the lane number detection results. The lane number detection results include the number of lanes included in the image to be processed, and the detection quality confidence score is used to measure the confidence of the lane number detection results under the condition of the image quality of the road image to be processed.
[0108] In one possible implementation, the detection unit 1303 is used to process the image features through the decoder to obtain lane quantity features and detection quality confidence features, including: the detection unit 1303 is used to process the image features through the decoder to obtain lane quantity features, detection quality confidence features and lane division object features, wherein the lane division object features are used to describe information about lane division objects, the lane division objects are related to lane division, and the lane division object features are used to optimize the lane quantity detection model during the model training phase.
[0109] In one possible implementation, the lane division objects include one or more of lane lines, lane indicator arrows, and guide zones.
[0110] As shown in Figure 14, this embodiment provides a lane number detection model training device 1400. The device includes: a construction unit 1401, used to construct a lane number detection model, the lane number detection model including an encoder, a decoder, and parallel lane number detection branches and detection quality confidence detection branches; and a training unit 1402, used to repeatedly execute the following steps until the model training converges to obtain an optimized lane number detection model: inputting a training image into the lane number detection model, processing the training image through the encoder to obtain image features, and processing the image features through the decoder to obtain lane number features and detection quality confidence branches. The system measures the confidence of lane number detection. Lane number detection is achieved by processing the lane number feature through the lane number detection branch, and simultaneously, detection quality confidence feature is processed through the detection quality confidence branch to obtain a detection quality confidence score corresponding to the lane number detection result. This detection quality confidence score measures the confidence of the lane number detection result given the image quality of the training image. Based on the lane number detection result, the detection quality confidence score, and the labels corresponding to the training image, the model parameters of the lane number detection model are adjusted. The labels include lane number labels and detection quality confidence score labels.
[0111] In one possible implementation, the lane quantity detection model further includes a lane division object detection branch, which outputs the detection result of a lane division object. The lane division object is related to lane division. The lane division object detection branch is set in parallel with the lane quantity detection branch and the detection quality confidence detection branch. The training unit 1402 is used to execute step 2, including: the training unit 1402 inputs a training image into the lane quantity detection model, obtains image features through the encoder, processes the image features through the decoder to obtain lane quantity features, detection quality confidence features, and lane division object features, and outputs the detection result of the lane division object. The quantity detection branch processes the lane quantity feature to obtain the lane quantity detection result, and simultaneously processes the detection quality confidence feature through the detection quality confidence detection branch to obtain the detection quality confidence score corresponding to the lane quantity detection result. Simultaneously, the lane division object detection branch processes the lane division object feature to obtain the lane division object detection result. The training unit 1402 is used to execute step 3, including: the training unit 1402 is used to adjust the model parameters of the lane quantity detection model based on the lane quantity detection result, the detection quality confidence score, the lane division object detection result, and the label corresponding to the training image. The label also includes a lane division object label.
[0112] In one possible implementation, the lane division objects include one or more of lane lines, lane indicator arrows, and guide zones.
[0113] In one possible implementation, the training unit 1402, for performing step 2, further includes: the training unit 1402 is also used to acquire the original road image, perform image enhancement on the original road image, and obtain a training image.
[0114] In one possible implementation, the training unit 1402 is used to perform step 3, including: the training unit 1402 is used to determine the sub-loss value of the lane number detection result based on the lane number detection result and the lane number label; determine the sub-loss value of the detection quality confidence score based on the detection quality confidence score label; determine the weighted sum of the sub-loss values of the lane number detection result and the sub-loss values of the detection quality confidence score to obtain the total loss value of the lane number detection model; and adjust the model parameters of the lane number detection model based on the total loss value. In this embodiment, the specific processing of each unit in the lane number detection device 1300 and the lane number detection model training device 1400 and the resulting technical effects can be referred to the relevant descriptions of each step in the foregoing embodiments, and will not be repeated here.
[0115] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0116] Figure 15 illustrates a schematic block diagram of an example electronic device 1500 that can be used to implement embodiments of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0117] As shown in Figure 15, device 1500 includes a computing unit 1501, which can perform various appropriate actions and processes according to a computer program stored in read-only memory (ROM) 1502 or a computer program loaded into random access memory (RAM) 1503 from storage unit 1508. The RAM 1503 may also store various programs and data required for the operation of device 1500. The computing unit 1501, ROM 1502, and RAM 1503 are interconnected via bus 1504. Input / output (I / O) interface 1505 is also connected to bus 1504.
[0118] Multiple components in device 1500 are connected to I / O interface 1505, including: input unit 1506, such as keyboard, mouse, etc.; output unit 1507, such as various types of monitors, speakers, etc.; storage unit 1508, such as disk, optical disk, etc.; and communication unit 1509, such as network card, modem, wireless transceiver, etc. Communication unit 1509 allows device 1500 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0119] The computing unit 1501 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 1501 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 1501 performs the various methods and processes described above, such as a lane number detection model training method or a lane number detection method. For example, in some embodiments, the lane number detection model training method or the lane number detection method can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 1508. In some embodiments, part or all of the computer program can be loaded and / or installed on device 1500 via ROM 1502 and / or communication unit 1509. When the computer program is loaded into RAM 1503 and executed by the computing unit 1501, one or more steps of the lane number detection model training method or the lane number detection method described above can be performed. Alternatively, in other embodiments, the computing unit 1501 may be configured in any other suitable manner (e.g., by means of firmware) to perform a lane number detection model training method or a lane number detection method.
[0120] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0121] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable information processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0122] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0123] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0124] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an information server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0125] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.
[0126] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0127] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A method for detecting the number of lanes, characterized in that, The method includes: acquiring a road image to be processed; acquiring a lane number detection model, the lane number detection model including an encoder, a decoder, and parallel lane number detection branches and detection quality confidence detection branches; inputting the road image to be processed into the lane number detection model, processing the road image to be processed by the encoder to obtain image features, processing the image features by the decoder to obtain lane number features and detection quality confidence features, processing the lane number features by the lane number detection branches to obtain lane number detection results, and simultaneously processing the detection quality confidence features by the detection quality confidence detection branches to obtain a detection quality confidence score corresponding to the lane number detection results, the lane number detection results including the number of lanes included in the image to be processed, and the detection quality confidence score being used to measure the confidence of the lane number detection results under the image quality of the road image to be processed.
2. The method according to claim 1, characterized in that, The step of processing the image features through the decoder to obtain lane quantity features and detection quality confidence features includes: processing the image features through the decoder to obtain lane quantity features, detection quality confidence features, and lane division object features. The lane division object features are used to describe information about lane division objects, and the lane division objects are related to lane division. The lane division object features are used to optimize the lane quantity detection model during the model training phase.
3. The method according to claim 2, characterized in that, The lane division objects include one or more of lane lines, lane indicator arrows, and guide zones.
4. A method for training a lane quantity detection model, characterized in that, Includes the following steps: Step 1. Construct a lane number detection model, which includes an encoder, a decoder, and a parallel lane number detection branch and a detection quality confidence detection branch; Step 2. Input the training image into the lane number detection model. The encoder processes the training image to obtain image features, and the decoder processes the image features to obtain lane number features and detection quality confidence features. The lane number detection branch processes the lane number features to obtain the lane number detection result. At the same time, the detection quality confidence detection branch processes the detection quality confidence features to obtain a detection quality confidence score corresponding to the lane number detection result. The detection quality confidence score is used to measure the confidence of the lane number detection result given the image quality of the training image. Step 3. Adjust the model parameters of the lane number detection model based on the lane number detection results, the detection quality confidence score, and the labels corresponding to the training images. The labels include lane number labels and detection quality confidence score labels. Step 4. Repeat steps 2-3 until the model training converges to obtain the optimized lane number detection model.
5. The method according to claim 4, characterized in that, The lane quantity detection model further includes a lane division object detection branch, which outputs the detection results of lane division objects. The lane division objects are related to lane division. The lane division object detection branch is set in parallel with the lane quantity detection branch and the detection quality confidence detection branch. Step 2 includes: inputting a training image into the lane quantity detection model, obtaining image features through the encoder, processing the image features through the decoder to obtain lane quantity features, detection quality confidence features, and lane division object features, processing the lane quantity features through the lane quantity detection branch to obtain a lane quantity detection result, processing the detection quality confidence features through the detection quality confidence detection branch to obtain a detection quality confidence score corresponding to the lane quantity detection result, and processing the lane division object features through the lane division object detection branch to obtain a lane division object detection result. Step 3 includes: adjusting the model parameters of the lane quantity detection model based on the lane quantity detection result, the detection quality confidence score, the lane division object detection result, and the label corresponding to the training image. The label also includes a lane division object label.
6. The method according to claim 5, characterized in that, The lane division objects include one or more of lane lines, lane indicator arrows, and guide zones.
7. The method according to claim 4, characterized in that, Step 3 includes: determining sub-loss values of the lane number detection results based on the lane number detection results and lane number labels; determining sub-loss values of the detection quality confidence score based on the detection quality confidence score and detection quality confidence score labels; determining the weighted sum of the sub-loss values of the lane number detection results and the sub-loss values of the detection quality confidence score to obtain the total loss value of the lane number detection model; and adjusting the model parameters of the lane number detection model based on the total loss value.
8. The method according to claim 4, characterized in that, Step 2 further includes: acquiring the original road image, performing image enhancement on the original road image, and obtaining the training image.
9. A lane quantity detection device, characterized in that, The apparatus includes: a first acquisition unit for acquiring a road image to be processed; a second acquisition unit for acquiring a lane number detection model, the lane number detection model including an encoder, a decoder, and parallel lane number detection branches and detection quality confidence detection branches; and a detection unit for inputting the road image to be processed into the lane number detection model, processing the road image to be processed by the encoder to obtain image features, processing the image features by the decoder to obtain lane number features and detection quality confidence features, processing the lane number features by the lane number detection branches to obtain lane number detection results, and simultaneously processing the detection quality confidence features by the detection quality confidence detection branches to obtain a detection quality confidence score corresponding to the lane number detection results, the lane number detection results including the number of lanes included in the image to be processed, and the detection quality confidence score being used to measure the confidence of the lane number detection results under the image quality of the road image to be processed.
10. A lane quantity detection model training device, characterized in that, The apparatus includes: a construction unit for constructing a lane number detection model, the lane number detection model comprising an encoder, a decoder, and parallel lane number detection branches and detection quality confidence detection branches; and a training unit for repeatedly executing the following steps until model training converges to obtain an optimized lane number detection model: inputting a training image into the lane number detection model; processing the training image through the encoder to obtain image features; processing the image features through the decoder to obtain lane number features and detection quality confidence features; processing the lane number features through the lane number detection branches to obtain lane number detection results; and simultaneously processing the detection quality confidence features through the detection quality confidence detection branches to obtain a detection quality confidence score corresponding to the lane number detection results, the detection quality confidence score being used to measure the confidence of the lane number detection results given the image quality of the training image; and adjusting the model parameters of the lane number detection model based on the lane number detection results, the detection quality confidence score, and the labels corresponding to the training image, the labels including lane number labels and detection quality confidence score labels.
11. An electronic device, characterized in that, include: At least one processor; The at least one processor is also connected in communication with a memory, wherein the memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the lane number detection model training method of any one of claims 1-3, or to perform the lane number detection method of any one of claims 4-8.
12. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to execute the lane quantity detection model training method according to any one of claims 1-3, or to execute the lane quantity detection method according to any one of claims 4-8.
13. A computer program product, characterized in that, The method includes a computer program that, when executed by a processor, implements the lane quantity detection model training method according to any one of claims 1-3, or the lane quantity detection method according to any one of claims 4-8.