Network loss calculation method, device and terminal
By extracting feature points in the lane line detection network and calculating network losses, the problem that network loss calculation in the prior art is difficult to meet the accuracy requirements, and the accuracy of lane line detection tasks is improved.
Patent Information
- Application Number
- CN202411214642.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-12-13
AI Technical Summary
The existing network loss calculation methods are difficult to meet the accuracy requirements of the lane line detection model, resulting in low accuracy of lane line detection tasks.
By acquiring the initial lane line image, determining the target lane line image, extracting multiple pairs of feature point values, and calculating network loss based on the preset lane line equation, and calculating network loss using the distance, slope and curvature error of feature points to satisfy lane line detection Model accuracy requirements.
The accuracy of lane line detection task is improved and the accuracy requirements of lane line detection model is met.
Smart Images

Figure CN119131728A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of lane line detection, and in particular to a network loss calculation method, device, and terminal. Background Art
[0002] Lane lines are traffic markings that separate moving vehicles, including white dashed lines, white solid lines, yellow dashed lines, and yellow solid lines. Lane detection is a basic function of intelligent driving. Lane detection is generally performed using a lane detection model. The model loss (i.e., network loss) of the lane detection model plays an important role in the detection function of the model.
[0003] At present, the calculation of network loss in lane detection models generally adopts existing classification loss, similarity loss, etc.
[0004] However, it is difficult to meet the accuracy requirements of the lane detection model using the above network loss, which leads to the problem of low accuracy in performing lane detection tasks through the lane detection model. Summary of the invention
[0005] The main purpose of this application is to provide a network loss calculation method, device, and terminal to solve the problem that the existing network loss is difficult to meet the accuracy requirements of the lane line detection model, which in turn leads to low accuracy in performing lane line detection tasks through the lane line detection model.
[0006] In order to achieve the above objectives, in a first aspect, the present application provides a network loss calculation method, comprising:
[0007] Get the initial lane line image;
[0008] Determine a target lane line image based on the initial lane line image;
[0009] Based on the target lane line in the target lane line image, determining multiple pairs of feature point values;
[0010] Obtain a preset lane line equation, where the lane line equation is a network loss function in a lane line detection network;
[0011] Based on multiple pairs of feature point values and preset lane line equations, the network loss is determined.
[0012] In a possible implementation, determining a target lane line image based on an initial lane line image includes:
[0013] Identify a first lane line in an initial lane line image;
[0014] Configure a corresponding second lane line for the first lane line, and obtain a target lane line image based on the first lane line and the second lane line;
[0015] The target lane line includes a first lane line and a second lane line, the first lane line represents a lane line composed of a lane line true value, and the second lane line represents a lane line composed of a lane line detection value.
[0016] In a possible implementation, based on the target lane line in the target lane line image, multiple pairs of feature point values are determined, including:
[0017] Extracting a plurality of first feature points from the first lane line to obtain a plurality of true values of the plurality of first feature points, wherein the plurality of first feature points correspond one-to-one to the plurality of true values;
[0018] Extracting a plurality of second feature points on the second lane line to obtain a plurality of detection values of the plurality of second feature points, wherein the plurality of second feature points correspond one-to-one to the plurality of detection values;
[0019] Multiple pairs of feature points are composed of multiple true values and multiple detection values.
[0020] In a possible implementation, multiple pairs of feature points are formed by multiple true values and multiple detection values, including:
[0021] For each truth value among the multiple truth values, obtain a first feature point corresponding to each truth value;
[0022] For each detection value among the multiple detection values, obtain a second feature point corresponding to each detection value;
[0023] If the first feature point corresponding to each true value matches the second feature point corresponding to each detected value, each true value and each detected value are taken as a pair of feature point values until multiple pairs of feature point values are determined.
[0024] In one possible implementation, the network loss is determined based on multiple pairs of feature point values and a preset lane line equation, including:
[0025] For each pair of feature point values in the plurality of pairs of feature point values, based on each pair of feature point values and a preset lane line, determining an initial error corresponding to each pair of feature points, wherein each pair of feature point values is a value of each pair of feature points;
[0026] Get the initial error weight;
[0027] Based on the initial error weight and the initial error corresponding to each pair of feature points, the target error corresponding to each pair of feature points is calculated;
[0028] The network loss is calculated based on the target error corresponding to each pair of feature points.
[0029] In a possible implementation, based on each pair of feature point values and a preset lane line equation, determining an initial error corresponding to each pair of feature points includes:
[0030] Input each pair of feature point values into the preset lane line equation to obtain the distance error of each pair of feature points;
[0031] The preset lane line equation is derived once, and each pair of feature point values is input into the preset lane line equation after the derivation, so as to obtain the slope error of each pair of feature points;
[0032] The preset lane line equation is derivatized twice, and each pair of feature point values is input into the preset lane line equation after the second derivation to obtain the curvature error of each pair of feature points;
[0033] The initial error corresponding to each pair of feature points is composed of the distance error of each pair of feature points, the slope error of each pair of feature points and the curvature error of each pair of feature points.
[0034] In a possible implementation, the target error corresponding to each pair of feature points is calculated based on the initial error weight and the initial error corresponding to each pair of feature points, including:
[0035] Multiply the distance error of each pair of feature points by the distance weight to obtain the first product;
[0036] Multiply the slope error of each pair of feature points by the slope weight to obtain a second product;
[0037] Multiply the curvature error of each pair of feature points by the curvature weight to obtain the third product;
[0038] The first product, the second product, and the third product are added together to obtain the target error corresponding to each pair of feature points.
[0039] In one possible implementation, the network loss is calculated based on the target error corresponding to each pair of feature points, including:
[0040] Summarize the target errors corresponding to each pair of feature points to obtain multiple target errors;
[0041] Based on multiple objective errors, the network loss is calculated.
[0042] In a second aspect, an embodiment of the present invention provides a network loss calculation device, including:
[0043] A first acquisition module is used to acquire an initial lane line image;
[0044] A second acquisition module, used to determine a target lane line image based on the initial lane line image;
[0045] A feature value determination module, used to determine multiple pairs of feature point values based on the target lane line in the target lane line image;
[0046] A third acquisition module is used to acquire a preset lane line equation, wherein the lane line equation is a network loss function in a lane line detection network;
[0047] The network loss calculation module determines the network loss based on multiple pairs of feature point values and preset lane line equations.
[0048] In a third aspect, an embodiment of the present invention provides a terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any of the above network loss calculation methods when executing the computer program.
[0049] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the above network loss calculation methods are implemented.
[0050] The embodiments of the present invention provide a network loss calculation method, device, and terminal, including: first obtaining an initial lane line image, then determining a target lane line image based on the initial lane line image, then determining multiple pairs of feature point values based on the target lane line in the target lane line image, and finally obtaining a preset lane line equation, wherein the lane line equation is a network loss function in a lane line detection network, and then determining the network loss based on multiple pairs of feature point values and the preset lane line equation. The present application configures the lane line equation as a network loss function in a lane line detection network, and calculates the network loss by extracting feature points in the network loss function, so that the calculated network loss meets the accuracy requirements of the lane line detection model, thereby improving the accuracy of the lane line detection task. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The drawings constituting a part of this application are used to provide a further understanding of this application, so that other features, purposes and advantages of this application become more obvious. The schematic embodiment drawings and their descriptions of this application are used to explain this application and do not constitute an improper limitation on this application. In the drawings:
[0052] Figure 1 is a flow chart of an implementation method of a network loss calculation method provided by an embodiment of the present invention;
[0053] Figure 2 is a schematic diagram of a target lane line image provided by an embodiment of the present invention;
[0054] Figure 3 It is a structural schematic diagram of a network loss calculation device provided by an embodiment of the present invention;
[0055] Figure 4 is a schematic diagram of a terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0057] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in sequences other than those illustrated or described herein.
[0058] It should be understood that in various embodiments of the present invention, the size of the sequence number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0059] It should be understood that in the present invention, "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products or apparatuses.
[0060] It should be understood that in the present invention, "plurality" refers to two or more than two. "And / or" is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "Contains A, B and C", "Contains A, B, C" means that A, B, and C are all included, "Contains A, B or C" means that one of A, B, and C is included, and "Contains A, B and / or C" means that any one, any two, or any three of A, B, and C are included.
[0061] It should be understood that in the present invention, "B corresponding to A", "B corresponding to A", "A corresponds to B" or "B corresponds to A" means that B is associated with A and B can be determined based on A. Determining B based on A does not mean determining B based only on A, but B can also be determined based on A and / or other information. A and B match when the similarity between A and B is greater than or equal to a preset threshold.
[0062] Depending on the context, "if" as used herein may be interpreted as "when" or "when" or "in response to determining" or "in response to detecting."
[0063] The technical solution of the present invention is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.
[0064] In order to make the purpose, technical solutions and advantages of the present invention more clear, specific embodiments will be described below in conjunction with the accompanying drawings.
[0065] In one embodiment, Figure 1 As shown, a network loss calculation method is provided, comprising the following steps:
[0066] Step S101: Acquire an initial lane line image;
[0067] Step S102: Determine a target lane line image based on the initial lane line image.
[0068] To obtain the target lane line image, it is necessary to first obtain the initial lane line image, then identify the first lane line in the initial lane line image, and then configure the corresponding second lane line for the first lane line to obtain the target lane line image.
[0069] The initial lane line image can be obtained by a vehicle-mounted camera. After the initial lane line image is obtained, the image needs to be preprocessed, such as filtering, to obtain a clear image. Then, the lane line in the initial lane line image, i.e., the first lane line, can be identified by a recognition algorithm.
[0070] Since the second lane line identified by the recognition algorithm (such as Figure 2 The gray curve shown in ) and the real lane line (i.e., the first lane line, as shown in Figure 2 Therefore, the present application sets the first lane line and the second lane line in the same image, that is, the target lane line image, so as to reduce the influence of the error on the network loss and thus improve the accuracy of the network loss calculation.
[0071] Step S103: Determine multiple pairs of feature point values based on the target lane line in the target lane line image.
[0072] To determine multiple pairs of feature point values based on the target lane line in the target lane line image, it is necessary to first extract multiple first feature points from the first lane line to obtain multiple true values of the multiple first feature points, wherein the multiple first feature points correspond one-to-one to the multiple true values, and then extract multiple second feature points on the second lane line to obtain multiple detection values of the multiple second feature points, wherein the multiple second feature points correspond one-to-one to the multiple detection values, and then multiple pairs of feature points are formed by the multiple true values and the multiple detection values.
[0073] When you get Figure 2 After the target lane line image is shown, sampling is required, and multiple first feature points on the first lane line and multiple second feature points on the second lane line are determined by sampling. Among them, the sampling strategy of this application is to first build a grid, and then perform horizontal sampling and vertical sampling. Among them, horizontal sampling: equal sampling according to pixel resolution, and vertical sampling: adaptive vertical sampling: the vertical sampling strategy is to take the sensor as the center, gradually sparse from near to far, and the sparse ratio is the empirical threshold.
[0074] After determining the feature points on the first lane line and the second lane line through sampling, the values of each feature point can be directly obtained. Since the first lane line is a real lane line, the value corresponding to the feature point on it (i.e., the first feature point) is used as the true value, and the second lane line is a detected lane line, the value corresponding to the feature point on it (i.e., the second feature point) is used as the detection value.
[0075] It should be noted that the first feature points extracted on the first lane line and the second feature points extracted on the second lane line are in one-to-one correspondence.
[0076] After obtaining the values corresponding to each feature point, multiple pairs of feature points are formed by multiple true values and multiple detection values. Specifically, for each true value among the multiple true values, the first feature point corresponding to each true value is obtained; for each detection value among the multiple detection values, the second feature point corresponding to each detection value is obtained; if the first feature point corresponding to each true value and the second feature point corresponding to each detection value match, each true value and each detection value are taken as a pair of feature point values until multiple pairs of feature point values are determined.
[0077] Since the first feature point extracted on the first lane line and the second feature point extracted on the second lane line are one-to-one corresponding, the matching true value and the detection value can be obtained by matching the first feature point and the second feature point, and then the obtained true value and the detection value are used as a pair of feature point values.
[0078] Exemplarily, the first feature point 1 and the second feature point 2 match, and the true value 11 of the first feature point 1 and the detected value 22 of the second feature point 2 are a pair of matched feature point values.
[0079] According to the above matching method, multiple pairs of feature point values can be obtained.
[0080] Step S104: Obtain a preset lane line equation.
[0081] Among them, the lane line equation is the network loss function in the lane line detection network.
[0082] The lane line equation preset in this application is as follows:
[0083] L1= U det -U gt (1)
[0084] Among them, L1 is the distance error, U det is the detection value in a pair of feature point values, U gt is the true value of a pair of feature point values.
[0085] Step S105: Determine the network loss based on multiple pairs of feature point values and preset lane line equations.
[0086] To determine the network loss based on multiple pairs of feature point values and a preset lane line equation, it is necessary to first determine the initial error corresponding to each pair of feature points for each pair of feature point values in the multiple pairs of feature point values based on each pair of feature point values and the preset lane line equation, wherein each pair of feature point values is the value of each pair of feature points, and then obtain the initial error weight, and then calculate the target error corresponding to each pair of feature points based on the initial error weight and the initial error corresponding to each pair of feature points, and finally calculate the network loss based on the target error corresponding to each pair of feature points.
[0087] In a possible implementation, based on each pair of feature point values and a preset lane line equation, an initial error corresponding to each pair of feature points is determined, including: inputting each pair of feature point values into the preset lane line equation to obtain a distance error for each pair of feature points; performing a first derivation on the preset lane line equation, and inputting each pair of feature point values into the preset lane line equation after the first derivation to obtain a slope error for each pair of feature points; performing a second derivation on the preset lane line equation, and inputting each pair of feature point values into the preset lane line equation after the second derivation to obtain a curvature error for each pair of feature points; the initial error corresponding to each pair of feature points is constituted by the distance error of each pair of feature points, the slope error of each pair of feature points, and the curvature error of each pair of feature points.
[0088] Specifically, each pair of feature point values is first input into the preset lane line equation (1) to obtain the distance error L1 of each pair of feature points.
[0089] Then, the lane line equation (1) is derived to obtain the following formula (2), and then each pair of feature point values is input into formula (2) to obtain the slope error L2 of each pair of feature points.
[0090] L2=(U det )′-(U gt )′ (2)
[0091] Then, the lane line equation (2) is derived to obtain the following formula (3). Then, each pair of feature point values is input into formula (3) to obtain the slope error L3 of each pair of feature points.
[0092] L3=(U det )″-(U gt )″ (3)
[0093] After the distance error L1 of each pair of feature points, the slope error L2 of each pair of feature points and the curvature error L3 of each pair of feature points are calculated by the above formulas (1)-(3), the initial error corresponding to each pair of feature points can be formed by the distance error L1 of each pair of feature points, the slope error L2 of each pair of feature points and the curvature error L3 of each pair of feature points.
[0094] Furthermore, based on the initial error weight and the initial error corresponding to each pair of feature points, the target error corresponding to each pair of feature points is calculated, including: multiplying the distance error of each pair of feature points by the distance weight to obtain a first product; multiplying the slope error of each pair of feature points by the slope weight to obtain a second product; multiplying the curvature error of each pair of feature points by the curvature weight to obtain a third product; adding the first product, the second product and the third product to obtain the target error corresponding to each pair of feature points.
[0095] Finally, based on the target error corresponding to each pair of feature points, the network loss is calculated, including: summarizing the target error corresponding to each pair of feature points to obtain multiple target errors; and calculating the network loss based on the multiple target errors.
[0096] Specifically, the network loss calculation formula is as follows:
[0097] L=W1L1+W2L2+W3L3(4)
[0098] Among them, L is the network loss, L1 is the distance error, L2 is the slope error, L3 is the curvature error, W1 is the distance weight, W1 is the slope weight, and W1 is the curvature weight.
[0099] An embodiment of the present invention provides a method for calculating network loss, including: first obtaining an initial lane line image, then determining a target lane line image based on the initial lane line image, then determining multiple pairs of feature point values based on the target lane line in the target lane line image, and finally obtaining a preset lane line equation, wherein the lane line equation is a network loss function in a lane line detection network, and then determining the network loss based on multiple pairs of feature point values and the preset lane line equation. The present application configures the lane line equation as a network loss function in a lane line detection network, and calculates the network loss by extracting feature points in the network loss function, so that the calculated network loss meets the accuracy requirements of the lane line detection model, thereby improving the accuracy of the lane line detection task.
[0100] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0101] The following is an embodiment of the device of the present invention. For details not described in detail, reference may be made to the corresponding method embodiments described above.
[0102] Figure 3 A schematic diagram of the structure of a network loss calculation device provided by an embodiment of the present invention is shown. For the convenience of explanation, only the parts related to the embodiment of the present invention are shown. A network loss calculation device includes a first acquisition module 301, a second acquisition module 302, a characteristic value determination module 303, a third acquisition module 304 and a network loss calculation module 305, which are specifically as follows:
[0103] A first acquisition module 301 is used to acquire an initial lane line image;
[0104] A second acquisition module 302, configured to determine a target lane line image based on the initial lane line image;
[0105] A feature value determination module 303, used to determine multiple pairs of feature point values based on the target lane line in the target lane line image;
[0106] A second acquisition module 304 is used to acquire a preset lane line equation, wherein the lane line equation is a network loss function in a lane line detection network;
[0107] The network loss calculation module 305 determines the network loss based on multiple pairs of feature point values and a preset lane line equation.
[0108] In a possible implementation, the second acquisition module 302 is further used to acquire an initial lane line image;
[0109] Identify a first lane line in an initial lane line image;
[0110] A corresponding second lane line is configured for the first lane line to obtain a target lane line image.
[0111] In a possible implementation, the feature value determination module 303 is further configured to extract a plurality of first feature points from the first lane line to obtain a plurality of true values of the plurality of first feature points, wherein the plurality of first feature points correspond one-to-one to the plurality of true values;
[0112] Extracting a plurality of second feature points on the second lane line to obtain a plurality of detection values of the plurality of second feature points, wherein the plurality of second feature points correspond one-to-one to the plurality of detection values;
[0113] Multiple pairs of feature points are composed of multiple true values and multiple detection values.
[0114] In a possible implementation, the feature value determination module 303 is further configured to obtain, for each of the multiple true values, a first feature point corresponding to each true value;
[0115] For each detection value among the multiple detection values, obtain a second feature point corresponding to each detection value;
[0116] If the first feature point corresponding to each true value matches the second feature point corresponding to each detected value, each true value and each detected value are taken as a pair of feature point values until multiple pairs of feature point values are determined.
[0117] In a possible implementation, the network loss calculation module 305 is further used to determine, for each pair of feature point values in the plurality of pairs of feature point values, an initial error corresponding to each pair of feature point values based on each pair of feature point values and a preset lane line, wherein each pair of feature point values is a value of each pair of feature points;
[0118] Get the initial error weight;
[0119] Based on the initial error weight and the initial error corresponding to each pair of feature points, the target error corresponding to each pair of feature points is calculated;
[0120] The network loss is calculated based on the target error corresponding to each pair of feature points.
[0121] In a possible implementation, the network loss calculation module 305 is further used to input each pair of feature point values into a preset lane line equation to obtain a distance error of each pair of feature points;
[0122] The preset lane line equation is derived once, and each pair of feature point values is input into the preset lane line equation after the derivation, so as to obtain the slope error of each pair of feature points;
[0123] The preset lane line equation is derivatized twice, and each pair of feature point values is input into the preset lane line equation after the second derivation to obtain the curvature error of each pair of feature points;
[0124] The initial error corresponding to each pair of feature points is composed of the distance error of each pair of feature points, the slope error of each pair of feature points and the curvature error of each pair of feature points.
[0125] In a possible implementation, the network loss calculation module 305 is further configured to multiply the distance error of each pair of feature points by the distance weight to obtain a first product;
[0126] Multiply the slope error of each pair of feature points by the slope weight to obtain a second product;
[0127] Multiply the curvature error of each pair of feature points by the curvature weight to obtain the third product;
[0128] The first product, the second product, and the third product are added together to obtain the target error corresponding to each pair of feature points.
[0129] In a possible implementation, the network loss calculation module 305 is further used to aggregate the target errors corresponding to each pair of feature points to obtain multiple target errors;
[0130] Based on multiple objective errors, the network loss is calculated.
[0131] The embodiment of the present invention provides a network loss calculation device, which is specifically used to: first obtain an initial lane line image, then determine a target lane line image based on the initial lane line image, then determine multiple pairs of feature point values based on the target lane line in the target lane line image, and finally obtain a preset lane line equation, wherein the lane line equation is a network loss function in a lane line detection network, and then determine the network loss based on multiple pairs of feature point values and the preset lane line equation. The present application configures the lane line equation as a network loss function in a lane line detection network, and calculates the network loss by extracting feature points in the network loss function, so that the calculated network loss meets the accuracy requirements of the lane line detection model, thereby improving the accuracy of the lane line detection task.
[0132] Figure 4 is a schematic diagram of a terminal provided by an embodiment of the present invention. Figure 4 As shown, the terminal 4 of this embodiment includes: a processor 401, a memory 402, and a computer program 404 stored in the memory 402 and executable on the processor 401. When the processor 401 executes the computer program 404, the steps in the above-mentioned various network loss calculation method embodiments are implemented, for example Figure 1 Alternatively, when the processor 401 executes the computer program 404, the functions of each module / unit in the above-mentioned network loss calculation device embodiments are implemented, for example Figure 3 Functionality of modules / units 301-305 is shown.
[0133] The present invention further provides a readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, it is used to implement a network loss calculation method provided in the above various embodiments, including:
[0134] Get the initial lane line image;
[0135] Determine a target lane line image based on the initial lane line image;
[0136] Based on the target lane line in the target lane line image, determining multiple pairs of feature point values;
[0137] Obtain a preset lane line equation, where the lane line equation is a network loss function in a lane line detection network;
[0138] Based on multiple pairs of feature point values and preset lane line equations, the network loss is determined.
[0139] In a possible implementation, determining a target lane line image based on an initial lane line image includes:
[0140] Identify a first lane line in an initial lane line image;
[0141] Configure a corresponding second lane line for the first lane line, and obtain a target lane line image based on the first lane line and the second lane line;
[0142] The target lane line includes a first lane line and a second lane line, the first lane line represents a lane line composed of a lane line true value, and the second lane line represents a lane line composed of a lane line detection value.
[0143] In a possible implementation, based on the target lane line in the target lane line image, multiple pairs of feature point values are determined, including:
[0144] Extracting a plurality of first feature points from the first lane line to obtain a plurality of true values of the plurality of first feature points, wherein the plurality of first feature points correspond one-to-one to the plurality of true values;
[0145] Extracting a plurality of second feature points on the second lane line to obtain a plurality of detection values of the plurality of second feature points, wherein the plurality of second feature points correspond to the plurality of detection values one by one;
[0146] Multiple pairs of feature points are composed of multiple true values and multiple detection values.
[0147] In a possible implementation, multiple pairs of feature points are formed by multiple true values and multiple detection values, including:
[0148] For each truth value among the multiple truth values, obtain a first feature point corresponding to each truth value;
[0149] For each detection value among the multiple detection values, obtain a second feature point corresponding to each detection value;
[0150] If the first feature point corresponding to each true value matches the second feature point corresponding to each detected value, each true value and each detected value are taken as a pair of feature point values until multiple pairs of feature point values are determined.
[0151] In one possible implementation, the network loss is determined based on multiple pairs of feature point values and a preset lane line equation, including:
[0152] For each pair of feature point values in the plurality of pairs of feature point values, based on each pair of feature point values and a preset lane line, determining an initial error corresponding to each pair of feature points, wherein each pair of feature point values is a value of each pair of feature points;
[0153] Get the initial error weight;
[0154] Based on the initial error weight and the initial error corresponding to each pair of feature points, the target error corresponding to each pair of feature points is calculated;
[0155] The network loss is calculated based on the target error corresponding to each pair of feature points.
[0156] In a possible implementation, based on each pair of feature point values and a preset lane line equation, determining an initial error corresponding to each pair of feature points includes:
[0157] Input each pair of feature point values into the preset lane line equation to obtain the distance error of each pair of feature points;
[0158] The preset lane line equation is derived once, and each pair of feature point values is input into the preset lane line equation after the derivation, so as to obtain the slope error of each pair of feature points;
[0159] The preset lane line equation is derivatized twice, and each pair of feature point values is input into the preset lane line equation after the second derivation to obtain the curvature error of each pair of feature points;
[0160] The initial error corresponding to each pair of feature points is composed of the distance error of each pair of feature points, the slope error of each pair of feature points and the curvature error of each pair of feature points.
[0161] In a possible implementation, the target error corresponding to each pair of feature points is calculated based on the initial error weight and the initial error corresponding to each pair of feature points, including:
[0162] Multiply the distance error of each pair of feature points by the distance weight to obtain the first product;
[0163] Multiply the slope error of each pair of feature points by the slope weight to obtain a second product;
[0164] Multiply the curvature error of each pair of feature points by the curvature weight to obtain the third product;
[0165] The first product, the second product, and the third product are added together to obtain the target error corresponding to each pair of feature points.
[0166] In one possible implementation, the network loss is calculated based on the target error corresponding to each pair of feature points, including:
[0167] Summarize the target errors corresponding to each pair of feature points to obtain multiple target errors;
[0168] Based on multiple objective errors, the network loss is calculated.
[0169] Among them, the readable storage medium can be a computer storage medium or a communication medium. The communication medium includes any medium that facilitates the transmission of a computer program from one place to another. The computer storage medium can be any available medium that can be accessed by a general or special-purpose computer. For example, a readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application-specific integrated circuit (ASIC). In addition, the ASIC can be located in a user device. Of course, the processor and the readable storage medium can also exist in a communication device as discrete components. The readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.
[0170] The present invention also provides a program product, which includes an execution instruction, and the execution instruction is stored in a readable storage medium. At least one processor of a device can read the execution instruction from the readable storage medium, and at least one processor executes the execution instruction so that the device implements a network loss calculation method provided by the various embodiments described above, including:
[0171] Get the initial lane line image;
[0172] Determine a target lane line image based on the initial lane line image;
[0173] Based on the target lane line in the target lane line image, determining multiple pairs of feature point values;
[0174] Obtain a preset lane line equation, where the lane line equation is a network loss function in a lane line detection network;
[0175] Based on multiple pairs of feature point values and preset lane line equations, the network loss is determined.
[0176] In a possible implementation, determining a target lane line image based on an initial lane line image includes:
[0177] Identify a first lane line in an initial lane line image;
[0178] Configure a corresponding second lane line for the first lane line, and obtain a target lane line image based on the first lane line and the second lane line;
[0179] The target lane line includes a first lane line and a second lane line, the first lane line represents a lane line composed of a lane line true value, and the second lane line represents a lane line composed of a lane line detection value.
[0180] In a possible implementation, based on the target lane line in the target lane line image, multiple pairs of feature point values are determined, including:
[0181] Extracting a plurality of first feature points from the first lane line to obtain a plurality of true values of the plurality of first feature points, wherein the plurality of first feature points correspond one-to-one to the plurality of true values;
[0182] Extracting a plurality of second feature points on the second lane line to obtain a plurality of detection values of the plurality of second feature points, wherein the plurality of second feature points correspond to the plurality of detection values one by one;
[0183] Multiple pairs of feature points are composed of multiple true values and multiple detection values.
[0184] In a possible implementation, multiple pairs of feature points are formed by multiple true values and multiple detection values, including:
[0185] For each truth value among the multiple truth values, obtain a first feature point corresponding to each truth value;
[0186] For each detection value among the multiple detection values, obtain a second feature point corresponding to each detection value;
[0187] If the first feature point corresponding to each true value matches the second feature point corresponding to each detected value, each true value and each detected value are taken as a pair of feature point values until multiple pairs of feature point values are determined.
[0188] In one possible implementation, the network loss is determined based on multiple pairs of feature point values and a preset lane line equation, including:
[0189] For each pair of feature point values in the plurality of pairs of feature point values, based on each pair of feature point values and a preset lane line, determining an initial error corresponding to each pair of feature points, wherein each pair of feature point values is a value of each pair of feature points;
[0190] Get the initial error weight;
[0191] Based on the initial error weight and the initial error corresponding to each pair of feature points, the target error corresponding to each pair of feature points is calculated;
[0192] The network loss is calculated based on the target error corresponding to each pair of feature points.
[0193] In a possible implementation, based on each pair of feature point values and a preset lane line equation, determining an initial error corresponding to each pair of feature points includes:
[0194] Input each pair of feature point values into the preset lane line equation to obtain the distance error of each pair of feature points;
[0195] The preset lane line equation is derived once, and each pair of feature point values is input into the preset lane line equation after the derivation, so as to obtain the slope error of each pair of feature points;
[0196] The preset lane line equation is derivatized twice, and each pair of feature point values is input into the preset lane line equation after the second derivation to obtain the curvature error of each pair of feature points;
[0197] The initial error corresponding to each pair of feature points is composed of the distance error of each pair of feature points, the slope error of each pair of feature points and the curvature error of each pair of feature points.
[0198] In a possible implementation, the target error corresponding to each pair of feature points is calculated based on the initial error weight and the initial error corresponding to each pair of feature points, including:
[0199] Multiply the distance error of each pair of feature points by the distance weight to obtain the first product;
[0200] Multiply the slope error of each pair of feature points by the slope weight to obtain a second product;
[0201] Multiply the curvature error of each pair of feature points by the curvature weight to obtain the third product;
[0202] The first product, the second product, and the third product are added together to obtain the target error corresponding to each pair of feature points.
[0203] In one possible implementation, the network loss is calculated based on the target error corresponding to each pair of feature points, including:
[0204] Summarize the target errors corresponding to each pair of feature points to obtain multiple target errors;
[0205] Based on multiple objective errors, the network loss is calculated.
[0206] In the embodiments of the above-mentioned devices, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. The general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc. The steps of the method disclosed in the present invention may be directly embodied as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0207] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention.
Claims
1. A network loss calculation method, characterized in that: include: Get the initial lane line image; Determine a target lane line image based on the initial lane line image; Determining multiple pairs of feature point values based on the target lane line in the target lane line image; Obtaining a preset lane line equation, wherein the lane line equation is a network loss function in a lane line detection network; Based on the multiple pairs of feature point values and the preset lane line equation, a network loss is determined.
2. A network loss calculation method according to claim 1, characterized in that: The determining of the target lane line image based on the initial lane line image comprises: Identifying a first lane line in the initial lane line image; Configuring a corresponding second lane line for the first lane line, and obtaining the target lane line image based on the first lane line and the second lane line; The target lane line includes a first lane line and a second lane line, the first lane line represents a lane line composed of a lane line true value, and the second lane line represents a lane line composed of a lane line detection value.
3. A network loss calculation method according to claim 2, characterized in that: The determining of multiple pairs of feature point values based on the target lane line in the target lane line image includes: Extracting a plurality of first feature points from the first lane line to obtain a plurality of true values of the plurality of first feature points, wherein the plurality of first feature points correspond to the plurality of true values one by one; Extracting a plurality of second feature points on the second lane line to obtain a plurality of detection values of the plurality of second feature points, wherein the plurality of second feature points correspond to the plurality of detection values one by one; The plurality of pairs of feature points are formed by the plurality of true values and the plurality of detected values.
4. A network loss calculation method according to claim 3, characterized in that: The multiple pairs of feature points formed by the multiple true values and the multiple detection values include: For each truth value among the multiple truth values, obtaining a first feature point corresponding to each truth value; For each detection value among the multiple detection values, obtaining a second feature point corresponding to each detection value; If the first feature point corresponding to each true value matches the second feature point corresponding to each detection value, each true value and each detection value are taken as a pair of feature point values until the plurality of pairs of feature point values are determined.
5. A network loss calculation method according to claim 1, characterized in that: The determining of the network loss based on the multiple pairs of feature point values and the preset lane line equation includes: For each pair of feature point values in the plurality of pairs of feature point values, based on each pair of feature point values and the preset lane line equation, determining an initial error corresponding to each pair of feature points, wherein each pair of feature point values is a value of each pair of feature points; Get the initial error weight; Calculating a target error corresponding to each pair of feature points based on the initial error weight and the initial error corresponding to each pair of feature points; The network loss is calculated based on the target error corresponding to each pair of feature points.
6. A network loss calculation method according to claim 5, characterized in that: The determining, based on each pair of feature point values and the preset lane line equation, an initial error corresponding to each pair of feature points includes: Inputting each pair of feature point values into the preset lane line equation to obtain the distance error of each pair of feature points; Derivatively calculating the preset lane line equation, and inputting each pair of feature point values into the preset lane line equation after the derivation, to obtain a slope error of each pair of feature points; Performing a second derivative on the preset lane line equation, and inputting each pair of feature point values into the preset lane line equation after the second derivative, to obtain a curvature error of each pair of feature points; The initial error corresponding to each pair of feature points is constituted by the distance error of each pair of feature points, the slope error of each pair of feature points and the curvature error of each pair of feature points.
7. A network loss calculation method according to claim 6, characterized in that: The calculating the target error corresponding to each pair of feature points based on the initial error weight and the initial error corresponding to each pair of feature points includes: Multiplying the distance error of each pair of feature points by the distance weight to obtain a first product; Multiplying the slope error of each pair of feature points by the slope weight to obtain a second product; Multiplying the curvature error of each pair of feature points by the curvature weight to obtain a third product; The first product, the second product and the third product are added together to obtain a target error corresponding to each pair of feature points.
8. A network loss calculation method according to claim 6, characterized in that: The calculating the network loss based on the target error corresponding to each pair of feature points includes: Summarizing the target errors corresponding to each pair of feature points to obtain multiple target errors; The network loss is calculated based on the multiple target errors.
9. A network loss calculation device, characterized in that: include: A first acquisition module is used to acquire an initial lane line image; A second acquisition module, used to determine a target lane line image based on the initial lane line image; A feature value determination module, used to determine multiple pairs of feature point values based on the target lane line in the target lane line image; A third acquisition module is used to acquire a preset lane line equation, wherein the lane line equation is a network loss function in a lane line detection network; The network loss calculation module determines the network loss based on the multiple pairs of feature point values and the preset lane line equation.
10. A terminal, characterized in that: comprising a memory, and one or more processors communicatively connected to the memory; The memory stores instructions that can be executed by the one or more processors, and the instructions are executed by the one or more processors to enable the one or more processors to implement the network loss calculation method according to any one of claims 1 to 8.
