Sparse criticality prediction model training method, sparse criticality prediction system and sparse criticality prediction method
Through a three-stage training framework, including an unsupervised reward model, an improved two-branch network and dense reinforcement learning, the problem of sample sparsity and imbalance in the prediction of critical safety events in intelligent systems is solved, and a high-precision probabilistic prediction model is achieved.
Patent Information
- Application Number
- CN202410585343.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-11
- Publication Date
- 2024-08-23
AI Technical Summary
Among existing methods for predicting the probability of critical safety events in intelligent systems, indicator-based methods are difficult to design suitable for intelligent systems and have low prediction accuracy; model-based methods are difficult to solve the disaster of sample sparsity, making it difficult to train high-precision models on extremely imbalanced data sets. .
A three-stage training framework is adopted. First, simple negative samples are eliminated through an unsupervised reward model based on ranking loss, and a positive and negative sample set is constructed in the second stage. Then an improved two-branch network is used for supervised classification model training, and finally a dense reinforcement learning method is used. Fine-tune the difficult example classification model to obtain a sparse criticality prediction model.
It effectively solves the sparsity disaster of environmental variables for safety-critical events in intelligent systems, improves the prediction accuracy on extremely unbalanced data sets, and obtains a high-precision probability prediction model for safety-critical events in intelligent systems.
Smart Images

Figure CN118535992A
Abstract
Description
Technical Field
[0001] This article relates to the field of sparse security risk assessment of intelligent systems, and in particular to a sparse criticality prediction model training method, prediction system and method. Background Art
[0002] At present, intelligent systems are increasingly widely used in daily production and life. While various intelligent systems have greatly changed production and lifestyles, they have also brought about various accidents, triggering people's concern about the safety of intelligent systems. Accurately predicting the probability of critical safety events in intelligent systems is of great significance for identifying safety risks of intelligent systems, which can protect the safety of life and property, and further promote the large-scale application and commercialization of intelligent systems. There are currently two main methods for predicting the probability of critical safety events. One is an indicator-based method. Due to the dynamic complexity of intelligent systems, it is difficult to design indicators suitable for intelligent systems, and the existing indicator-based methods have low prediction accuracy. The other is a model-based method, but it is difficult to solve the sparsity disaster problem of samples, resulting in many difficulties in high-precision model training on extremely unbalanced data sets, making it difficult for model-based methods to be applied. Summary of the invention
[0003] The present application provides a sparse criticality prediction model training method, prediction system and method, which can effectively solve the sparsity disaster of environmental variables in critical safety events of intelligent systems, solve the problem that extremely unbalanced data sets are difficult to learn, and obtain a high-precision probability prediction model for critical safety events of intelligent systems.
[0004] On the one hand, an embodiment of the present application provides a sparse criticality prediction model training method, comprising:
[0005] Obtain a training data set, wherein the training data set includes the environment variable X when a critical safety event of the intelligent system occurs i The positive sample set P and the environment variable X when the critical safety event of the intelligent system does not occur i The negative sample set N is composed of;
[0006] Using P and N as input data, the first stage of unsupervised reward model training based on ranking loss is carried out to screen data, exclude simple negative samples in N, and retain false positive samples;
[0007] The second-stage positive sample set P2 is constructed based on the positive sample set P, and the second-stage negative sample set N2 is constructed based on the false positive samples, wherein P2={(X i ,Y i )|Y i =1}, N2 = {(X i ,Yi )|Y i =0};
[0008] Using P2 and N2 as input data, the second-stage supervised classification model based on the improved two-branch network is trained to obtain the hard-example classification model trained in the second stage;
[0009] Get key data, including: all X in P i As the key data, each X in N2 i Input the difficult example classification model for classification prediction. If X i If the prediction is a positive sample, then X i As said key data;
[0010] The key data is used as the third-stage training data, and the hard-case classification model is fine-tuned in the third stage based on the dense reinforcement learning method to improve the classification accuracy, so as to obtain a trained sparse criticality prediction model.
[0011] On the other hand, the embodiment of the present application further provides a sparse criticality prediction system, including: a test data acquisition module and a sparse criticality prediction model obtained based on the sparse criticality prediction model training method described in the above embodiment;
[0012] The test data acquisition module is used to obtain the actual environment X of the critical safety event of the intelligent system;
[0013] The sparse criticality prediction model is used to predict the occurrence probability of a safety-critical event in the actual environment X, wherein the occurrence probability is the probability of predicting X as a positive sample.
[0014] On the other hand, an embodiment of the present application further provides a sparse criticality prediction method, which is performed by the sparse criticality prediction system described in the above embodiment, and includes:
[0015] Acquire the actual environment X of the critical safety events of the intelligent system based on the test data acquisition module;
[0016] X is input into the sparse criticality prediction model to predict the occurrence probability of a safety-critical event in the actual environment X, wherein the occurrence probability is the probability of predicting X as a positive sample.
[0017] Compared with the related art, the embodiments of the present application provide a sparse criticality prediction model training method, prediction system and method. The sparse criticality prediction model training method is based on a three-stage training framework. Through the first stage of training an unsupervised reward model based on ranking loss, simple negative samples are eliminated, greatly reducing the imbalance of the training data set. The second stage of training a supervised classification model based on an improved two-branch network focuses on the fine classification of difficult examples to obtain a difficult example classification model. Then, through the third stage fine-tuning of the difficult example classification model based on an intensive reinforcement learning method to improve the classification accuracy, a sparse criticality prediction model is obtained. The training process can effectively solve the sparsity disaster of environmental variables of safety-critical events in intelligent systems, solve the problem that extremely unbalanced data sets are difficult to learn, and obtain a high-precision probability prediction model for safety-critical events in intelligent systems.
[0018] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by implementing the present application. Other advantages of the present application can be realized and obtained by the schemes described in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The accompanying drawings are used to provide an understanding of the technical solution of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application and do not constitute a limitation on the technical solution of the present application.
[0020] Figure 1 is a flow chart of a sparse criticality prediction model training method according to an embodiment of the present application;
[0021] Figure 2 is a schematic diagram of a sparse criticality prediction system according to an embodiment of the present application;
[0022] Figure 3 is a flow chart of a sparse criticality prediction method according to an embodiment of the present application;
[0023] Figure 4 It is a schematic diagram of the training effect of the unsupervised reward model based on sorting loss in the first stage of a specific example of this application;
[0024] Figure 5 It is a schematic diagram of the ROC curve of a specific example of this application;
[0025] Figure 6 It is a schematic diagram of the PR curve of a specific example of this application. DETAILED DESCRIPTION
[0026] The present application describes multiple embodiments, but the description is exemplary rather than restrictive, and it is obvious to those skilled in the art that there may be more embodiments and implementations within the scope of the embodiments described in the present application. Although many possible feature combinations are shown in the drawings and discussed in the specific embodiments, many other combinations of the disclosed features are also possible. Unless specifically limited, any feature or element of any embodiment may be used in combination with any other feature or element in any other embodiment, or may replace any other feature or element in any other embodiment.
[0027] The present application includes and contemplates combinations of features and elements known to those of ordinary skill in the art. The embodiments, features and elements disclosed in the present application may also be combined with any conventional features or elements to form a unique invention scheme defined by the claims. Any features or elements of any embodiment may also be combined with features or elements from other invention schemes to form another unique invention scheme defined by the claims. Therefore, it should be understood that any feature shown and / or discussed in the present application may be implemented individually or in any appropriate combination. Therefore, except for the limitations made according to the attached claims and their equivalents, the embodiments are not subject to other restrictions. In addition, various modifications and changes may be made within the scope of protection of the attached claims.
[0028] In addition, when describing representative embodiments, the specification may have presented the method and / or process as a specific sequence of steps. However, to the extent that the method or process does not rely on the specific order of the steps described herein, the method or process should not be limited to the steps of the specific order described. As will be understood by those of ordinary skill in the art, other sequences of steps are also possible. Therefore, the specific sequence of the steps set forth in the specification should not be interpreted as a limitation to the claims. In addition, the claims for the method and / or process should not be limited to the steps of performing them in the order written, and those skilled in the art can easily understand that these sequences can be changed and still remain within the spirit and scope of the embodiments of the present application.
[0029] The present application embodiment provides a sparse criticality prediction model training method, such as Figure 1 As shown, steps S100-S600 are included:
[0030] S100: Acquire a training data set, wherein the training data set includes the environment variable X when a critical safety event of the intelligent system occurs. i The positive sample set P and the environment variable X when the critical safety event of the intelligent system does not occur i The negative sample set N is composed of;
[0031] S200: Using P and N as input data, the first stage of unsupervised reward model training based on ranking loss is performed to screen data, exclude simple negative samples in N, and retain false positive samples;
[0032] S300: construct a second-stage positive sample set P2 based on the positive sample set P, and construct a second-stage negative sample set N2 based on the false positive samples, wherein P2={(X i ,Y i )|Y i =1}, N2 = {(X i ,Y i )|Y i =0};
[0033] S400: using P2 and N2 as input data, training the second-stage supervised classification model based on the improved two-branch network is performed to obtain the hard-example classification model trained in the second stage;
[0034] S500: Get key data, including: all X in P i As the key data, each X in N2 i Input the difficult example classification model for classification prediction. If X i If the prediction is a positive sample, then X i As said key data;
[0035] S600: Using the key data as the third-stage training data, performing third-stage fine-tuning on the hard-case classification model based on the dense reinforcement learning method to improve classification accuracy, and obtaining a trained sparse criticality prediction model.
[0036] In this embodiment, the criticality refers to the intelligent system in the environment X i The probability of a safety-critical event occurring under the condition of X is extremely low compared with the probability of a safety-critical event not occurring, which results in the number of samples in the positive sample set P obtained in step S100 being much smaller than the number of samples in the negative sample set N, causing an extremely unbalanced sparsity disaster in the training data set; and because the intelligent system and the environment X i The existence of high temporal and spatial complexity makes the training data set have high-dimensional characteristics, which brings about the dimensionality disaster. Based on the characteristics of the training data set, this embodiment trains the sparse criticality prediction model based on a three-stage training framework.
[0037] In this embodiment, step S200 is intended to exclude simple negative samples, where the simple negative samples are samples in which obviously no safety-critical events occur. Step S200 reduces the imbalance of the training data set. In the process of excluding simple negative samples in N, a sparsity threshold can be set, and the sparsity can be calculated in real time according to the formula IR=|N| / |P|. When the calculated sparsity is less than or equal to the sparsity threshold, step S200 is terminated, and the samples finally retained in N are false positive samples. The false positive samples and the positive sample set P are collectively regarded as difficult examples, and the difficult examples are used as the basis for constructing the second-stage training data set.
[0038] In this embodiment, step S300 is used to construct a training data set for the second stage, introducing the variable Y i As the true label, it is convenient for the second stage of supervised classification model training, Y i =1 means a safety critical event occurs, Y i =0 represents that no safety-critical event occurs; based on the second-stage positive sample set P2 and the second-stage negative sample set N2 constructed in step S300, the second-stage supervised classification model based on the improved two-branch network is trained to obtain a difficult example classification model. The second-stage training focuses on learning difficult examples. Compared with the unsupervised reward model of the first stage, the prediction accuracy and model complexity of the difficult example classification model trained in the second stage are improved.
[0039] In this embodiment, in order to further improve the prediction accuracy of the hard case classification model trained in the second stage, key data is obtained through step S500, and the key data is the environmental variable X where the security critical event occurs. i ; Ideally, for all X in P i , the hard example classification model should predict it as a positive sample, for all X in N2 i , the hard example classification model should predict it as a negative sample; however, in reality, the hard example classification model obtained by the second stage training may not be able to perfectly predict all training data. In step S500, all X in P i and X in N2 predicted as positive samples by the hard example classification model i Together they serve as key data, and based on the key data, the third stage of fine-tuning based on intensive reinforcement learning is carried out to improve the prediction accuracy of the difficult example classification model.
[0040] In this embodiment, the criticality prediction is converted into a classification problem, and the probability of the prediction being a positive sample output by the sparse criticality prediction model is used as the criticality prediction result.
[0041] The sparse criticality prediction model training method of this embodiment is based on a three-stage training framework. Through the first stage of training of an unsupervised reward model based on ranking loss, simple negative samples are eliminated, which greatly reduces the imbalance of the training data set. The second stage of training a supervised classification model based on an improved two-branch network focuses on the fine classification of difficult examples to obtain a difficult example classification model. Then, through the third stage fine-tuning of the difficult example classification model based on an intensive reinforcement learning method to improve the classification accuracy, a sparse criticality prediction model is obtained. The training process can effectively solve the sparsity disaster of environmental variables of safety-critical events in intelligent systems, solve the problem that extremely unbalanced data sets are difficult to learn, and obtain a high-precision probability prediction model for safety-critical events in intelligent systems.
[0042] In an exemplary embodiment, the intelligent system may be an intelligent unmanned system, and the intelligent unmanned system may include any one or more of a robot, an autonomous vehicle, a drone, an intelligent medical system, an intelligent agricultural system, a smart home system, an intelligent logistics system, an intelligent rocket system, and a face recognition system;
[0043] The safety-critical events of the robot may include any one or more of falls, collisions, electrical hazards, and life injuries;
[0044] The safety-critical events of the autonomous driving vehicle may include any one or more of a collision, a misunderstanding of the traffic environment, and a remote attack by a hacker.
[0045] In this embodiment, the examples for the intelligent unmanned system and the examples for safety-critical events are illustrative descriptions and are not limitations of this application, and will not be elaborated herein.
[0046] In an exemplary embodiment, step S200 may include: looping through steps S210-S230, performing a first iteration training on the unsupervised reward model until the sparsity of the training data set is less than or equal to a sparsity threshold, and obtaining all the false positive samples:
[0047] S210: For each positive sample X in P i , select the corresponding negative sample X in N according to the predetermined strategy i Construct positive and negative sample pairs (x p ,x n ), where x p X in P i , x n X in N i ;
[0048] S220: For each of the positive and negative sample pairs (x p ,x n) perform the following operations respectively: transform the positive and negative sample pairs (x p ,x n ) as the input data of the unsupervised reward model, and obtain the corresponding output scalar; calculate the reward value according to the output scalar and the reward function, compare the reward value and the reward threshold, and when the reward value is less than the reward threshold, the positive and negative sample pairs (x p ,x n ) n As the simple negative sample, it is excluded, otherwise x n Retained in N as the false positive sample;
[0049] S230: Calculate the sparsity of the training data set, determine the relationship between the sparsity and the sparsity threshold, and when the sparsity is greater than the sparsity threshold, perform the first iterative training for the next time.
[0050] In this embodiment, the reward value is calculated to calculate (x p ,x n ) are sorted, and when the reward value is greater than or equal to the reward threshold, it represents the positive and negative sample pairs (x p ,x n ) are closer in sorting distance; when the reward value is less than the reward threshold, it means that the positive and negative sample pairs (x p ,x n ) are far apart; p Negative samples x with a long sorting distance n Excluded as simple negative samples.
[0051] In this embodiment, in order to ensure the recall rate of the difficult example classification model trained in the second stage, the reward threshold cannot be too large, and it is necessary to ensure that enough false positive samples are retained.
[0052] In an exemplary embodiment, the sparsity can be calculated according to the formula IR=|N| / |P|, where IR represents the sparsity, and |N| is the number of false positive samples X in the negative sample set N. i The number of positive samples X in the positive sample set P. i The number of
[0053] In an exemplary embodiment, step S400 may include steps S410-S440:
[0054] S410: Inputting P2 and N2 into the supervised classification model, wherein the supervised classification model includes the two-branch network and a second optimizer;
[0055] Steps S420-S440 are executed in a loop to perform a second iteration training on the supervised classification model until the classification loss is less than or equal to the second preset loss threshold, and the hard example classification model trained in the second stage is obtained and saved:
[0056] S420: Based on the two-branch network, obtain the first feature p corresponding to P2 respectively a The second feature p corresponding to N2 b , and according to the first feature p a And the second feature p b , get the positive and negative category probability vector p;
[0057] S430: Calculating the classification loss according to a classification loss function, wherein parameters of the classification loss function include the positive and negative category probability vector p;
[0058] S440: Determine the relationship between the classification loss and the second preset loss threshold. When the classification loss is greater than the second preset loss threshold, use a second optimizer to update the parameters of the supervised classification model, including updating the parameters of the two-branch network.
[0059] In this embodiment, in step S430, the single classification losses corresponding to each positive and negative category probability vector p can be calculated according to the classification loss function; then the average value of all the single classification losses is calculated to obtain the classification loss.
[0060] In an exemplary embodiment, step S420 may include steps S421-S424:
[0061] S421: According to the upper branch of the two-branch network, class-balanced sampling is performed on P2 and N2 to obtain an upper input sample (x a ,y a ), and based on each of the above input samples (x a ,y a ) performs the first backbone network feature extraction to obtain the first feature p a , wherein the first backbone network feature extraction focuses on positive sample feature learning;
[0062] S422: According to the lower branch of the two-branch network, uniformly sample P2 and N2 to obtain the lower input sample (x b ,y b ), and based on each of the input samples (x b ,y b ) to extract the second backbone network features and obtain the second feature p b , wherein the second backbone network feature extraction focuses on negative sample feature learning;
[0063] S423: Using the regularized linear classification head, the first feature p a And the second feature p b Perform splicing to obtain regularized features;
[0064] S424: using a softmax layer to perform probability distribution calculation on the regularized feature to obtain the positive and negative category probability vector p;
[0065] Wherein, the supervised classification model also includes the linear classification head and the softmax layer.
[0066] In this embodiment, the difficult example classification model trained in the second stage includes a trained two-branch network, a trained linear classification head and a trained softmax layer.
[0067] In this embodiment, step S423 uses a regularized linear classification head to classify the first feature p a And the second feature p b Splicing helps prevent overfitting in the second stage of training of the supervised classification model based on the improved two-branch network, and helps select features that are beneficial to prediction during model training, reduce useless features, and suppress the model's dependence on noise or irrelevant features. It can help improve the robustness of the model and simplify model training, reduce oscillation and gradient explosion problems during model training, help train the model efficiently, improve the generalization ability of the model, and more quickly obtain a difficult example classification model with good classification effect and strong generalization ability.
[0068] In an exemplary embodiment, step S430 may include step S431:
[0069] S431: According to the classification loss function L=L a (p,y a )+L b (p,y b ) calculates the classification loss, where L a is the focal loss function, L b is the cross entropy loss function.
[0070] In this embodiment, the classification loss function is the focal loss function L a And the cross entropy loss function L b The sum of L a and L b The features of interest in the positive and negative category probability vectors p are different, which optimizes the guidance effect of the classification loss function on the second stage model training, and the two loss functions L a and L bThe combination of plays a role of further regularization, controls the complexity of the model and prevents overfitting, reduces the local optimal solution in the training process, and is more suitable for the criticality prediction needs of intelligent systems.
[0071] In this embodiment, the focus loss function L a The weight of easy-to-classify samples can be reduced and the weight of difficult samples can be increased, which helps to obtain a difficult case classification model with higher classification accuracy. The cross entropy loss function L b It can reduce the difference between the model output and the true label Y during training. i The gap between them prompts the model to learn more accurate classification boundaries, thereby improving the performance of the difficult example classification model in performing classification tasks.
[0072] In an exemplary embodiment, step S600 may include steps S610-S640:
[0073] S610: Converting the hard example classification model into an initial offline deep Q network, where the initial offline deep Q network is a current offline deep Q network corresponding to the first iterative training in the third iterative training;
[0074] Steps S620-S640 are executed in a loop, and the third iterative training is performed on the current offline deep Q network until the third loss is less than or equal to the third preset loss threshold, and the trained sparse criticality prediction model is obtained and saved:
[0075] S620: Using the key data as input data, training the current offline deep Q network, and calculating a Q value corresponding to the current offline deep Q network, wherein the Q value is a probability that the prediction result is a positive sample;
[0076] S630: Calculate the third loss according to a Q loss function, wherein a parameter of the Q loss function includes the Q value;
[0077] S640: Determine the relationship between the third loss and the third preset loss threshold. When the third loss is greater than the third preset loss threshold, use a third optimizer to update the parameters of the linear classification head and the softmax layer, and update the current offline deep Q network accordingly.
[0078] In this embodiment, the third stage fine-tuning only fine-tunes the linear classification head and the softmax layer, which are the last two layers of the difficult example classification model.
[0079] In this embodiment, all key data constitute a key data set D. Any key data X ican be expressed as (s,a,r,s′), where s represents the current state; a represents the current action; r represents the current reward. i When from P, r = 1, when the key data X i When coming from N2, r=0, s′ represents the next state.
[0080] In this embodiment, the Q loss function is Where y = r + γmax a′ Q(s′,a′;θ k ),γ represents the discount factor,θ k represents the parameters of the offline deep Q network updated by the third optimizer during the k-1th third iteration training, max a′ Q(s′,a′;θ k ) represents the maximum Q value obtained by the target network under the next state s′ and the next action a′, Q(s,a;θ k ) represents the Q value of the prediction network under the current state s and the current action a, Indicates all key data X i The set of current states s; Represents the indicator function, which is a function of the current state s. The key data X corresponding to the current state s i From P Take 1, the key data X corresponding to the current state s i From N2 Take 0.
[0081] The present application also provides a sparse criticality prediction system. Figure 2 As shown, it includes a test data acquisition module and a sparse criticality prediction model obtained based on the sparse criticality prediction model training method described in the above embodiment;
[0082] The test data acquisition module is used to obtain the actual environment X of the critical safety event of the intelligent system;
[0083] The sparse criticality prediction model is used to predict the occurrence probability of a safety-critical event in the actual environment X, wherein the occurrence probability is the probability of predicting X as a positive sample.
[0084] The present application also provides a sparse criticality prediction method, such as Figure 3 As shown, the sparse criticality prediction system described in the above embodiment is executed, including steps S700-S800:
[0085] S700: Acquire an actual environment X of a critical safety event of the intelligent system based on a test data acquisition module;
[0086] S800: Input X into a sparse criticality prediction model to predict the occurrence probability of a safety-critical event in the actual environment X, wherein the occurrence probability is the probability of predicting X as a positive sample.
[0087] In order to illustrate the technical effects of the embodiments of the present application, a specific example is used below to describe in detail the application effects of the sparse criticality prediction model training method and the sparse criticality prediction method of the present application.
[0088] The intelligent system in this example is an intelligent rocket system. The safety-critical event is the rocket touching the lunar surface. The training data set is obtained based on the standardized environment Lunar Lander in the open source reinforcement learning algorithm toolkit Gym, including a positive sample set P and a negative sample set N. Each environmental variable X in the training data set i All include the current state s and the current action a, where the current state s includes the rocket coordinates, linear velocity, angular velocity, wind force, etc.; get all environmental variables X i Afterwards, the sparsity of the training data set is calculated according to the formula IR = |N| / |P|, and the initial sparsity is 12600.
[0089] With P and N as input data, the first stage of unsupervised reward model training based on ranking loss is carried out to screen data, exclude simple negative samples in N, and retain false positive samples; in this example, during the training process, the reward threshold is set to 4.1, and negative samples with reward values less than 4.1 are excluded as simple negative samples, such as Figure 4 As shown in the figure, after the first stage of training, most of the simple negative samples in the negative sample set N are excluded, and only the false positive samples with reward values greater than or equal to 4.1 and the positive samples in P are retained. The sparsity of the training data set is recalculated and the obtained sparsity is 3, which greatly reduces the sparsity of the training data set.
[0090] The second-stage positive sample set P2 is constructed based on the positive sample set P, and the second-stage negative sample set N2 is constructed based on the false positive samples, wherein P2={(X i ,Y i )|Y i =1}, N2 = {(X i ,Y i )|Y i =0}.
[0091] Test 1: Replace X in P2 and N2 i, respectively input the hard example classification model stage1+2 trained in the second stage and the sparse criticality prediction model stage1+2+3 trained in three stages to perform criticality prediction. The accuracy of the criticality prediction results is shown in Table 1. It can be seen from Table 1 that the prediction results of the sparse criticality prediction model after three-stage training are further improved compared with the hard example classification model, indicating that the third stage fine-tuning based on the intensive reinforcement learning method is effective, which further improves the classification accuracy of the hard example classification model.
[0092] Table 1 Accuracy of criticality prediction results
[0093] Input Data Hard example classification model stage1+2 Sparse criticality prediction model stage1+2+3 <![CDATA[X in P2 i > 99.13% 99.27% <![CDATA[X in N2 i > 98.41% 99.06%
[0094] Test 2: Replace X in P2 and N2 i , respectively input the hard example classification model stage1+2 trained in the second stage of this application and the sparse criticality prediction model stage1+2+3 trained in three stages, and at the same time, the X in P2 and N2 i Three traditional models are input respectively, including the B original two-branch network model (BBN, full name Bilateral-Branch Network), the class balance score model (CBS, full name Class Balance Score Model), and the decoupled training model (DT, full name Decoupled Training Model) for criticality prediction. The comparison of prediction results is shown in the figure below. Figure 5 and Figure 6 shown.
[0095] Figure 5 This is a comparison chart of ROC curves (full name Receiver Operating Characteristic Curve), with the horizontal axis being the false positive rate (FPR, full name False Positive Rate), and the vertical axis being the true positive rate (TPR, full name True Positive Rate). The points on the ROC curve are obtained based on different binary classification thresholds, and the area under each ROC curve is calculated to obtain the corresponding AUC (full name Area Under the Curve). The closer the AUC is to 1, the better the classification performance of the model is. Among them, the AUC corresponding to the ROC curve of the sparse criticality prediction model stage1+2+3 is 0.9853, the AUC corresponding to the ROC curve of the difficult example classification model stage1+2 is 0.9612, the AUC corresponding to the ROC curve of BBN is 0.8325, the AUC corresponding to the ROC curve of CBS is 0.7267, and the AUC corresponding to the ROC curve of DT is 0.7412.
[0096] Figure 6 This is a PR curve (full name Precision-Recall Curve) comparison chart, the horizontal axis is the recall rate Recall, the vertical axis is the precision rate Precision, the points on the PR curve are obtained based on different binary classification thresholds, among which the sparse criticality prediction model stage1+2+3 has higher precision and recall rates than the three traditional models BBN, CBS and DT under different binary classification thresholds.
[0097] In summary, the difficult example classification model stage1+2 and the sparse criticality prediction model stage1+2+3 obtained by the embodiment of the present application have higher recall rate and precision rate than the other three traditional models, and the classification performance of stage1+2+3 is superior to that of stage1+2.
[0098] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all components may be implemented as software executed by a processor, such as a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.
Claims
1. A sparse criticality prediction model training method, characterized in that: include: Obtain a training data set, wherein the training data set includes the environment variable X when a critical safety event of the intelligent system occurs i The positive sample set P and the environment variable X when the critical safety event of the intelligent system does not occur i The negative sample set N is composed of; Using P and N as input data, the first stage of unsupervised reward model training based on ranking loss is carried out to screen data, exclude simple negative samples in N, and retain false positive samples; The second-stage positive sample set P2 is constructed based on the positive sample set P, and the second-stage negative sample set N2 is constructed based on the false positive samples, wherein P2={(X i ,Y i )|Y i =1}, N2 = {(X i ,Y i )|Y i =0}; Using P2 and N2 as input data, the second-stage supervised classification model based on the improved two-branch network is trained to obtain the hard-example classification model trained in the second stage; Get key data, including: all X in P i As the key data, each X in N2 i Input the difficult example classification model for classification prediction. If X i If the prediction is a positive sample, then X i As said key data; The key data is used as the third-stage training data, and the hard-case classification model is fine-tuned in the third stage based on the dense reinforcement learning method to improve the classification accuracy, so as to obtain a trained sparse criticality prediction model.
2. The sparse criticality prediction model training method according to claim 1, characterized in that: The intelligent system is an intelligent unmanned system, which includes any one or more of a robot, an autonomous vehicle, an unmanned aerial vehicle, an intelligent medical system, an intelligent agricultural system, a smart home system, an intelligent logistics system, an intelligent rocket system, and a face recognition system; The safety-critical events of the robot include any one or more of falls, collisions, electrical hazards, and life injuries; The safety-critical events of the autonomous driving vehicle include any one or more of a collision, a misunderstanding of the traffic environment, and a remote attack by a hacker.
3. The sparse criticality prediction model training method according to claim 1, characterized in that: The first stage of training the unsupervised reward model based on sorting loss is carried out using P and N as input data, and data screening is performed to exclude simple negative samples in N and retain false positive samples, including: The following steps are executed in a loop to perform a first iteration training on the unsupervised reward model until the sparsity of the training data set is less than or equal to the sparsity threshold, and all the false positive samples are obtained: For each positive sample X in P i , select the corresponding negative sample X in N according to the predetermined strategy i Construct positive and negative sample pairs (x p ,x n ), where x p X in P i , x n X in N i ; For each of the positive and negative sample pairs (x p ,x n ) perform the following operations respectively: transform the positive and negative sample pairs (x p ,x n ) as the input data of the unsupervised reward model, and obtain the corresponding output scalar; calculate the reward value according to the output scalar and the reward function, compare the reward value and the reward threshold, and when the reward value is less than the reward threshold, the positive and negative sample pairs (x p ,x n ) n As the simple negative sample, it is excluded, otherwise x n Retained in N as the false positive sample; The sparsity of the training data set is calculated, and the relationship between the sparsity and the sparsity threshold is determined. When the sparsity is greater than the sparsity threshold, the first iterative training is performed for the next time.
4. The sparse criticality prediction model training method according to claim 3, characterized in that: The calculating the sparsity of the training data set includes: The sparsity is calculated according to the formula IR=|N| / |P|, where IR represents the sparsity, and |N| is the false positive sample X in the negative sample set N. i The number of positive samples X in the positive sample set P. i The number of 5. The sparse criticality prediction model training method according to claim 1, characterized in that: The method uses P2 and N2 as input data to train the supervised classification model based on the improved two-branch network in the second stage, and obtains the hard case classification model trained in the second stage, including: Inputting P2 and N2 into the supervised classification model, wherein the supervised classification model includes the two-branch network and a second optimizer; The following steps are executed in a loop to perform a second iteration of training on the supervised classification model until the classification loss is less than or equal to a second preset loss threshold, and the hard example classification model trained in the second stage is obtained and saved: Based on the two-branch network, the first feature p corresponding to P2 is obtained respectively a The second feature p corresponding to N2 b , and according to the first feature p a And the second feature p b , get the positive and negative category probability vector p; Calculating the classification loss according to a classification loss function, wherein parameters of the classification loss function include the positive and negative class probability vectors p; Determine the relationship between the classification loss and the second preset loss threshold, and when the classification loss is greater than the second preset loss threshold, use a second optimizer to update the parameters of the supervised classification model, including updating the parameters of the two-branch network.
6. The sparse criticality prediction model training method according to claim 5, characterized in that: Based on the two-branch network, the first feature p corresponding to P2 is obtained respectively a The second feature p corresponding to N2 b , and according to the first feature p a And the second feature p b , we get the positive and negative category probability vector p, including: According to the upper branch of the two-branch network, class-balanced sampling is performed on P2 and N2 to obtain the upper input sample (x a ,y a ), and based on each of the above input samples (x a ,y a ) performs the first backbone network feature extraction to obtain the first feature p a , wherein the first backbone network feature extraction focuses on positive sample feature learning; According to the lower branch of the two-branch network, P2 and N2 are uniformly sampled to obtain the lower input sample (x b ,y b ), and based on each of the input samples (x b ,y b ) to extract the second backbone network features and obtain the second feature p b , wherein the second backbone network feature extraction focuses on negative sample feature learning; Using the regularized linear classification head, the first feature p a And the second feature p b Perform splicing to obtain regularized features; A softmax layer is used to calculate the probability distribution of the regularized feature to obtain the positive and negative category probability vector p; Wherein, the supervised classification model also includes the linear classification head and the softmax layer.
7. The sparse criticality prediction model training method according to claim 6, characterized in that: The calculating the classification loss according to the classification loss function includes: According to the classification loss function L=L a (p,y a )+L b (p,y b ) calculates the classification loss, where L a is the focal loss function, L b is the cross entropy loss function.
8. The sparse criticality prediction model training method according to claim 6, characterized in that: The method of using the key data as the third-stage training data, performing the third-stage fine-tuning based on the intensive reinforcement learning method to improve the classification accuracy of the hard case classification model, and obtaining a trained sparse key prediction model includes: Converting the hard example classification model into an initial offline deep Q network, where the initial offline deep Q network is a current offline deep Q network corresponding to the first iterative training in the third iterative training; The following steps are executed in a loop to perform the third iterative training on the current offline deep Q network until the third loss is less than or equal to the third preset loss threshold, and the trained sparse criticality prediction model is obtained and saved: Using the key data as input data, training the current offline deep Q network, and calculating a Q value corresponding to the current offline deep Q network, wherein the Q value is a probability that the prediction result is a positive sample; Calculating the third loss according to a Q loss function, wherein parameters of the Q loss function include the Q value; Determine the relationship between the third loss and the third preset loss threshold. When the third loss is greater than the third preset loss threshold, use a third optimizer to update the parameters of the linear classification head and the softmax layer, and update the current offline deep Q network accordingly.
9. A sparse criticality prediction system, characterized in that: include: A test data acquisition module and a sparse criticality prediction model obtained based on the sparse criticality prediction model training method according to any one of claims 1 to 8; The test data acquisition module is used to obtain the actual environment X of the critical safety event of the intelligent system; The sparse criticality prediction model is used to predict the occurrence probability of a safety-critical event in the actual environment X, wherein the occurrence probability is the probability of predicting X as a positive sample.
10. A sparse criticality prediction method, characterized in that: The method is performed by the sparse criticality prediction system of claim 9, comprising: Acquire the actual environment X of the critical safety events of the intelligent system based on the test data acquisition module; X is input into the sparse criticality prediction model to predict the occurrence probability of a safety-critical event in the actual environment X, wherein the occurrence probability is the probability of predicting X as a positive sample.
Citation Information
Cited By
Model training method, joint safety identification method of humanoid robot and related equipment
CN120901960A
A model training method, a joint safety identification method of a humanoid robot and related equipment
CN120901960B
