Lane line model training method and device, electronic equipment and storage medium
By introducing a loss function into the neural network model and using a sample set for training, the problem of low grouping accuracy in lane line recognition is solved, and effective separation and aggregation of lane lines are achieved, thereby improving recognition accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-09
- Publication Date
- 2026-03-10
AI Technical Summary
In existing technologies, neural network models tend to group data from the same lane line together with data from different lane lines when identifying lane lines, or fail to group data from the same lane line together, resulting in reduced lane line grouping accuracy.
By establishing a network model that includes a loss function, and training the network model using a sample set until the calculation result of the loss function is within the target threshold, the loss function includes a first function used to separate different lane lines and/or group the same lane lines, thereby improving the accuracy of lane line grouping.
It achieves effective separation of different lane lines and aggregation of the same lane line, improving the accuracy of lane line grouping.
Smart Images

Figure CN115937813B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of lane line recognition, and in particular to a lane line model training method and device, an electronic device, and a storage medium. BACKGROUND
[0002] In the field of autonomous driving, lane line recognition is usually involved.
[0003] In related technologies, a trained neural network model is used to recognize lane lines. In the neural network model, a loss function is needed, which is generally implemented by an error function. When the neural network model containing the loss function is used to recognize lane lines, the data on the same lane line is easily recognized together with the data on different lane lines, or the data on the same lane line is not recognized together, which reduces the grouping accuracy of lane lines. SUMMARY
[0004] To overcome the problems in related technologies, the present application provides a lane line model training method and device, an electronic device, and a storage medium to improve the grouping accuracy of lane lines.
[0005] The first aspect of the present application provides a lane line model training method, comprising:
[0006] establishing a network model comprising at least a loss function, wherein the loss function comprises at least a first function;
[0007] obtaining a sample set comprising training images containing lane lines and verification images corresponding to the training images and having lane line labels;
[0008] training the network model using the sample set until the calculation result of the loss function is within a target threshold;
[0009] wherein the first function is used to separate different lane lines and / or to cluster the same lane line.
[0010] Optionally, the loss function further comprises a second function.
[0011] Correspondingly, the training of the network model using the sample set until the calculation result of the loss function is within a target threshold comprises:
[0012] training the network model using the sample set until the first calculation result of the first function is within a first target threshold and the second calculation result of the second function is within a second target threshold;
[0013] wherein the second function is used to separate two lane lines within a preset distance threshold range and / or to connect the same dashed lane line.
[0014] Optionally, the second function comprises a first sub-function and / or a second sub-function;
[0015] Correspondingly, training the network model using the sample set until a second calculation result of the second function is within a second target threshold comprises:
[0016] determining, based on lane line labels in the verification images in the sample set, a same lane line position in the training images corresponding to the verification images; and
[0017] determining a target region within a preset distance range of the same lane line position in the training images, and training the network model based on at least a first training value in the target region and a first verification value in the verification images corresponding to the training images and being at a same position as the first training value until a calculation result of the first sub-function is within a second target threshold;
[0018] and / or, determining, based on lane line labels in the verification images in the sample set, a non-connection position of a same dashed lane line in the training images corresponding to the verification images; and
[0019] training the network model based on at least a second training value at the non-connection position in the training images and a second verification value in the verification images corresponding to the training images and being at a same position as the first training value until a calculation result of the second sub-function is within a second target threshold.
[0020] Optionally, the first function comprises a third sub-function and / or a fourth sub-function;
[0021] Correspondingly, training the network model using the sample set until a first calculation result of the first function is within a first target threshold comprises:
[0022] determining, based on lane line labels in the verification images in the sample set, a same lane line position in the training images corresponding to the verification images; and
[0023] training the network model based on at least a mean value of third training values at the same lane line position in the training images and a mean value of fourth training values at background positions other than the lane line position until a calculation result of the third sub-function is within a third target threshold, and / or training the network model based on at least a mean value of third training values at the same lane line position in the training images and each of the third training values at the same lane line position until a calculation result of the fourth sub-function is within a fourth target threshold.
[0024] The second aspect of the present application provides a model training device for lane lines, comprising:
[0025] A first establishing unit is configured to establish a network model comprising at least a loss function, wherein the loss function comprises at least a first function.
[0026] A first obtaining unit is configured to obtain a sample set comprising training images containing lane lines and verification images corresponding to the training images and having lane line labels.
[0027] A first training unit is configured to train the network model using the sample set until a calculation result of the loss function is within a target threshold.
[0028] The first function is configured to separate different lane lines and / or aggregate the same lane line.
[0029] Optionally, the loss function further comprises a second function.
[0030] Correspondingly, the first training unit comprises:
[0031] A first training module is configured to train the network model using the sample set until a first calculation result of the first function is within a first target threshold.
[0032] A second training module is configured to train the network model using the sample set until a second calculation result of the second function is within a second target threshold.
[0033] The second function is configured to separate two lane lines within a preset distance threshold range and / or connect the same dashed lane line.
[0034] Optionally, the second function comprises a first sub-function and / or a second sub-function.
[0035] Correspondingly, the second training module is specifically configured to:
[0036] determine the same lane line position in the training image corresponding to the verification image in the sample set based on the lane line label in the verification image; and
[0037] determine a target region within a preset distance range of the same lane line position in the training image, and train the network model based at least on a first training value in the target region and a first verification value in the verification image corresponding to the training image and having the same position as the first training value until a calculation result of the first sub-function is within a second target threshold.
[0038] and / or, determining, based on the lane line label in the validation image in the sample set, a non-connection position of the same dashed lane line in the training image corresponding to the validation image; and
[0039] training the network model based on at least a second training value at the non-connection position in the training image and a second validation value at the same position as the first training value position in the validation image corresponding to the training image, until a calculation result of the second sub-function is within a second target threshold.
[0040] Optionally, the first function comprises a third sub-function and / or a fourth sub-function.
[0041] Correspondingly, the first training module is specifically configured to
[0042] determining, based on the lane line label in the validation image in the sample set, a same lane line position in the training image corresponding to the validation image; and
[0043] training the network model based on at least a mean value of a third training value at the same lane line position in the training image and a mean value of a fourth training value at a background position other than the lane line position, until a calculation result of the third sub-function is within a third target threshold, and / or training the network model based on at least a mean value of the third training value at the same lane line position in the training image and each of the third training value at the same lane line position, until a calculation result of the fourth sub-function is within a fourth target threshold.
[0044] The third aspect of the present application provides an electronic device, comprising:
[0045] a processor; and
[0046] a memory having executable code stored thereon, which, when executed by the processor, causes the processor to perform the method as described above.
[0047] The fourth aspect of the present application provides a non-transitory machine-readable storage medium having executable code stored thereon, which, when executed by a processor of an electronic device, causes the processor to perform the method as described above.
[0048] It can be seen that the model training method for lane lines is provided, a network model including at least a loss function is established, the loss function includes at least a first function, a sample set is obtained, the sample set includes a training image including a lane line and a verification image corresponding to the training image and having a lane line label, and the network model is trained by using the sample set until the calculation result of the loss function is within a target threshold, and the first function in the present application is used to separate different lane lines and / or gather the same lane line, that is, by training the network model including the first function in the loss function, the trained network model can separate different lane lines and gather the same lane line, and the accuracy of lane line grouping is improved.
[0049] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and are not limiting to the present application. BRIEF DESCRIPTION OF DRAWINGS
[0050] The above and other objects, features and advantages of the present application will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings in which like reference characters refer to like parts throughout the several views, and in which:
[0051] Figure 1 is a flowchart of the model training method for lane lines according to one method embodiment of the present application;
[0052] Figure 2a is a frame image diagram according to one method embodiment of the present application;
[0053] Figure 2b is a first image after processing the frame image according to one method embodiment of the present application;
[0054] Figure 3a is a training image according to one method embodiment of the present application;
[0055] Figure 3b is a verification image corresponding to the training image in Figure 3a according to one method embodiment of the present application;
[0056] Figure 4a is another training image according to one method embodiment of the present application;
[0057] Figure 4b is a verification image corresponding to the training image in Figure 4a according to one method embodiment of the present application;
[0058] Figure 5 is a flowchart of the model training method for lane lines according to another method embodiment of the present application;
[0059] Figure 6a is a verification image with lane line labels shown in another method embodiment of the present application;
[0060] Figure 6b is a training image with target regions corresponding to the verification image in Figure 6a
[0061] Figure 7a is a training image with dashed lane lines shown in another method embodiment of the present application;
[0062] Figure 7b is a training image with training lane lines and a verification image with lane line labels corresponding to the training image shown in another method embodiment of the present application;
[0063] Figure 8 is a structural schematic of a model training device for lane lines shown in one device embodiment of the present application;
[0064] Figure 9 is a structural schematic of an electronic device shown in another device embodiment of the present application. DETAILED DESCRIPTION
[0065] The preferred embodiments of the present application will be described in more detail with reference to the drawings. Although the preferred embodiments of the present application are shown in the drawings, it is understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided so that the present application will be thorough and complete, and will fully convey the scope of the present application to those skilled in the art.
[0066] The terms used in the present application are merely for the purpose of describing particular embodiments and are not intended to limit the present application. As used in the present application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "and / or," as used herein, refer to and encompass any or all possible combinations of one or more of the associated listed items.
[0067] It should be understood that although the terms "first," "second," "third," etc., may be used in this application to describe various information, this information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0068] To address the technical problems in the background art, embodiments of this application provide a model training method for lane lines, which can improve the grouping accuracy of lane lines.
[0069] The technical solutions of the embodiments of this application are described in detail below with reference to the accompanying drawings.
[0070] One embodiment of this application provides a method for training a model for lane lines, such as... Figure 1 As shown, the method includes the following steps:
[0071] Step 101: Establish a network model that includes at least a loss function;
[0072] The loss function includes at least a first function, which is used to separate different lane lines and / or aggregate the same lane lines.
[0073] In some embodiments, the first function may include a third sub-function and / or a fourth sub-function, wherein the third sub-function is used to separate different lane lines and the fourth sub-function is used to aggregate the same lane lines.
[0074] The network model in this application is a neural network model, specifically the UNet network model, but it can also be other models used for image recognition; this application does not limit this. It should be noted that this application modifies the loss function in the network model.
[0075] Step 102: Obtain the sample set;
[0076] The sample set includes training images containing lane lines and verification images corresponding to the training images, each with lane line labels.
[0077] Specifically, the training and validation images in this application can be derived from videos captured by the vehicle, by using frame images from the video, such as... Figure 2a As shown, the image is converted into a first image containing only lane lines, for example, as shown. Figure 2bAs shown, the lane lines in the first image are then converted into actual latitude and longitude coordinates using the pixels of the lane lines in the first image, the latitude and longitude coordinates of the vehicle, and the camera parameters of the video acquisition, and then converted into training images and verification images for training purposes in this application.
[0078] like Figure 3a and 3b As shown, Figure 3a For training images containing lane lines, Figure 3b For the corresponding Figure 3a The verification image contains lane line labels. For example... Figure 4a and 4b As shown, Figure 4a For training images containing lane lines, Figure 4b For the corresponding Figure 4a The verification image contains lane line labels.
[0079] Step 103: Train the network model using the sample set until the calculated result of the loss function is within the target threshold.
[0080] The target threshold is a pre-set value. The network model is trained using a sample set to make the loss function as close to 0 as possible. Therefore, the target threshold can be a value close to 0, such as 0.2, or any other value close to 0.
[0081] In this embodiment, a network model including at least a loss function (at least a first function) is established. A sample set is obtained, including training images containing lane lines and verification images with lane line labels corresponding to the training images. The network model is then trained using the sample set until the calculation result of the loss function is within a target threshold. The first function in this application is used to separate different lane lines and / or group the same lane lines. In other words, by training a network model whose loss function includes the first function, the trained network model can separate different lane lines and group the same lane lines, thus improving the accuracy of lane line grouping.
[0082] Another method embodiment of this application provides a model training method for lane lines, such as... Figure 5 As shown, the method may include the following steps:
[0083] Step 501: Establish a network model that includes at least a loss function;
[0084] In this embodiment, the loss function includes at least a first function and a second function;
[0085] The first function is used to separate different lane lines and / or aggregate the same lane lines. In some embodiments, the first function may include a third sub-function and / or a fourth sub-function, whereby the third sub-function is used to separate different lane lines and the fourth sub-function is used to aggregate the same lane lines.
[0086] The second function is used to separate two lane lines whose distance is within a preset distance threshold range and / or to connect lane lines that are the same dashed line. In some embodiments, the second function may include a first sub-function and / or a second sub-function, wherein the first sub-function is used to separate two lane lines whose distance is within a preset distance threshold range, and the second sub-function is used to connect lane lines that are the same dashed line.
[0087] The distance threshold is a pre-set fixed value, mainly used to distinguish between two lane lines that are very close together. This value can be set based on experience.
[0088] In some embodiments, the loss function is formulated as follows:
[0089] Loss total =δ*Loss aug +γ*Loss pull-push ;
[0090] In the above formula, Loss aug The second function, also known as the enhancement function, is the Loss function. pull-push This is the first function, also known as the push-pull function. δ and γ are empirical coefficients, specifically constants.
[0091] Step 502: Obtain the sample set;
[0092] The sample set includes training images containing lane lines and verification images corresponding to the training images, which have lane line labels.
[0093] Step 503: Train the network model using the sample set until the first calculation result of the first function is within the first target threshold and the second calculation result of the second function is within the second target threshold.
[0094] By training the network model with a sample set, the first calculation result of the first function is within the first target threshold, and the second calculation result of the second function is within the second target threshold, thereby making the calculation result of the loss function within the target threshold. In layman's terms, it makes the calculation result of the loss function close to 0.
[0095] The specific values of the first and second target thresholds are not limited in this application, as long as the set values and empirical coefficients work together to ensure that the calculation result of the loss function is within the target thresholds when the network model is trained.
[0096] In this embodiment, the loss function includes a first function for separating different lane lines and / or grouping the same lane lines, and a second function for separating two lane lines whose distance is within a preset distance threshold and / or connecting the same dashed lane lines. In other words, through training, the network model can identify the lane lines of the subject based on the first function of the loss function and enhance the identification of lane lines based on the second function of the loss function, thereby improving the lane line grouping accuracy of the network model with the loss function.
[0097] In another embodiment of the method in this application, the implementation of the second function is mainly described. Specifically, the second function includes a first sub-function and / or a second sub-function. The first sub-function is used to separate two lane lines whose distance is within a preset distance threshold range; the second sub-function is used to connect the same dashed lane lines.
[0098] Accordingly, the network model is trained using the sample set until the second calculation result of the second function is within the second target threshold, including:
[0099] (1.1) Based on the lane label in the verification image in the sample set, determine the position of the same lane line in the training image corresponding to the verification image; and
[0100] (1.2) Determine the target region within a preset distance range of the lane line position in the training image, and train the network model based at least on the first training value within the target region and the first verification value in the verification image corresponding to the training image that is at the same position as the first training value, until the calculation result of the first sub-function is within the second target threshold;
[0101] And / or,
[0102] (2.1) Based on the lane label in the verification image of the sample set, determine the non-connection position of the same dashed lane line in the training image corresponding to the verification image; and
[0103] (2.2) The network model is trained at least based on the second training value at the non-connected position in the training image and the second verification value in the verification image corresponding to the training image at the same position as the first training value, until the calculation result of the second sub-function is within the second target threshold.
[0104] For steps 1.1 and 1.2 above, the sample set contains corresponding training images and verification images. The training images contain lane lines, and the verification images contain lane line labels. Therefore, the lane line positions in the corresponding training images can be determined by the lane line labels in the verification images.
[0105] In this application, the target region in the training image refers to the surrounding area in the training image that is very close to the lane line. That is, the region within a preset distance range of the lane line position. The preset distance range is set based on the actual situation and is intended to separate two lane lines that are very close to each other, such as double solid lines or double yellow lines in actual scenarios.
[0106] It is understandable that the first training value within the target area refers to the first training value within a preset distance range of the lane line position, and does not include the value on the lane line.
[0107] For easier understanding, please refer to Figure 6a and Figure 6b , Figure 6a For verification images with lane line labels, Figure 6b The training image contains lane lines, and the white area is the target area mentioned in the text. Obviously, the target area surrounds the lane lines.
[0108] The fact that the first training value in the target region of the training image and the first verification value in the corresponding verification image are in the same position means that the pixel position corresponding to the first training value in the target region of the training image is the same as the pixel position of the first verification value in the verification image.
[0109] In steps 2.1 and 2.2 above, the sample set contains corresponding training images and verification images. The training images contain lane lines, and the verification images contain lane line labels. Therefore, the non-connection positions of the dashed lane lines in the corresponding training images can be determined by the lane line labels in the verification images.
[0110] For example, refer to Figure 7a The point where L1 and L2 in the dashed lane line are broken is a non-connected position.
[0111] The fact that the second training value at a non-connected location in the training image and the second verification value in the corresponding verification image are at the same location means that the pixel position corresponding to the second training value in the training image is the same as the pixel position of the second verification value.
[0112] refer to Figure 7b The left side shows the training image, and the right side shows the corresponding validation image. So, with... Figure 7a The unconnected positions between L1 and L2 in the equation are the same. Figure 7b l1-2 in the middle.
[0113] In some embodiments, the second function comprises the formula for the first sub-function and the second sub-function as follows:
[0114] Loss aug =∑ i |xxi |+∑ j |xx j |
[0115] In the formula for the second function, ∑ i |xx i | Corresponds to the first sub-function;
[0116] ∑ j |xx j | Corresponds to the second sub-function;
[0117] The first sub-function separates two lane lines that are within a preset distance threshold; the second sub-function connects lane lines that are on the same dashed line. In simpler terms, the first sub-function separates two very close lane lines, and the second sub-function connects lane lines that are on the same dashed line.
[0118] In the first sub-function, x is the first training value. i This is the first verification value.
[0119] In the second sub-function, x is the second training value. j This is the second verification value.
[0120] Of course, the second function can also contain only the first sub-function or the second sub-function mentioned above.
[0121] In another embodiment of the method in this application, the implementation of the first function is mainly described. Specifically, the first function includes a third sub-function and / or a fourth sub-function. The third sub-function is used to separate different lane lines, and the fourth sub-function is used to aggregate lane lines of the same lane.
[0122] Accordingly, training the network model using the sample set until the first calculation result of the first function is within the first target threshold includes:
[0123] (3.1) Based on the lane label in the verification image in the sample set, determine the position of the same lane line in the training image corresponding to the verification image; and
[0124] (3.2) The network model is trained at least based on the mean of the third training values at the same lane position in the training image and the mean of the fourth training values at the background positions other than the lane line positions, until the calculation result of the third sub-function is within the third target threshold;
[0125] And / or,
[0126] (4.1) Based on the lane label in the verification image in the sample set, determine the position of the same lane line in the training image corresponding to the verification image; and
[0127] (4.2) The network model is trained at least based on the mean of the third training values at the same lane line position in the training image and each third training value at the same lane line position until the calculation result of the fourth sub-function is within the fourth target threshold.
[0128] In steps 3.1 and 3.2 above, the sample set contains corresponding training images and verification images. The training images contain lane lines, and the verification images contain lane line labels. Therefore, the position of the same lane line in the corresponding training image can be determined by the lane line labels in the verification image.
[0129] The training images include lane lines and the background of the lane lines in the distinguishing zone. The mean of all third training values on the same lane line and the mean of all fourth training values on the background are determined. These values are used to train the network model.
[0130] Understandably, the third sub-function is used to separate different lane lines; in layman's terms, it is used to keep values belonging to different clusters as far apart as possible.
[0131] In steps 4.1 and 4.2 above, the sample set contains corresponding training images and verification images. The training images contain lane lines, and the verification images contain lane line labels. Therefore, the position of the same lane line in the corresponding training image can be determined by the lane line labels in the verification image.
[0132] The training images include lane lines and a background that is distinct from the lane lines. The mean of all third training values on the same lane line and all third training values at the same lane line location are determined. These values are used to train the network model.
[0133] Understandably, the fourth sub-function is used to cluster lane lines, or in simpler terms, to cluster values belonging to the same cluster as much as possible.
[0134] It should be noted that the specific values of the third and fourth target thresholds mentioned above are not limited in this application and can be set empirically. The goal is to train the network model so that the first calculation result of the first function is within the first target threshold.
[0135] In some embodiments, the first function includes the formulas for the third and fourth sub-functions as follows:
[0136] Loss pull-push =α*Loss push +β*Loss pull
[0137] In the formula of the first function, Loss pushThe corresponding third sub-function can also be called the derivation function;
[0138] Loss pull The fourth subfunction is also known as the Lat function.
[0139] Among them, α and β are empirical coefficients, mainly used to harmonize the strength of separation and aggregation, or the strength of pushing and pulling.
[0140] Of course, the first function may include only the third sub-function or the fourth sub-function mentioned above.
[0141] It should be noted that the above-mentioned empirical coefficient α and the third target threshold set for the third sub-function work together, and / or the above-mentioned empirical system β and the fourth target threshold set for the fourth sub-function work together, so that by training the network model, the first calculation result of the first function can be within the first target threshold.
[0142] In some embodiments, the formula for the third sub-function is as follows:
[0143]
[0144] In the formula of the third sub-function, N represents the number of clusters. In this embodiment, it mainly includes two clusters: lane lines and background, so the value of N is 2.
[0145] σ i σ j σ represents the mean of different clusters. In this embodiment, σ i σ represents the mean of the third training value. j This represents the mean of the fourth training value. ε1 is a constant, pre-set based on experience.
[0146] In some embodiments, the formula for the fourth sub-function is as follows:
[0147]
[0148] In the formula of the fourth sub-function, N represents the number of clusters. In this embodiment, it mainly includes two clusters: lane lines and background, so the value of N is 2.
[0149] σ i x represents the mean of the cluster. j Each value representing the current cluster, in this embodiment, is σ. i x represents the mean of the third training value. j This represents each third training value at the same lane line position. ε2 is a constant, pre-set based on experience.
[0150] Corresponding to the aforementioned application function implementation method embodiments, this application also provides a model training device, electronic device, and corresponding embodiments for lane lines.
[0151] One embodiment of this application provides a model training apparatus for lane lines, such as... Figure 8 As shown, the device includes: a first establishment unit 110, a first acquisition unit 120, and a first training unit 130; wherein:
[0152] The first establishment unit 110 is used to establish a network model that includes at least a loss function;
[0153] The loss function includes at least a first function, which is used to separate different lane lines and / or aggregate the same lane lines.
[0154] The first acquisition unit 120 is used to acquire a sample set, which includes training images containing lane lines and verification images corresponding to the training images and having lane line labels.
[0155] The first training unit 130 is used to train the network model using the sample set until the calculation result of the loss function is within the target threshold.
[0156] In this embodiment, a network model including at least a loss function (at least a first function) is established. A sample set is obtained, including training images containing lane lines and verification images with lane line labels corresponding to the training images. The network model is then trained using the sample set until the calculation result of the loss function is within a target threshold. The first function in this application is used to separate different lane lines and / or group the same lane lines. In other words, by training a network model whose loss function includes the first function, the trained network model can separate different lane lines and group the same lane lines, thus improving the accuracy of lane line grouping.
[0157] In another embodiment of the apparatus in this application, the loss function includes a first function and a second function, wherein the first function is used to separate different lane lines and / or aggregate the same lane lines, and the second function is used to separate two lane lines whose distance is within a preset distance threshold range and / or to connect the same dashed lane lines.
[0158] Accordingly, the first training unit includes:
[0159] The first training module is used to train the network model using the sample set until the first calculation result of the first function is within the first target threshold.
[0160] The second training module is used to train the network model using the sample set until the second calculation result of the second function is within the second target threshold.
[0161] In some embodiments, empirical coefficients can be set for the first function and the second function respectively, as detailed in the loss function formula in the method embodiment.
[0162] In another embodiment of the apparatus of this application, the second function includes a first sub-function and / or a second sub-function; the first sub-function is used to separate two lane lines whose distance is within a preset distance threshold range; the second sub-function is used to connect the same dashed lane lines.
[0163] Accordingly, the second training module is specifically used for:
[0164] Based on the lane line labels in the verification images in the sample set, the location of the same lane line in the corresponding training image is determined; and
[0165] Determine a target region within a preset distance range of the same lane line position in the training image, and train the network model based at least on a first training value within the target region and a first verification value in the verification image corresponding to the training image that is at the same position as the first training value, until the calculation result of the first sub-function is within the second target threshold;
[0166] And / or, based on the lane line labels in the verification images in the sample set, determine the non-connection position of the same dashed lane line in the training image corresponding to the verification image; and
[0167] The network model is trained based at least on the second training value at the non-connected position in the training image and the second verification value in the verification image corresponding to the training image, which is at the same position as the first training value, until the calculation result of the second sub-function is within the second target threshold.
[0168] In another embodiment of the apparatus in this application, the first function includes a third sub-function and / or a fourth sub-function; the third sub-function is used to separate different lane lines, and the fourth sub-function is used to aggregate the same lane lines.
[0169] Accordingly, the first training module is specifically used for:
[0170] Based on the lane line labels in the verification images in the sample set, the location of the same lane line in the corresponding training image is determined; and
[0171] The network model is trained at least based on the mean of the third training values at the same lane position in the training image and the mean of the fourth training values at the background positions other than the lane line positions, until the calculation result of the third sub-function is within the third target threshold, and / or, the network model is trained at least based on the mean of the third training values at the same lane line position in the training image and each of the third training values at the same lane line position, until the calculation result of the fourth sub-function is within the fourth target threshold.
[0172] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated further here.
[0173] Figure 9 This is a schematic diagram of the structure of an electronic device shown in another embodiment of this application.
[0174] See Figure 9 The electronic device 1000 includes a memory 1010 and a processor 1020.
[0175] The processor 1020 can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0176] Memory 1010 may include various types of storage units, such as system memory, read-only memory (ROM), and permanent storage devices. ROM may store static data or instructions required by the processor 1020 or other modules of the computer. Permanent storage devices may be read-write storage devices. Permanent storage devices may be non-volatile storage devices that retain stored instructions and data even when the computer is powered off. In some embodiments, permanent storage devices use mass storage devices (e.g., magnetic or optical disks, flash memory) as permanent storage devices. In other embodiments, permanent storage devices may be removable storage devices (e.g., floppy disks, optical drives). System memory may be a read-write storage device or a volatile read-write storage device, such as dynamic random access memory. System memory may store some or all of the instructions and data required by the processor during operation. Furthermore, memory 1010 may include any combination of computer-readable storage media, including various types of semiconductor memory chips (DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), and disks and / or optical disks may also be used. In some embodiments, memory 1010 may include a removable storage device that is readable and / or writable, such as a laser disc (CD), a read-only digital multifunction optical disc (e.g., DVD-ROM, dual-layer DVD-ROM), a read-only Blu-ray disc, an ultra-high density optical disc, a flash memory card (e.g., SD card, mini SD card, Micro-SD card, etc.), a magnetic floppy disk, etc. Computer-readable storage media do not contain carrier waves or transient electronic signals transmitted wirelessly or via wired connections.
[0177] The memory 1010 stores executable code, which, when processed by the processor 1020, can cause the processor 1020 to execute part or all of the methods described above.
[0178] The solution of this application has been described in detail above with reference to the accompanying drawings. In the above embodiments, the descriptions of each embodiment have different emphases; parts not described in detail in a certain embodiment can be referred to in the relevant descriptions of other embodiments. Those skilled in the art should also understand that the actions and modules involved in the specification are not necessarily essential to this application. Furthermore, it is understood that the steps in the method of this application embodiment can be adjusted, combined, and deleted according to actual needs, and the modules in the device of this application embodiment can be combined, divided, and deleted according to actual needs.
[0179] Furthermore, the method according to this application can also be implemented as a computer program or computer program product, which includes computer program code instructions for performing some or all of the steps in the method described above.
[0180] Alternatively, this application may be implemented as a non-transitory machine-readable storage medium (or computer-readable storage medium, or machine-readable storage medium) storing executable code (or computer program, or computer instruction code) that, when executed by a processor of an electronic device (or electronic device, server, etc.), causes the processor to perform some or all of the steps of the methods described above according to this application.
[0181] Those skilled in the art will also understand that the various exemplary logic blocks, modules, circuits, and algorithm steps described in connection with the present application can be implemented as electronic hardware, computer software, or a combination of both.
[0182] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems and methods according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0183] The various embodiments of this application have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or improvement of the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A method of model training for a lane line, characterized by, The method comprises: establishing a network model comprising at least a loss function, wherein the loss function comprises at least a first function; obtaining a sample set comprising training images containing lane lines and verification images corresponding to the training images and having lane line labels; training the network model using the sample set until a calculation result of the loss function is within a target threshold, wherein the training comprises training the network model using the sample set until a first calculation result of the first function is within a first target threshold; wherein the first function is used to separate different lane lines and / or aggregate the same lane line; wherein the first function comprises a third sub-function and / or a fourth sub-function, and the training of the network model using the sample set until the first calculation result of the first function is within the first target threshold comprises: determining, based on lane line labels in the verification images in the sample set, a same lane line position in the training images corresponding to the verification images; and training the network model based at least on a mean value of third training values at the same lane line position in the training images and a mean value of fourth training values at background positions other than the same lane line position until a calculation result of the third sub-function is within a third target threshold, and / or training the network model based at least on a mean value of third training values at the same lane line position in the training images and each of the third training values at the same lane line position until a calculation result of the fourth sub-function is within a fourth target threshold.
2. The method of claim 1, wherein, The loss function further comprises a second function; Correspondingly, the training of the network model using the sample set until the calculation result of the loss function is within the target threshold comprises: training the network model using the sample set until a second calculation result of the second function is within a second target threshold; wherein the second function is used to separate two lane lines within a preset distance threshold range and / or to connect the same dashed lane line.
3. The method of claim 2, wherein, The second function comprises a first sub-function and / or a second sub-function; Correspondingly, the training of the network model using the sample set until the second calculation result of the second function is within the second target threshold comprises: determining, based on lane line labels in the verification images in the sample set, a same lane line position in the training images corresponding to the verification images; and determining a target region within a preset distance range of the same lane line position in the training images, and training the network model based at least on first training values in the target region and first verification values corresponding to the first training values in the verification images corresponding to the training images until a calculation result of the first sub-function is within a second target threshold; and / or determining, based on lane line labels in the verification images in the sample set, a non-connection position of the same dashed lane line in the training images corresponding to the verification images; and The network model is trained based on at least the second training value at the non-connection position in the training image and a second verification value corresponding to the first training value position in the verification image corresponding to the training image until a calculation result of the second sub-function is within a second target threshold.
4. The model training device for a lane line according to claim 1 or 2, characterized by, The method comprises: The first establishing unit is configured to establish a network model comprising at least a loss function, wherein the loss function comprises at least a first function; The first obtaining unit is configured to obtain a sample set comprising a training image containing lane lines and a verification image corresponding to the training image and having lane line labels; The first training unit is configured to train the network model using the sample set until a calculation result of the loss function is within a target threshold, wherein the first training unit comprises a first training module configured to train the network model using the sample set until a first calculation result of the first function is within a first target threshold; The first function is configured to separate different lane lines and / or aggregate the same lane line; The first function comprises a third sub-function and / or a fourth sub-function, and the first training module is specifically configured to determine a same lane line position in the training image corresponding to the verification image based on lane line labels in the verification image in the sample set, and train the network model based on at least a mean value of third training values at the same lane line position in the training image and a mean value of fourth training values at background positions other than the lane line position until a calculation result of the third sub-function is within a third target threshold, and / or train the network model based on at least a mean value of third training values at the same lane line position in the training image and each third training value at the same lane line position until a calculation result of the fourth sub-function is within a fourth target threshold.
5. The apparatus of claim 4, wherein, The loss function further comprises a second function; Correspondingly, the first training unit comprises: A second training module configured to train the network model using the sample set until a second calculation result of the second function is within a second target threshold; The second function is configured to separate two lane lines within a preset distance threshold range and / or connect the same dashed lane line.
6. The apparatus of claim 5, wherein, The second function comprises a first sub-function and / or a second sub-function; Correspondingly, the second training module is specifically configured to: Determine a same lane line position in the training image corresponding to the verification image based on lane line labels in the verification image in the sample set; and Determine a target region within a preset distance range of the same lane line position in the training image, and train the network model based on at least first training values in the target region and first verification values corresponding to the first training value position in the verification image corresponding to the training image until a calculation result of the first sub-function is within a second target threshold. and / or, based on the lane line label determination in the validation image in the sample set, a non-connection position of the same dashed lane line in the training image corresponding to the validation image; and training the network model based on at least a second training value at the non-connection position in the training image and a second validation value in the validation image corresponding to the training image and same as the first training value position, until the calculation result of the second sub-function is within a second target threshold.
7. An electronic device, comprising: comprising: a processor; and a memory having stored thereon executable code that, when executed by the processor, causes the processor to perform the method of any one of claims 1-3.
8. A non-transitory machine-readable storage medium having stored thereon executable code that, when executed by a processor of an electronic device, causes the processor to perform the method of any one of claims 1-3.
Citation Information
Patent Citations
Lane line identification method and device
CN108090456A
Lane line recognition model training method and device and lane line recognition method and device
CN113298050A