Method, device, vehicle and medium for neural network threshold determination and dynamic adjustment

By acquiring data about the vehicle's surrounding environment, determining the current scene, and correcting the neural network threshold, the problem of the difficulty in quickly determining and dynamically adjusting the neural network threshold is solved, thus improving the model's performance in different scenarios.

CN117454929BActive Publication Date: 2026-07-10CHERY AUTOMOBILE CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHERY AUTOMOBILE CO LTD
Filing Date
2023-10-25
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

In existing technologies, the threshold of neural network output is difficult to determine quickly, and once determined, it cannot be dynamically adjusted according to the scenario, affecting the model's performance in different scenarios.

Method used

By acquiring the surrounding environment data of the current vehicle, the current scene is determined, and the optimal initial threshold of the target neural network model is obtained based on the current scene. The threshold is then corrected using a preset auxiliary neural network model to obtain the final threshold.

Benefits of technology

It improves the performance of neural network models in different scenarios and solves the problem of difficulty in quickly determining and dynamically adjusting thresholds.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117454929B_ABST
    Figure CN117454929B_ABST
Patent Text Reader

Abstract

This application relates to the field of neural network technology, and in particular to a method, apparatus, vehicle, and medium for determining and dynamically adjusting a neural network threshold. The method includes: acquiring surrounding environment data of the current vehicle; determining the current scene of the current vehicle based on the surrounding environment data, and obtaining the optimal initial threshold corresponding to the target neural network model based on the current scene; inputting the surrounding environment data into a preset auxiliary neural network model to obtain a threshold correction value corresponding to the current scene, and obtaining the final threshold corresponding to the target neural network model in the current scene based on the threshold correction value and the optimal initial threshold. Therefore, by training the target neural network model and correcting the preset auxiliary neural network model, the problems of difficulty in quickly determining the reference threshold of the neural network output and the inability to dynamically adjust the reference threshold according to scene changes after it is determined are solved, thereby improving the model's performance in different scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of neural network technology, and in particular to a method, apparatus, vehicle, and medium for determining and dynamically adjusting neural network thresholds. Background Technology

[0002] In recent years, with the rapid development of artificial intelligence technology, autonomous driving technology has gradually permeated our lives, becoming a brand-new driving concept and method. The foundation of autonomous driving technology is algorithms, among which neural network-based algorithms have become the core of perception algorithms.

[0003] In related technologies, the industry's common solution is to collect a batch of business-related data, construct a neural network structure that meets the hardware's capabilities and train it, solidify the neural network based on the training results and determine a reasonable threshold, and finally complete the operation on the designated device.

[0004] However, the output of neural networks often suffers from problems such as the difficulty in quickly determining the output threshold, which requires experience and testing with a large amount of data to determine; moreover, due to the non-fixed training scenarios, it is difficult to dynamically adjust the threshold according to the scenario after it is determined, which urgently needs to be solved. Summary of the Invention

[0005] This application provides a method, apparatus, vehicle, and medium for determining and dynamically adjusting the threshold of a neural network, in order to solve the problems of difficulty in quickly determining the reference threshold of the neural network output and the inability to dynamically adjust the reference threshold according to the scenario after it is determined, thereby improving the performance of the model in different scenarios.

[0006] The first aspect of this application provides a method for determining and dynamically adjusting a neural network threshold, including the following steps:

[0007] Obtain data on the surrounding environment of the current vehicle;

[0008] The current scene of the vehicle is determined based on the surrounding environment data, and the optimal initial threshold corresponding to the target neural network model is obtained based on the current scene; and

[0009] The surrounding environment data is input into a preset auxiliary neural network model to obtain the threshold correction value corresponding to the current scene, and the final threshold corresponding to the target neural network model in the current scene is obtained based on the threshold correction value and the optimal initial threshold.

[0010] According to one embodiment of this application, obtaining the optimal initial threshold corresponding to the target neural network model based on the current scenario includes:

[0011] Based on the current scenario, obtain a test sample set;

[0012] The test sample set is input into the target neural network model to obtain a set of prediction results corresponding to the test sample set;

[0013] Based on the set of prediction results and the true values ​​in the set of test samples, the PR curve of the target neural network model is obtained, and the optimal initial threshold is determined based on the PR curve and the current specified requirements.

[0014] According to one embodiment of this application, obtaining the PR curve of the target neural network model based on the prediction result set and the ground truth values ​​in the test sample set includes:

[0015] Based on the set of predicted results and the true values ​​in the test sample set, calculate the classification result of the target neural network model in the test sample set;

[0016] Based on the classification results, calculate the precision and recall of the target neural network model;

[0017] The precision and recall rates are used to obtain the PR curve of the target neural network model.

[0018] According to one embodiment of this application, determining the optimal initial threshold based on the PR curve and the currently specified requirement includes:

[0019] If the current specified requirement is a specified accuracy rate, then the threshold corresponding to the specified accuracy rate is obtained by reverse calculation based on the PR curve and is the optimal initial threshold.

[0020] If the current specified demand is a specified recall rate, then the threshold corresponding to the specified recall rate is obtained by reverse calculation based on the PR curve and is the optimal initial threshold.

[0021] If the current specified requirement is to specify both precision and recall, then the PR curve is used for reverse calculation to obtain the initial threshold corresponding to the precision when both precision and recall are specified. If the initial threshold is greater than the specified recall, the initial threshold is output as the optimal initial threshold.

[0022] According to one embodiment of this application, the method for determining and dynamically adjusting the neural network threshold further includes:

[0023] If the initial threshold is less than or equal to the specified recall rate, the initial threshold is gradually increased according to a preset rule until the increased initial threshold is greater than the recall rate when both precision and recall are specified. Then, the increased initial threshold is output as the optimal initial threshold.

[0024] According to one embodiment of this application, when gradually increasing the initial threshold according to a preset rule, the method further includes:

[0025] If the initial threshold is increased to a preset value but still cannot meet the requirement of a recall rate greater than that when both precision and recall are specified, then the preset threshold is directly output as the optimal initial threshold.

[0026] The method for determining and dynamically adjusting neural network thresholds according to the embodiments of this application determines the current scene of the vehicle by acquiring surrounding environmental data. Based on the current scene, the optimal initial threshold corresponding to the target neural network model is obtained. The surrounding environmental data is input into a preset auxiliary neural network model to obtain a threshold correction value corresponding to the current scene. Finally, the final threshold corresponding to the target neural network model in the current scene is obtained based on the threshold correction value and the optimal initial threshold. Therefore, by training the target neural network model and correcting it using a preset auxiliary neural network model, the methods solve the problems of difficulty in quickly determining the reference threshold of the neural network output and the inability to dynamically adjust the reference threshold according to the scene after it is determined, thereby improving the model's performance in different scenes.

[0027] A second aspect of this application provides an apparatus for determining and dynamically adjusting a neural network threshold, comprising:

[0028] The acquisition module is used to acquire data about the surrounding environment of the current vehicle.

[0029] The first processing module is configured to determine the current scene of the vehicle based on the surrounding environment data, and based on the current scene, obtain the optimal initial threshold corresponding to the target neural network model; and

[0030] The second processing module is used to input the surrounding environment data into a preset auxiliary neural network model to obtain the threshold correction value corresponding to the current scene, and to obtain the final threshold corresponding to the target neural network model in the current scene based on the threshold correction value and the optimal initial threshold.

[0031] According to one embodiment of this application, the first processing module includes:

[0032] The acquisition unit is used to acquire a test sample set based on the current scenario;

[0033] The input unit is used to input the test sample set into the target neural network model to obtain a set of prediction results corresponding to the test sample set.

[0034] The determining unit is used to obtain the PR curve of the target neural network model based on the prediction result set and the true values ​​in the test sample set, and to determine the optimal initial threshold based on the PR curve and the current specified requirements.

[0035] According to one embodiment of this application, the determining unit is specifically used for:

[0036] Based on the set of predicted results and the true values ​​in the test sample set, calculate the classification result of the target neural network model in the test sample set;

[0037] Based on the classification results, calculate the precision and recall of the target neural network model;

[0038] The precision and recall rates are used to obtain the PR curve of the target neural network model.

[0039] According to one embodiment of this application, the determining unit includes:

[0040] The first determining subunit is used to perform reverse calculation based on the PR curve when the current specified requirement is a specified accuracy rate, and obtain the threshold corresponding to the specified accuracy rate as the optimal initial threshold.

[0041] The second determining subunit is used to perform reverse calculation based on the PR curve when the current specified demand is a specified recall rate, and obtain the threshold corresponding to the specified recall rate as the optimal initial threshold.

[0042] The third determining subunit is used to perform reverse calculation based on the PR curve when the current specified requirement is to specify both precision and recall, to obtain the initial threshold corresponding to the precision when both precision and recall are specified, and to output the initial threshold as the optimal initial threshold when the initial threshold is greater than the specified recall.

[0043] According to one embodiment of this application, the third determining subunit is further configured to:

[0044] When the initial threshold is less than or equal to the specified recall rate, the initial threshold is gradually increased according to a preset rule until the increased initial threshold is greater than the recall rate when both precision and recall are specified. Then, the increased initial threshold is output as the optimal initial threshold.

[0045] According to one embodiment of this application, the third determining subunit is further configured to:

[0046] If increasing the initial threshold to a preset value still fails to achieve a recall rate greater than that required for simultaneously specifying precision and recall, the preset threshold is directly output as the optimal initial threshold.

[0047] The neural network threshold determination and dynamic adjustment apparatus proposed in this application obtains the surrounding environment data of the current vehicle to determine the current scene of the vehicle. Based on the current scene, it obtains the optimal initial threshold corresponding to the target neural network model, inputs the surrounding environment data into a preset auxiliary neural network model to obtain the threshold correction value corresponding to the current scene, and obtains the final threshold corresponding to the target neural network model in the current scene based on the threshold correction value and the optimal initial threshold. Therefore, by training the target neural network model and correcting the preset auxiliary neural network model, it solves the problems of difficulty in quickly determining the reference threshold of the neural network output and the inability to dynamically adjust the reference threshold according to the scene after it is determined, thereby improving the model's performance in different scenes.

[0048] A third aspect of this application provides a vehicle, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being configured to perform a neural network threshold determination and dynamic adjustment method as described in the above embodiments.

[0049] A fourth aspect of this application provides a computer-readable storage medium having a computer program stored thereon, which is executed by a processor to implement the method for determining and dynamically adjusting a neural network threshold as described in the above embodiments.

[0050] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description

[0051] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:

[0052] Figure 1 This is a flowchart of a method for determining and dynamically adjusting a neural network threshold according to an embodiment of this application;

[0053] Figure 2 A schematic diagram of the optimal initial threshold selection process according to an embodiment of this application;

[0054] Figure 3 A schematic diagram illustrating the calculation results of precision and recall according to an embodiment of this application;

[0055] Figure 4 A schematic diagram of a threshold dynamic adjustment process according to an embodiment of this application;

[0056] Figure 5This is a block diagram of a neural network threshold determination and dynamic adjustment device according to an embodiment of this application;

[0057] Figure 6 A schematic diagram of the vehicle structure provided in the application embodiment. Detailed Implementation

[0058] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.

[0059] The following description, with reference to the accompanying drawings, describes a method, apparatus, vehicle, and medium for determining and dynamically adjusting neural network thresholds according to embodiments of this application.

[0060] To address the issues mentioned in the background section regarding the difficulty in quickly determining the reference threshold for neural network output and the inability to dynamically adjust the reference threshold based on the scenario, this application provides a method for determining and dynamically adjusting neural network thresholds. In this method, by acquiring the surrounding environment data of the current vehicle, the current scenario of the vehicle can be determined. Based on the current scenario, the optimal initial threshold corresponding to the target neural network model is obtained. The surrounding environment data is then input into a preset auxiliary neural network model to obtain a threshold correction value corresponding to the current scenario. Finally, based on the threshold correction value and the optimal initial threshold, the final threshold corresponding to the target neural network model in the current scenario is obtained. Therefore, by training the target neural network model and correcting it using the preset auxiliary neural network model, the problems of difficulty in quickly determining the reference threshold for neural network output and the inability to dynamically adjust the reference threshold based on the scenario are solved, thereby improving the model's performance in different scenarios.

[0061] Specifically, Figure 1 This is a flowchart illustrating a method for determining and dynamically adjusting a neural network threshold, as provided in an embodiment of this application.

[0062] like Figure 1 As shown, the method for determining and dynamically adjusting the threshold of this neural network includes the following steps:

[0063] In step S101, the surrounding environment data of the current vehicle is obtained.

[0064] It is understandable that the current vehicle's surrounding environment data refers to the scene image around the current vehicle, including static environmental elements such as roads, traffic facilities and surrounding landscapes; and dynamic environmental elements such as dynamic signage facilities and dynamic traffic information boards.

[0065] The embodiments of this application can collect real-time data on the vehicle's surrounding environment using devices such as in-vehicle panoramic cameras and visual sensors.

[0066] In step S102, the current scene of the vehicle is determined based on the surrounding environment data, and the optimal initial threshold corresponding to the target neural network model is obtained based on the current scene.

[0067] It is understandable that neural networks (NNs) are complex network systems formed by the extensive interconnection of a large number of simple processing units (called neurons). They reflect many fundamental characteristics of human brain function and are highly complex nonlinear dynamic learning systems. A neural network model is simply a mathematical model, represented by network topology, node characteristics, and learning rules. There are many types of neural network models, such as backpropagation neural networks (BP neural networks), radial basis function neural networks (RBF neural networks), and recurrent neural networks (RNNs). The target neural network model in this application refers to an appropriate neural network model selected by researchers based on the actual research problem, and is not specifically limited here. The optimal initial threshold refers to any value between 0 and 1. For example, in a research problem that requires judging whether the performance of an autonomous vehicle in obstacle detection and avoidance is normal, a threshold needs to be determined according to actual needs. For example, a value greater than or equal to 0.6 is designated as the performance of the autonomous vehicle in obstacle detection and avoidance being normal, and a value less than 0.6 is designated as the performance of the autonomous vehicle in obstacle detection and avoidance being abnormal. Here, 0.6 is the threshold.

[0068] Specifically, in this embodiment of the application, the current scene of the current vehicle's location can be determined based on the surrounding environment data of the current vehicle, and then the optimal initial threshold corresponding to the target neural network model can be obtained based on the current scene.

[0069] To facilitate understanding by those skilled in the art, the following will be combined with Figure 2 and Figure 3 This section details how to obtain the optimal initial threshold for the target neural network model.

[0070] As one possible implementation, in some embodiments, obtaining the optimal initial threshold corresponding to the target neural network model based on the current scenario includes: obtaining a test sample set based on the current scenario; inputting the test sample set into the target neural network model to obtain a prediction result set corresponding to the test sample set; obtaining the PR curve of the target neural network model based on the prediction result set and the true values ​​in the test sample set, and determining the optimal initial threshold based on the PR curve and the currently specified requirements.

[0071] It should be noted that the test sample set can be selected based on the actual research problem. Taking low-speed autonomous driving scenarios as an example, for low-speed autonomous driving, the test sample set includes the coordinate information of parking spaces, wheel chocks, pillars, and ground locks within a range of 15m in front of the vehicle and 10m to the left, right, and rear, all within the vehicle's coordinate system, i.e., the ground truth. The samples in the test sample set can be divided into two main categories: positive samples and negative samples. The ground truth in the test sample set is the actual sample category. The prediction result set refers to the set of predictions that the target neural network model can make after inputting the test sample set into the target neural network model, determining which samples in the test sample set are positive and which are negative, thus obtaining the prediction result set of the target neural network model for the input test sample set. The PR curve refers to the curve formed by P as the vertical axis and R as the horizontal axis, where P is precision and R is recall.

[0072] Specifically, such as Figure 2 As shown, based on the current scenario and the problem to be studied, a corresponding test sample set is obtained. After the test sample set is input into the target neural network model, the target neural network model makes predictions on the test sample set and outputs a set of prediction results corresponding to the test sample set. Then, based on the set of prediction results and the true values ​​in the test sample set, the PR curve of the target neural network model can be obtained. Based on the PR curve and the current specified requirements, the optimal initial threshold corresponding to the target neural network model can be determined.

[0073] Further, in some embodiments, obtaining the PR curve of the target neural network model based on the prediction result set and the ground truth in the test sample set includes: calculating the classification result of the target neural network model in the test sample set based on the prediction result set and the ground truth in the test sample set; calculating the precision and recall of the target neural network model based on the classification result; and obtaining the PR curve of the target neural network model based on the precision and recall.

[0074] It is understandable that precision refers to the accuracy of the prediction of positive samples; recall refers to the proportion of samples that are correctly predicted as positive out of all samples that are actually positive, that is, the probability that a sample that is actually positive is judged as a positive sample.

[0075] Specifically, based on the definition of a classification network, the classification results of the target neural network model in the test sample set can be obtained according to the true values ​​in the prediction result set and the test sample set. These results include TP (True Positive), FP (False Positive), and FN (False Negative). TP refers to a sample that is actually positive but is judged as positive by the target neural network model (i.e., the prediction result is positive). FP refers to a sample that is actually negative but is judged as positive by the target neural network model (i.e., the prediction result is positive), which is a false positive. FN refers to a sample that is actually positive but is judged as negative by the target neural network model (i.e., the prediction result is negative), which is a false negative. Based on the above classification results, the precision and recall of the target neural network model can be calculated according to formulas (1) and (2), such as... Figure 3 As shown, based on the calculated results of precision and recall, combined with the threshold of the target neural network model, which is also an arbitrary value between 0 and 1, each threshold corresponds to a set of precision and recall. By iterating through all values ​​between 0 and 1 (i.e. using computer optimization exhaustive search), the PR curve of the target neural network model can be obtained.

[0076] Precision = TP / (TP + FP) (1)

[0077] Recall = TP / (TP + FN) (2)

[0078] Furthermore, in some embodiments, determining the optimal initial threshold based on the PR curve and the current specified demand includes: if the current specified demand is a specified precision, then performing reverse calculation based on the PR curve to obtain the threshold corresponding to the specified precision as the optimal initial threshold; if the current specified demand is a specified recall, then performing reverse calculation based on the PR curve to obtain the threshold corresponding to the specified recall as the optimal initial threshold; if the current specified demand is to simultaneously specify precision and recall, then performing reverse calculation based on the PR curve to obtain the initial threshold corresponding to the precision when simultaneously specifying precision and recall, and outputting the initial threshold as the optimal initial threshold when the initial threshold is greater than the specified recall.

[0079] It is understood that, in the embodiments of this application, the currently specified requirement may include specifying only precision, specifying only recall, or specifying both precision and recall.

[0080] Specifically, if the current specified requirement is a specified precision, then the threshold corresponding to the specified precision can be used as the optimal initial threshold by reverse calculation based on the PR curve; if the current specified requirement is a specified recall, then the threshold corresponding to the specified recall can be used as the optimal initial threshold by reverse calculation based on the PR curve; if the current specified requirement is both specified precision and recall, then the PR curve is reverse calculated, first using the threshold corresponding to the precision when both precision and recall are specified as the initial threshold, and then determining whether the initial threshold is greater than the specified recall. If the initial threshold is greater than the specified recall, then the initial threshold is used as the optimal initial threshold.

[0081] In addition, in some embodiments, the method further includes: if the initial threshold is less than or equal to the specified recall rate, the initial threshold is gradually increased according to a preset rule until the increased initial threshold is greater than the recall rate when both precision and recall are specified, and then the increased initial threshold is output as the optimal initial threshold.

[0082] Specifically, if the initial threshold is less than or equal to the specified recall rate, the initial threshold can be gradually increased according to the preset rules until the initial threshold is greater than the recall rate when both precision and recall are specified. At this point, the increased initial threshold can be used as the optimal initial threshold.

[0083] Furthermore, in some other embodiments, when gradually increasing the initial threshold according to preset rules, the method further includes: if the initial threshold is increased to a preset value but still cannot meet the requirement of a recall rate greater than that when both precision and recall are specified, then the preset threshold is directly output as the optimal initial threshold.

[0084] Since the initial threshold range is also in the range of [0,1], the upper limit of the initial threshold can be increased to 1 (i.e., the preset value is 1) in this embodiment of the application; the preset threshold refers to the F1 score, which can simultaneously consider precision and recall, so that both reach the highest level and achieve a balance.

[0085] The F1 score is expressed as follows:

[0086] F1 = 2 * Precision * Recall / Precision + Recall (3)

[0087] In other words, if increasing the initial threshold to 1 still fails to achieve a recall rate greater than that required to simultaneously specify precision and recall, then the preset threshold can be directly used as the optimal initial threshold for output.

[0088] It should be noted that the relevant calculations will calculate the results for each specified requirement category, and complete the subsequent result calculations according to the written computer program, so as to conveniently and quickly obtain the optimal initial threshold corresponding to the target neural network model.

[0089] In step S103, the surrounding environment data is input into the preset auxiliary neural network model to obtain the threshold correction value corresponding to the current scene, and the final threshold corresponding to the target neural network model under the current scene is obtained based on the threshold correction value and the optimal initial threshold.

[0090] In this embodiment, the preset auxiliary neural network model refers to the design of auxiliary small grids.

[0091] It is understandable that after determining the optimal initial threshold of the target neural network on a large dataset, if the optimal initial threshold remains fixed when facing long-tail problems in complex situations, it will obviously not be applicable to all scenarios. Therefore, in the embodiments of this application, after obtaining the optimal initial threshold corresponding to the target neural network model, the threshold can be dynamically adjusted for different scenarios by designing an auxiliary small grid.

[0092] Specifically, such as Figure 4 As shown, surrounding environmental data is input into a preset auxiliary neural network model. This preset auxiliary neural network model structure includes two parts: feature extraction and threshold regression (or classification). It can classify the current scene. By using the preset auxiliary neural network model to predict the threshold deviation of the input surrounding environmental data, the threshold correction value corresponding to the current scene can be obtained. Based on the threshold correction value, the optimal initial threshold can be adjusted to obtain the final threshold corresponding to the target neural network model in the current scene. Ultimately, the performance of the target neural network model is improved without optimizing the backbone network structure.

[0093] The final threshold (Score) is expressed as:

[0094] Score=score_base+ score_predict (4)

[0095] Where score_base is the optimal initial threshold and score_predict is the threshold correction value.

[0096] It should be noted that, in order to reduce the computational overhead of the chip, the preset auxiliary neural network model shares the backbone network with the target neural network model; in order to ensure the accuracy of the target neural network model, the preset auxiliary neural network model is fine-tuned again after the target neural network model has converged during training.

[0097] The method for determining and dynamically adjusting neural network thresholds according to the embodiments of this application determines the current scene of the vehicle by acquiring surrounding environmental data. Based on the current scene, the optimal initial threshold corresponding to the target neural network model is obtained. The surrounding environmental data is input into a preset auxiliary neural network model to obtain a threshold correction value corresponding to the current scene. Finally, the final threshold corresponding to the target neural network model in the current scene is obtained based on the threshold correction value and the optimal initial threshold. Therefore, by training the target neural network model and correcting the preset auxiliary neural network model, the problems of difficulty in quickly determining the reference threshold of the neural network output and the inability to dynamically adjust the reference threshold according to the scene after it is determined are solved, thereby improving the model's performance in different scenes.

[0098] Next, with reference to the accompanying drawings, an apparatus for determining and dynamically adjusting a neural network threshold according to an embodiment of this application is described.

[0099] Figure 5 This is a block diagram of a neural network threshold determination and dynamic adjustment device according to an embodiment of this application.

[0100] like Figure 5 As shown, the neural network threshold determination and dynamic adjustment device 10 includes: an acquisition module 100, a first processing module 200, and a second processing module 300.

[0101] The acquisition module 100 is used to acquire the surrounding environment data of the current vehicle.

[0102] The first processing module 200 is used to determine the current scene of the vehicle based on surrounding environmental data, and based on the current scene, obtain the optimal initial threshold corresponding to the target neural network model; and

[0103] The second processing module 300 is used to input surrounding environment data into a preset auxiliary neural network model to obtain the threshold correction value corresponding to the current scene, and to obtain the final threshold corresponding to the target neural network model under the current scene based on the threshold correction value and the optimal initial threshold.

[0104] Furthermore, in some embodiments, the first processing module 200 includes:

[0105] The acquisition unit is used to acquire a test sample set based on the current scenario;

[0106] The input unit is used to input the test sample set into the target neural network model to obtain a set of prediction results corresponding to the test sample set.

[0107] The determination unit is used to obtain the PR curve of the target neural network model based on the set of prediction results and the true values ​​in the set of test samples, and to determine the optimal initial threshold based on the PR curve and the current specified requirements.

[0108] Furthermore, in some embodiments, the determining unit is specifically used for:

[0109] Based on the set of predicted results and the true values ​​in the test sample set, calculate the classification result of the target neural network model in the test sample set;

[0110] Based on the classification results, calculate the precision and recall of the target neural network model;

[0111] The precision and recall rates are used to obtain the PR curve of the target neural network model.

[0112] Furthermore, in some embodiments, the determining unit includes:

[0113] The first determining subunit is used to perform reverse calculation based on the PR curve when the current specified requirement is a specified accuracy rate, and obtain the threshold corresponding to the specified accuracy rate as the optimal initial threshold.

[0114] The second determining subunit is used to perform reverse calculation based on the PR curve when the current specified demand is a specified recall rate, and obtain the threshold corresponding to the specified recall rate as the optimal initial threshold.

[0115] The third determining subunit is used to perform reverse calculation based on the PR curve when the current specified requirement is to specify both precision and recall, to obtain the initial threshold corresponding to the precision when both precision and recall are specified, and to output the initial threshold as the optimal initial threshold when the initial threshold is greater than the specified recall.

[0116] Furthermore, in some embodiments, the third determining subunit is also used for:

[0117] When the initial threshold is less than or equal to the specified recall rate, the initial threshold is gradually increased according to the preset rules until the increased initial threshold is greater than the recall rate when both precision and recall are specified. Then the increased initial threshold is output as the optimal initial threshold.

[0118] Furthermore, in some embodiments, the third determining subunit is also used for:

[0119] If increasing the initial threshold to the preset value still fails to achieve a recall rate greater than that required for both precision and recall, the preset threshold will be directly output as the optimal initial threshold.

[0120] It should be noted that the foregoing explanation of the method embodiment for determining and dynamically adjusting the neural network threshold also applies to the apparatus for determining and dynamically adjusting the neural network threshold in this embodiment, and will not be repeated here.

[0121] The neural network threshold determination and dynamic adjustment apparatus proposed in this application obtains the surrounding environment data of the current vehicle to determine the current scene of the vehicle. Based on the current scene, it obtains the optimal initial threshold corresponding to the target neural network model, inputs the surrounding environment data into a preset auxiliary neural network model to obtain the threshold correction value corresponding to the current scene, and obtains the final threshold corresponding to the target neural network model in the current scene based on the threshold correction value and the optimal initial threshold. Therefore, by training the target neural network model and correcting the preset auxiliary neural network model, it solves the problems of difficulty in quickly determining the reference threshold of the neural network output and the inability to dynamically adjust the reference threshold according to the scene after it is determined, thereby improving the model's performance in different scenes.

[0122] Figure 6 A schematic diagram of the structure of a vehicle provided in an embodiment of this application. The vehicle may include:

[0123] The memory 601, the processor 602, and the computer program stored on the memory 601 and capable of running on the processor 602.

[0124] When the processor 602 executes the program, it implements the method for determining and dynamically adjusting the neural network threshold provided in the above embodiments.

[0125] Furthermore, the vehicle also includes:

[0126] Communication interface 603 is used for communication between memory 601 and processor 602.

[0127] The memory 601 is used to store computer programs that can run on the processor 602.

[0128] The memory 601 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.

[0129] If the memory 601, processor 602, and communication interface 603 are implemented independently, then the communication interface 603, memory 601, and processor 602 can be interconnected via a bus to complete communication between them. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, Figure 6The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0130] Optionally, in a specific implementation, if the memory 601, processor 602, and communication interface 603 are integrated on a single chip, then the memory 601, processor 602, and communication interface 603 can communicate with each other through an internal interface.

[0131] The processor 602 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application.

[0132] This embodiment also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for determining and dynamically adjusting neural network thresholds.

[0133] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0134] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0135] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.

Claims

1. A method for determining and dynamically adjusting a neural network threshold, characterized in that, Includes the following steps: Obtain data on the surrounding environment of the current vehicle; The current scene of the vehicle is determined based on the surrounding environment data, and the optimal initial threshold corresponding to the target neural network model is obtained based on the current scene. as well as The surrounding environment data is input into a preset auxiliary neural network model to obtain the threshold correction value corresponding to the current scene, and the final threshold corresponding to the target neural network model in the current scene is obtained based on the threshold correction value and the optimal initial threshold. The step of obtaining the optimal initial threshold corresponding to the target neural network model based on the current scenario includes: obtaining a test sample set based on the current scenario; inputting the test sample set into the target neural network model to obtain a prediction result set corresponding to the test sample set; obtaining the PR curve of the target neural network model based on the prediction result set and the true values ​​in the test sample set, and determining the optimal initial threshold based on the PR curve and the current specified requirements. The step of obtaining the PR curve of the target neural network model based on the set of prediction results and the ground truth values ​​in the test sample set includes: calculating the classification result of the target neural network model in the test sample set based on the set of prediction results and the ground truth values ​​in the test sample set; calculating the precision and recall of the target neural network model based on the classification result; and obtaining the PR curve of the target neural network model based on the precision and the recall.

2. The method according to claim 1, characterized in that, Determining the optimal initial threshold based on the PR curve and the currently specified requirements includes: If the current specified requirement is a specified accuracy rate, then the threshold corresponding to the specified accuracy rate is obtained by reverse calculation based on the PR curve and is the optimal initial threshold. If the current specified demand is a specified recall rate, then the threshold corresponding to the specified recall rate is obtained by reverse calculation based on the PR curve and is the optimal initial threshold. If the current specified requirement is to specify both precision and recall, then the PR curve is used for reverse calculation to obtain the initial threshold corresponding to the precision when both precision and recall are specified. If the initial threshold is greater than the specified recall, the initial threshold is output as the optimal initial threshold.

3. The method according to claim 2, characterized in that, Also includes: If the initial threshold is less than or equal to the specified recall rate, the initial threshold is gradually increased according to a preset rule until the increased initial threshold is greater than the recall rate when both precision and recall are specified. Then, the increased initial threshold is output as the optimal initial threshold.

4. The method according to claim 3, characterized in that, When gradually increasing the initial threshold according to a preset rule, the method further includes: If the initial threshold is increased to a preset value but still cannot meet the requirement of a recall rate greater than that when both precision and recall are specified, then the preset threshold is directly output as the optimal initial threshold.

5. A device for determining and dynamically adjusting a neural network threshold, characterized in that, include: The acquisition module is used to acquire data about the surrounding environment of the current vehicle. The first processing module is used to determine the current scene of the current vehicle based on the surrounding environment data, and to obtain the optimal initial threshold corresponding to the target neural network model based on the current scene. as well as The second processing module is used to input the surrounding environment data into a preset auxiliary neural network model to obtain the threshold correction value corresponding to the current scene, and to obtain the final threshold corresponding to the target neural network model in the current scene based on the threshold correction value and the optimal initial threshold. The first processing module includes: an acquisition unit, configured to acquire a test sample set based on the current scenario; an input unit, configured to input the test sample set into a target neural network model to obtain a prediction result set corresponding to the test sample set; and a determination unit, configured to obtain the PR curve of the target neural network model based on the prediction result set and the ground truth values ​​in the test sample set, and determine the optimal initial threshold based on the PR curve and the current specified requirements. The determining unit is specifically configured to: calculate the classification result of the target neural network model in the test sample set based on the prediction result set and the ground truth in the test sample set; calculate the precision and recall of the target neural network model based on the classification result; and obtain the PR curve of the target neural network model based on the precision and the recall.

6. A vehicle, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, the processor executing the program to implement the method for determining and dynamically adjusting a neural network threshold as described in any one of claims 1-4.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, The program is executed by the processor to implement the method for determining and dynamically adjusting the neural network threshold as described in any one of claims 1-4.