A method and device for representing attention situations in dynamic decision-making
By constructing and training action classification models and regression models in dynamic decision-making application scenarios, the problem of how to reflect the relevant characteristics of dynamic behavior types through situational elements is solved, efficient dynamic situation representation is achieved, and interpretability and dynamic compatibility are enhanced.
Patent Information
- Application Number
- CN202411687303.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-04-04
AI Technical Summary
In dynamic decision-making application scenarios, how to reflect the relevant characteristics of dynamic behavior types through situational elements.
By building the training data set and dividing it into a training set and a test set, the action classification model and a regression model are obtained. The action classification model is used to predict action types and their confidence, and the regression model is used to obtain the weight of each situation element for the corresponding action type, thereby obtaining dynamic situational representation.
It is realized that in dynamic decision-making application scenarios, situational elements can effectively reflect the relevant characteristics of dynamic behavior types, and enhance the interpretability and dynamic compatibility of situational representation.
Smart Images

Figure CN119760423A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of situation representation, and in particular to a method and device for attention situation representation for dynamic decision-making. Background Art
[0002] Contextual awareness refers to the technology that allows the system to understand and adapt to the operating environment. It plays an important role in improving efficiency, accuracy and user experience in the fields of autonomous driving, unmanned control and equipment operation and maintenance. Contextual representation is one of the key pre-steps to achieve contextual awareness. The purpose is to mine contextual features and convert contextual information into a data form that contains as many contextual features as possible and facilitates further contextual analysis, such as the processing and representation of vehicle and road environment information in autonomous driving scenarios, and the processing and representation of equipment status and process information in the production process.
[0003] With the rapid development of big data analysis technologies such as neural networks, the method of converting context information into vectors in vector space through various means has become the mainstream method of context representation. These vector learning methods often learn vector representations of context information at various granularities by designing various network layers. However, due to the inherent black-box nature of neural networks, the learned vectors are difficult to distinguish the different effects of various context elements, especially in dynamic decision-making application scenarios with time series characteristics such as autonomous driving and unmanned control. The representation of context elements is difficult to explainably reflect the characteristics related to dynamic behavior.
[0004] In view of this, overcoming the defects of the prior art is an urgent problem to be solved in the field of this technology. Summary of the invention
[0005] The problem to be solved by the present invention is: in a dynamic decision-making application scenario, how to reflect the relevant characteristics of the dynamic behavior type through situational elements.
[0006] In a first aspect, a method for representing attention situations for dynamic decision making is provided, comprising:
[0007] Constructing a training data set, and dividing the training data set into a training set and a test set, wherein both the training set and the test set include all situational elements and all action types;
[0008] An action classification model is obtained by training the training set, and a test set is input into the action classification model to obtain prediction results of action types corresponding to different data samples in the test set and corresponding prediction confidences;
[0009] The test set is divided into data according to the action type to obtain a single-type data set for each action type, and a regression model for the corresponding action type is trained according to each single-type data set and the corresponding prediction confidence;
[0010] The situational data to be predicted is input into the action classification model to obtain the corresponding action type, and then the weight of each situational element for the corresponding action type is obtained based on the regression model of the corresponding action type. According to the situational data to be predicted and the weight corresponding to each situational element under the corresponding action type, the dynamic situational representation of the situational data to be predicted is obtained.
[0011] Preferably, the training of the action classification model according to the training set specifically includes:
[0012] Design an action activation function that considers the context characteristics of the time window as a node splitting selection method, train the action classification model on the training set, and use the action activation function to evaluate the impact of information entropy after splitting each context element node in training samples of different action types, and sort all context elements according to the size of action activation;
[0013] The corresponding situational elements are selected in order of action activation from small to large as split nodes. During the training process of the action classification model, the situational element with the smallest action activation is selected for the first split to split the training set. Each subsequent round of splitting selects the corresponding situational elements for splitting in the order of action activation based on the training set after the previous round of splitting until the preset splitting depth is reached or the number of samples in the single subset after the split is less than the preset threshold, thereby completing the training of the action classification model.
[0014] Preferably, the action activation function is:
[0015]
[0016] Among them, S i is the i-th situational factor, DT is the total sample set, Choose(S i ,DT) is the action activation degree of the i-th situational element in the sample set, indicating the basis for split selection, a is the total number of action types, j is the sequence number of the action type, DT j is the sample set of the jth action type, E(S i ,DT j ) is the information entropy of the i-th situational element on the sample set of the j-th action type.
[0017] Preferably, the training of a regression model corresponding to the action type according to each single-type data set and the prediction confidence level specifically includes:
[0018] A situational abnormality function is designed as a node splitting selection method. The situational abnormality is used to evaluate the impact of information entropy after the node splitting of each situational element in a single-type data set, and all situational elements are sorted according to the size of the situational abnormality.
[0019] The corresponding situational elements are selected as splitting nodes in the order of situational abnormality from small to large. The first split is to split the single-type data set into a left subset and a right subset according to the situational element with the smallest situational abnormality. Each subsequent round of splitting selects the corresponding situational elements for splitting in the order of situational abnormality based on the left subset and right subset obtained after the previous round of splitting until the preset splitting depth is reached or the number of single subset samples after the split is less than the preset threshold, completing the training of the regression model of the corresponding action type.
[0020] Preferably, the situation abnormality function is:
[0021] MSE(S i ,DS' j )=wav(S i ,DS' j-left )Avg(S i ,DS' j-left )+wav(S i ,DS' j-right )Avg(S i ,DS' j-right );
[0022] Among them, DS' j is the single-type dataset corresponding to the j-th action type, S i is the i-th situational factor, MSE(S i ,DS' j ) is the selectivity of splitting the i-th situational element in the single-type data set corresponding to the j-th action type, DS' j-left is the left subset formed by the j-th single-type data set after the situational element is split, wav(S i ,DS' j-left ) is the dispersion of the i-th situational factor in the left subset formed by the j-th single-type data set, Avg(S i ,DS' j-left ) is the mean square error of the left subset formed by the j-th single-type data set after splitting with the i-th situational element, DS' j-right is the right subset formed by the j-th single-type data set after the situational element is split, wav(S i ,DS' j-right ) is the dispersion of the i-th situational factor in the right subset formed by the j-th single-type data set, Avg(S i ,DS' j-right) is the mean square error of the right subset formed by the j-th single-type data set after splitting with the i-th situational element.
[0023] Preferably, in the context abnormality function, wav(S i ,DS' j-left )for:
[0024]
[0025] Among them, |DS' j-left | is the number of samples in the left subset formed by the j-th single-type data set after the situational element is split, S iu is the value of the i-th situational factor on the u-th sample; when S i When it is digital, is the average value of the i-th situational element on the left subset, For S iu and The value normalized by the absolute value of the difference between i When it is a vector type, is the average vector of the i-th situational element on the left subset, For S iu and The cosine distance between
[0026] The situation abnormality function Avg(S i ,DS' j-left )for:
[0027]
[0028] Among them, conf j-left,u For DS' j-left The prediction confidence of the u-th sample above, For DS' j-left The average prediction confidence of all samples above.
[0029] Preferably, the step of constructing a training data set and dividing the training data set into a training set and a test set specifically includes:
[0030] For the data of discrete situational elements in the training data set, the action types are classified according to the discrete values;
[0031] For the data of continuous situational elements in the training data set, preprocessing the data of the continuous situational elements according to a clustering algorithm, thereby classifying the data of the continuous situational elements according to preset intervals, so as to convert the data of the continuous situational elements in the training data set into data of discrete situational elements;
[0032] The training dataset is divided into training set and test set.
[0033] Preferably, obtaining the dynamic situational representation of the situational data to be predicted according to the situational data to be predicted and the weight corresponding to each situational element under the corresponding action type specifically includes:
[0034] The corresponding calculation formula is:
[0035]
[0036] Where QS is the dynamic situational representation of the situational data to be predicted, n is the total number of situational elements, and w ij is the weight of the i-th situational factor in the j-th action type, QS i is the embedding vector of the data of the i-th context element in the context data to be predicted.
[0037] In a second aspect, a device for representing an attention situation for dynamic decision-making is provided, comprising at least one processor and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the processor to execute the method for representing an attention situation for dynamic decision-making.
[0038] In a third aspect, the present invention further provides a non-volatile computer storage medium, wherein the computer storage medium stores computer executable instructions, and the computer executable instructions are executed by one or more processors to complete the method described in the first aspect.
[0039] In a fourth aspect, a chip is provided, comprising: a processor and an interface, for calling and running a computer program stored in the memory from a memory, and executing the method of the first aspect.
[0040] According to a fifth aspect, a computer program product comprising instructions is provided. When the instructions are executed on a computer or a processor, the computer or the processor executes the method according to the first aspect.
[0041] In a sixth aspect, a system for attention situation representation for dynamic decision-making is provided, including an attention situation representation device for dynamic decision-making as in the second aspect, and using an attention situation representation method for dynamic decision-making as in the first aspect.
[0042] The present invention provides an attention situation representation method and device for dynamic decision-making, constructs a training data set, and divides the training data set into a training set and a test set, obtains an action classification model according to the training set, inputs the test set into the action classification model, obtains action types and confidences of classification results corresponding to different situation data samples in the test set, divides the test set into data according to action types, obtains a single-type data set for each action type, trains a regression model for each action type according to each single-type data set and the corresponding action classification result confidence, obtains the weight of each situation element for the corresponding action type according to the trained regression model parameters of each action type; in the dynamic decision-making application scenario, the dynamic situation representation of the data content can be obtained through the action classification model and the situation element weight, and the technical effect of integrating the situation feature description of the dynamic behavior type is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0044] Figure 1 A method flow chart of a method for characterizing attention situations for dynamic decision-making provided by an embodiment of the present invention;
[0045] Figure 2 A flowchart of a method for characterizing attention situations for dynamic decision-making provided by an embodiment of the present invention;
[0046] Figure 3 A flowchart of a method for training an action classification model in an attention context representation method for dynamic decision-making provided by an embodiment of the present invention;
[0047] Figure 4 A flowchart of a method for training a regression model in an attention context representation method for dynamic decision-making provided by an embodiment of the present invention;
[0048] Figure 5 A flowchart of a method for obtaining dynamic situation representation in an actual application of a model in a method for attention situation representation for dynamic decision-making provided by an embodiment of the present invention;
[0049] Figure 6 A schematic diagram of an attention context representation device for dynamic decision-making provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0051] In the description of the present invention, it is necessary to understand that the terms "center", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating orientations or positional relationships, are based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present disclosure and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present disclosure.
[0052] In the description of the present invention, the terms "first" and "second" are used only for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present disclosure, unless otherwise specified, the meaning of "multiple" is two or more. In addition, for example, the same type of nouns may be described as two independent individuals by adding "A" and "B" at the end. In this case, the corresponding features defined as "A" and "B" are only used to distinguish the same type of individuals for description purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features.
[0053] As used herein, "about," "substantially," or "approximately" includes the stated value and an average value that is within an acceptable range of deviation from the particular value as determined by one of ordinary skill in the art taking into account the measurements in question and the errors associated with the measurement of the particular quantity (i.e., the limitations of the measurement system).
[0054] Unless the context requires otherwise, throughout the specification and claims, the term "including" is to be interpreted as open inclusion, that is, "including, but not limited to". In the description of the specification, the terms "one embodiment", "some embodiments", "exemplary embodiments", "examples", "specific examples" or "some examples" and the like are intended to indicate that specific features, structures, materials or characteristics associated with the embodiment or example are included in at least one embodiment or example of the present disclosure. The schematic representation of the above terms does not necessarily refer to the same embodiment or example. In addition, the specific features, structures, materials or characteristics may be included in any one or more embodiments or examples in any appropriate manner, that is, although they may be carried in the embodiments or examples of the above terms due to reasons such as the order and position of appearance, it is not limited to that they can be carried in combination by one embodiment or example.
[0055] In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0056] Embodiment 1:
[0057] This embodiment provides an attention context representation method for dynamic decision making, such as Figure 1 As shown, including:
[0058] In step 101, a training data set is constructed and divided into a training set and a test set, wherein both the training set and the test set include all situational elements and all action types.
[0059] In this embodiment, the data content in the training data set can be in the form of: {timestamp, (context element 1, context element 2, ..., context element n), action type}, that is, the data content corresponding to context element 1 to context element n at the corresponding timestamp, and the action type at the corresponding timestamp, context element 1 to context element n are all context elements, and the action type is any one of all action types.
[0060] In step 102, an action classification model is obtained by training the training set, and a test set is input into the action classification model to obtain prediction results of action types corresponding to different data samples in the test set and corresponding prediction confidences.
[0061] In this embodiment, the data content in the training data set can be converted into an embedding vector in advance through a natural language embedding learning model, and then the model is trained or input. Since the data content corresponding to different situational elements may be discrete data or continuous data, for example, weather type, user type, and user occupation, which can be converted into fixed numerical values, are discrete data, and for example, ambient temperature, user instructions, and vehicle speed, which correspond to numbers within a certain range, are continuous data; discrete data can be converted into vector form for subsequent model training, while continuous data cannot be directly converted into vector form. Therefore, before training through the training data set, this embodiment needs to cluster the continuous data in the training data set first, as follows:
[0062] For the data of discrete situational elements in the training data set, the action types are classified according to discrete values; for the data of continuous situational elements in the training data set, the data of the continuous situational elements are preprocessed according to a clustering algorithm, so as to classify the data of the continuous situational elements according to preset intervals, so as to convert the data of the continuous situational elements in the training data set into data of discrete situational elements; the training data set is divided into a training set and a test set.
[0063] Among them, the clustering algorithm can be a mean shift clustering algorithm, that is, according to the distribution of continuous data, the continuous data is divided into multiple intervals, and the data falling into the same preset interval in the continuous data is regarded as the same type of data, and the data value with the largest distribution number in each preset interval is regarded as the representative value of the preset interval. The continuous data is divided into multiple representative values through the above method, thereby preprocessing the continuous data into discrete data.
[0064] In this embodiment, after training, the action classification model is used to predict the situational elements of each group of data content in the input data. For example, in the scenario of autonomous driving, the situational elements include road type, weather conditions, lighting conditions, vehicle status, user instructions and road conditions events, a total of 6 types, and the action types include lane changing, braking, acceleration, deceleration, stopping, turning, starting and obeying traffic signals, a total of 8 types. The action classification model determines whether the corresponding action type is lane changing, braking, acceleration, deceleration, stopping, turning, starting and obeying traffic signals based on the data content corresponding to the road type, weather conditions, lighting conditions, vehicle status, user instructions and road conditions events in the data with the same timestamp.
[0065] In this embodiment, after the action classification model is trained, the test set needs to be input into the trained action classification model to obtain the action types and prediction confidences corresponding to different data samples in the test set, which are used for subsequent training of the regression model. The test set contains multiple data samples, and the data content in each data sample is the same timestamp. Therefore, after each data sample is input into the action classification model, the action type corresponding to the data sample can be obtained. In this embodiment, the confidence of the prediction result of the action type corresponding to the data sample can be obtained by using the posterior probability estimation method, which is the prediction confidence.
[0066] In step 103, the test set is divided into data according to the action type to obtain a single-type data set for each action type, and a regression model for the corresponding action type is trained based on each single-type data set and the corresponding prediction confidence.
[0067] In this embodiment, after the test set is divided into data according to action types, the action types of the data contents in the separated single-type data sets are all the same, that is, the data contents of different situational elements under the same action type. The data contents of a single single-type data set can be expressed as: {timestamp, (situational element 1, situational element 2, ..., situational element n), prediction confidence of the corresponding action type}. By training the single-type data sets of each action type, a regression model of the corresponding action type is obtained. The regression model is only for the corresponding action type, and is used to obtain the judgment weight of each situational element for the corresponding action type. Taking the above-mentioned autonomous driving scenario as an example, for example, in the action type of braking, the judgment weights of road type, weather conditions, lighting conditions, vehicle status, user instructions and road conditions events for braking are obtained respectively through the regression model corresponding to braking.
[0068] In step 104, the situational data to be predicted is input into the action classification model to obtain the corresponding action type, and then the weight of each situational element for the corresponding action type is obtained based on the regression model of the corresponding action type. Based on the situational data to be predicted and the weight corresponding to each situational element under the corresponding action type, the dynamic situational representation of the situational data to be predicted is obtained.
[0069] In this embodiment, after the action classification model and the regression models of each action type are trained, in actual applications, the context element value sequence with a timestamp (i.e., the data content in the context data to be predicted) can be input into the action classification model to obtain the corresponding action type, and then the weights of each context element in the regression model corresponding to the action type are queried, and the weights of each context element are fused to form a dynamic context representation corresponding to the context element value sequence with a timestamp, wherein the dynamic context representation is used to reflect the action type information that the context data to be predicted is most likely to point to. The difference between the dynamic context representation and the action type predicted by the action classification model is that the dynamic context representation contains all action type information within the time interval corresponding to the context data to be predicted. Compared with the single action type output by the action classification model, the dynamic context representation changes dynamically with time.
[0070] In summary, if Figure 2 As shown, it is a flowchart of the method of attention situation representation method for dynamic decision-making. Figure 2 The left frame diagram is a flowchart of training the action classification model and the regression model corresponding to each action type through the training data set. Figure 2 The middle right box diagram is a method box diagram for predicting the prediction situation data and obtaining dynamic situation representation through the trained action classification model and the corresponding regression model.
[0071] The core of constructing an action classification model (i.e., a decision tree) is the selection of split nodes. In this embodiment, the split nodes are to split the data content according to the subtypes of the corresponding contextual elements. For example, the subtypes of road types include Class A roads, Class B roads, and Class C roads. When the contextual element of road type is used as a split node, the data content is divided into three categories according to the subtypes of Class A roads, Class B roads, and Class C roads. If it is necessary to use another contextual element as a split node for chassis splitting, it is necessary to use another subtype of the contextual element as a split node on the basis of the above splitting. Since there are multiple contextual elements, it is necessary to arrange and select the order of the split nodes. After the order of the split nodes is determined, the training of the action classification model can be completed. Figure 3 As shown, this embodiment involves the following designs:
[0072] An action activation function considering the time window situational characteristics is designed as a node splitting selection method, and the action classification model is trained on the training set. The action activation function is used to evaluate the influence of information entropy after splitting of each situational element node in training samples of different action types, and all situational elements are sorted according to the size of action activation.
[0073] In step 201, the training set is substituted into the action activation function to obtain the action activation of each situational element in the training set, and all situational elements are sorted according to the magnitude of the action activation.
[0074] When the action classification model is used for regression problems, information entropy and its derived parameters are usually used as the selection criteria for splitting nodes. In this embodiment, the information entropy of the data sample when splitting at the splitting node corresponding to the situational element is considered. For different predicted action types, the degree of influence of the situational element on the action over a period of time needs to be taken as the determining factor for measuring the effect of node splitting.
[0075] The action activation function is:
[0076]
[0077] Among them, S i is the i-th situational factor, DT is the total sample set, Choose(S i ,DT) is the action activation degree of the i-th situational element in the sample set, indicating the basis for split selection, a is the total number of action types, j is the j-th action type, DT j is the sample set of the jth action type, E(S i ,DT j ) is the information entropy of the i-th situational element on the sample set of the j-th action type.
[0078] Among them, E(S i ,DT j ) is calculated as follows:
[0079]
[0080] Among them, je represents the i-th situational element (i.e., S i ) (e.g., if the i-th situational element is a road type, the subtypes may be A road, B road, and C road), p je is the i-th situational element (i.e. S i ) is the proportion of the je-th subtype, in' is the i-th situational element (i.e. S i ) is the number of subtypes in the sample set of the j-th action type.
[0081] Since the data content may often be a continuous action record within a period of time, the association between the changes in the situational elements of similar timestamps and the action type can reflect the degree of influence of the situational elements on the action type. Therefore, in this embodiment, the changes in the situational elements and the action type within the similar time window are captured, and the above changes are added to the calculation of the action activation information entropy, that is, Indicates the degree of forward action influence of situational elements, Indicates the degree of backward action influence of situational elements.
[0082] Among them, |DT(-j5)| is calculated as follows: for the sample set of the jth action type (i.e., DT j ), sort all samples in the sample set by timestamp, and then get the two samples with the closest timestamp distance. If there are multiple groups of samples with the same timestamp distance, select the samples with the timestamp in the sample set DT j The total sample set DT is sorted by timestamp. For stable samples, 5 samples with timestamps immediately before the stable samples are selected from the total sample set DT. The samples whose action types are not DT are selected from the 5 samples. j The number of samples is recorded as |DT(-j5)|. Through the above calculation method, |DT(-j5)| takes into account the importance of samples with rapid changes in continuous historical action records.
[0083] Among them, |S ij (>5)| is calculated as:
[0084] In the first step, for the sample set of the jth action type (i.e., DT j ), sort all samples in the sample set by timestamp, and then get the two samples with the closest timestamp distance. If there are multiple groups of samples with the same timestamp distance, select the samples with the timestamp in the sample set DT j A set of samples that are more centered on the graph, and the corresponding two groups of samples are taken as stable samples. j The five samples whose timestamps follow the stable sample are selected.
[0085] In the second step, if the i-th situational factor (i.e. S i ) is a discrete type, and two stable samples are placed in the context element S i The corresponding subtype is also the same set DT j In the context element S i The subtypes with the largest number of corresponding values are compared to obtain the first difference group (different values are marked as 1, and the same values are marked as 0). The two stable samples are compared in the context factor S i The corresponding subtypes are the same as the above five samples in the context element S i The corresponding subtypes are compared to obtain the second difference group (different is recorded as 1, the same is recorded as 0); the number of differences in the second difference group that are greater than the difference in the first difference group is recorded as |S ij (>5)|.
[0086] The following example is used to more clearly illustrate the first difference group and the second difference group: For example, the subtypes corresponding to the two stable samples in the context element "road type" are "urban busy street" and "highway", and the sample set DT j The subtype with the most correspondence on the context element "road type" is "urban busy streets", where "highways" and "urban busy streets" are different and recorded as 1, and "urban busy streets" and "urban busy streets" are the same and recorded as 0, so the first difference group is 1+0=1; the subtypes corresponding to the context element "road type" of the 5 samples are "urban busy streets", "urban busy streets", "urban busy streets", "suburban multi-lane" and "suburban multi-lane", respectively. The above subtypes are compared one by one with the subtypes corresponding to the context element "road type" of the two stable samples, and the differences are 1, 1, 1, 2 and 2 respectively, so the second difference group is [1,1,1,2,2]; in summary, the first difference group is 1, and the second difference group is [1,1,1,2,2], so the part of the difference in the second difference group that is greater than the difference in the first difference group is [2,2], a total of 2, so |S ij (>5) is recorded as 2.
[0087] Step 3: If the i-th situational factor (i.e. S i ) is a continuous value, and the two stable samples are placed in the context element S i The vector of the corresponding subtype is also the same as the set DT j In the context element S i The cosine distance calculation is performed between the corresponding cluster center vectors to obtain the first cosine distance group, and the two stable samples are placed in the context element S i The vectors of the corresponding subtypes are the same as the five samples in the context element S i The cosine distance calculation is performed between the corresponding subtype vectors to obtain the second cosine distance group. The number of cosine distances in the second cosine distance group that are greater than the cosine distance in the first cosine distance group is recorded as |S ij (>5)|.
[0088] By |S ij (>5)| to consider the importance of future changes in situational factors in a sample where the action type remains constant.
[0089] In step 202, the corresponding situational elements are selected in order from small to large in action activation as split nodes. In the training process of the action classification model, the situational element with the smallest action activation is selected for the first split to split the training set. Each subsequent round of splitting selects the corresponding situational elements for splitting in the order of action activation based on the training set after the previous round of splitting until the preset splitting depth is reached or the number of single subset samples after the split is less than the preset threshold, thereby completing the training of the action classification model.
[0090] In this embodiment, the preset splitting depth and the preset threshold are set by those skilled in the art according to actual conditions.
[0091] The core of constructing the regression model (i.e., regression decision tree) corresponding to each action type is also the selection of split nodes. Once the order of split nodes is determined, the training of the action classification model can be completed. Figure 4 As shown, this embodiment involves the following designs:
[0092] A situational anomaly function is designed as a node splitting selection method. The situational anomaly is used to evaluate the impact of information entropy after the splitting of each situational element node in a single-type data set, and all situational elements are sorted according to the size of the situational anomaly.
[0093] In step 301, the single-type data set and the corresponding prediction confidence are substituted into the situation abnormality function to obtain the action activation degree of each situation element in the single-type data set, and all situation elements are sorted according to the size of the action activation degree.
[0094] When a decision tree is used for regression problems, the mean square error is usually used as the criterion for splitting nodes. The context anomaly function is designed by simultaneously considering the error of the confidence level and the error of the context factor in the sample after the node splitting. The context anomaly function is:
[0095] MSE(S i ,DS' j )=wav(S i ,DS' j-left )Avg(S i ,DS' j-left )+wav(S i ,DS' j-right )Avg(S i ,DS' j-right );
[0096] Among them, DS' j is the single-type dataset corresponding to the j-th action type, S i is the i-th situational factor, MSE(S i ,DS' j ) is the selectivity of splitting the i-th situational element in the single-type data set corresponding to the j-th action type, DS' j-left is the left subset formed by the j-th single-type data set after the situational element is split, wav(S i ,DS' j-left ) is the dispersion of the i-th situational factor in the left subset formed by the j-th single-type data set, Avg(Si ,DS' j-left ) is the mean square error of the left subset formed by the j-th single-type data set after splitting with the i-th situational element, DS' j-right is the right subset formed by the j-th single-type data set after the situational element is split, wav(S i ,DS' j-right ) is the dispersion of the i-th situational factor in the right subset formed by the j-th single-type data set, Avg(S i ,DS' j-right ) is the mean square error of the right subset formed by the j-th single-type data set after splitting with the i-th situational element.
[0097] The situation abnormality function wav(S i ,DS' j-left )for:
[0098]
[0099] Among them, |DS' j-left | is the number of samples in the left subset formed by the j-th single-type data set after the situational element is split, S iu is the value of the i-th situational factor on the u-th sample; when S i When it is a digital type (for example, the context element is a road type), is the average value of the i-th situational element on the left subset, For S iu and The value normalized by the absolute value of the difference between i When it is a vector type (for example, the context element is a user instruction), is the average vector of the i-th situational element on the left subset, For S iu and The cosine distance between .
[0100] The wav(S i ,DS' j-right ) is calculated by referring to the above wav(S i ,DS' j-left ) can be calculated, which will not be elaborated in detail here.
[0101] The situation abnormality function Avg(S i ,DS' j-left )for:
[0102]
[0103] Among them, conf j-left,u For DS' j-leftThe prediction confidence of the u-th sample above, For DS' j-left The average prediction confidence of all samples above.
[0104] In step 302, the corresponding situational elements are selected as splitting nodes in order from small to large in terms of situational abnormality. The first split is to split the single-type data set into a left subset and a right subset according to the situational element with the smallest situational abnormality. Each subsequent round of splitting selects the corresponding situational elements for splitting in order of the situational abnormality based on the left subset and the right subset obtained after the previous round of splitting until the preset splitting depth is reached or the number of single subset samples after the split is less than the preset threshold, thereby completing the training of the regression model of the corresponding action type.
[0105] In this embodiment, the preset threshold value and the preset splitting depth are set by those skilled in the art according to actual conditions.
[0106] Through the above method, the regression models corresponding to all action types can be trained. At this time, the structure of each regression model and the order of situational elements as split nodes are determined. During the training process, when a single-type data set is in the situational element S i When splitting, calculate the Avg(*,DS*) and MSE(S i ,DS*). Avg(*,DS*) represents the calculation performed on the single-type data set DS* when there is no split node, and MSE(S i ,DS*) means using the context element S on a single type dataset DS* i The situational abnormality function value after splitting. The mean of the differences is calculated to be the situational factor S i The feature importance of all situational factors is normalized to obtain the situational factor S i The weight w when the action type is the jth type ij .
[0107] After obtaining the trained action classification model and regression model, the dynamic situation representation of the collected situation data to be predicted is obtained, such as Figure 5 As shown, the process is as follows:
[0108] In step 401, the context element value sequence in the context data to be predicted is input into the action classification model to obtain the j-th action type corresponding to the context element value sequence.
[0109] The j-th action type may represent any one of all action types.
[0110] In step 402, the regression model corresponding to the j-th action type is queried to obtain the weights of all situational factors for the j-th action type.
[0111] In step 403, the context element value sequence in the context data to be predicted is input into the semantic embedding network model, and the context element value sequence in the context data to be predicted is converted into an embedding vector.
[0112] In step 404, a dynamic context representation is obtained according to the embedding vector and the weights of all context elements for the j-th action type.
[0113] The corresponding calculation formula is:
[0114]
[0115] in, is the dynamic situational representation of the situational data to be predicted, n is the total number of situational elements, and w ij is the weight of the i-th situational element in the j-th action type, is the embedding vector of the data of the i-th context element in the context data to be predicted.
[0116] In order to more clearly demonstrate the application of the predicted situation data to the action classification model and the regression model, the following example is used as an example:
[0117] There is a sequence of situational element values in the situational data to be predicted: (road type A: highway, weather condition B: cloudy, lighting condition C: night, vehicle status D: a set of digital values such as vehicle speed, fuel level, and power level, user instruction E: "enter automatic navigation mode", road condition event F: "road is clear"), first input the situational element value sequence into the action classification model, and the predicted action type is "acceleration", and "acceleration" is the third action type. Then input the situational element value sequence into the regression model corresponding to the "acceleration" action type, and obtain the weight set corresponding to the 6 situational elements relative to the "acceleration" action type as {w A3 ,w B3 ,w C3 ,w D3 ,w E3 ,w F3}.
[0118] The sequence of context factor values that need to be represented is converted into a vector expression through a natural language embedding learning model The dynamic situation representation QS corresponding to the situation element value sequence is calculated as:
[0119]
[0120] The method provided in this embodiment can achieve the following beneficial effects:
[0121] 1. Enhance the interpretability of situational representation: This embodiment designs an action classification model, and based on the clustering results of situational elements, designs a situational abnormality function as a method for selecting split nodes. The corresponding regression model is trained for each action type. By mining the current action type pointed to by the situational element and the different importance of the situational element under the action type, the interpretability of the weight analysis of the situational element is enhanced compared with the existing black box algorithm. Through the action classification model and regression model, the weights of different situational elements as split nodes in the corresponding action type are mined.
[0122] 2. Dynamic compatibility of situational representation: The method provided in this embodiment can dynamically represent the situational element values with time series characteristics. In the training of the action classification prediction model, an action activation function that considers the situational characteristics of a two-way time window is designed as a method for selecting split nodes. The judgment result of the action type can be dynamically adjusted as the situational element value changes dynamically, thereby guiding the situational element weight analysis of the corresponding action type, and having stronger dynamic compatibility. The data of the time window adjacent to the timestamp recorded by the situational data is captured and added to the selection function design of the decision tree split node, thereby strengthening the dynamic feature expression in the situational element representation.
[0123] Embodiment 2:
[0124] like Figure 6 , which is a schematic diagram of an attention situation representation device for dynamic decision-making according to an embodiment of the present invention. The attention situation representation device for dynamic decision-making according to this embodiment includes one or more processors 41 and a memory 42.
[0125] The processor 41 and the memory 42 may be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.
[0126] The memory 42 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs and non-volatile computer executable programs, such as the attention situation representation method for dynamic decision-making in the above-mentioned embodiment. The processor 41 executes the attention situation representation method for dynamic decision-making by running the non-volatile software program and instructions stored in the memory 42.
[0127] The memory 42 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some embodiments, the memory 42 may optionally include a memory remotely arranged relative to the processor 41, and these remote memories may be connected to the processor 41 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0128] The program instructions / modules are stored in the memory 42, and when executed by the one or more processors 41, the attention context representation method for dynamic decision-making in the above embodiment is executed, for example, the above described Figure 1-Figure 5 The steps shown.
[0129] An embodiment of the present invention further provides a computer storage medium having computer program instructions stored thereon; when the computer program instructions are executed by a processor, the attention context representation method for dynamic decision-making provided by an embodiment of the present invention is implemented.
[0130] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for representing attentional contexts for dynamic decision making, characterized in that: include: Constructing a training data set, and dividing the training data set into a training set and a test set, wherein both the training set and the test set include all situational elements and all action types; An action classification model is obtained by training the training set, and a test set is input into the action classification model to obtain prediction results of action types corresponding to different data samples in the test set and corresponding prediction confidences; Dividing the test set according to action type to obtain a single-type data set for each action type, and training a regression model for the corresponding action type based on each single-type data set and the corresponding prediction confidence; The situational data to be predicted is input into the action classification model to obtain the corresponding action type, and then the weight of each situational element for the corresponding action type is obtained based on the regression model of the corresponding action type. According to the situational data to be predicted and the weight corresponding to each situational element under the corresponding action type, the dynamic situational representation of the situational data to be predicted is obtained.
2. The attention context representation method for dynamic decision-making according to claim 1 is characterized in that: The step of training the action classification model according to the training set specifically includes: Design an action activation function that considers the context characteristics of the time window as a node splitting selection method, train the action classification model on the training set, and use the action activation function to evaluate the impact of information entropy after splitting each context element node in training samples of different action types, and sort all context elements according to the size of action activation; The corresponding situational elements are selected in order of action activation from small to large as split nodes. During the training process of the action classification model, the situational element with the smallest action activation is selected for the first split to split the training set. Each subsequent round of splitting selects the corresponding situational elements for splitting in the order of action activation based on the training set after the previous round of splitting until the preset splitting depth is reached or the number of samples in the single subset after the split is less than the preset threshold, thereby completing the training of the action classification model.
3. The attention context representation method for dynamic decision-making according to claim 2 is characterized in that: The action activation function is: Among them, S i is the i-th situational factor, DT is the total sample set, Choose(S i ,DT) is the action activation degree of the i-th situational element in the sample set, indicating the basis for split selection, a is the total number of action types, j is the sequence number of the action type, DT j is the sample set of the jth action type, E(S i ,DT j ) is the information entropy of the i-th situational element on the sample set of the j-th action type.
4. The attention context representation method for dynamic decision-making according to claim 1 is characterized in that: The training of the regression model corresponding to the action type according to each single-type data set and the prediction confidence specifically includes: A situational abnormality function is designed as a node splitting selection method. The situational abnormality is used to evaluate the impact of information entropy after the node splitting of each situational element in a single-type data set, and all situational elements are sorted according to the size of the situational abnormality. The corresponding situational elements are selected as splitting nodes in the order of situational abnormality from small to large. The first split is to split the single-type data set into a left subset and a right subset according to the situational element with the smallest situational abnormality. Each subsequent round of splitting selects the corresponding situational elements for splitting in the order of situational abnormality based on the left subset and right subset obtained after the previous round of splitting until the preset splitting depth is reached or the number of single subset samples after the split is less than the preset threshold, completing the training of the regression model of the corresponding action type.
5. The attention context representation method for dynamic decision-making according to claim 4 is characterized in that: The situation abnormality function is: MSE(S i ,DS' j )=wav(S i ,DS' j-left )Avg(S i ,DS' j-left )+wav(S i ,DS' j-right )Avg(S i ,DS' j-right ); Among them, DS' j is the single-type dataset corresponding to the j-th action type, S i is the i-th situational factor, MSE(S i ,DS' j ) is the selectivity of splitting the i-th situational element in the single-type data set corresponding to the j-th action type, DS' j-left is the left subset formed by the j-th single-type data set after the situational element is split, wav(S i ,DS' j-left ) is the dispersion of the i-th situational factor in the left subset formed by the j-th single-type data set, Avg(S i ,DS' j-left ) is the mean square error of the left subset formed by the j-th single-type data set after splitting with the i-th situational element, DS' j-right is the right subset formed by the j-th single-type data set after the situational element is split, wav(S i ,DS' j-right ) is the dispersion of the i-th situational factor in the right subset formed by the j-th single-type data set, Avg(S i ,DS' j-right ) is the mean square error of the right subset formed by the j-th single-type data set after splitting with the i-th situational element.
6. The attention context representation method for dynamic decision-making according to claim 5, characterized in that: The situation abnormality function wav(S i ,DS' j-left )for: Among them, |DS' j-left | is the number of samples in the left subset formed by the j-th single-type data set after the situational element is split, S iu is the value of the i-th situational factor on the u-th sample; when S i When it is digital, is the average value of the i-th situational element on the left subset, For S iu and The value normalized by the absolute value of the difference between i When it is a vector type, is the average vector of the i-th situational element on the left subset, For S iu and The cosine distance between The situation abnormality function Avg(S i ,DS' j-left )for: Among them, conf j-left,u For DS' j-left The prediction confidence of the u-th sample above, For DS' j-left The average prediction confidence of all samples above.
7. The attention context representation method for dynamic decision-making according to claim 1, characterized in that: The training data set is constructed and divided into a training set and a test set, specifically including: For the data of discrete situational elements in the training data set, the action types are classified according to the discrete values; For the data of continuous situational elements in the training data set, preprocessing the data of the continuous situational elements according to a clustering algorithm, thereby classifying the data of the continuous situational elements according to preset intervals, so as to convert the data of the continuous situational elements in the training data set into data of discrete situational elements; The training dataset is divided into training set and test set.
8. The attention context representation method for dynamic decision-making according to claim 1, characterized in that: The step of obtaining a dynamic situational representation of the situational data to be predicted according to the situational data to be predicted and the weight corresponding to each situational element under the corresponding action type specifically includes: The corresponding calculation formula is: in, is the dynamic situational representation of the situational data to be predicted, n is the total number of situational elements, and w ij is the weight of the i-th situational element in the j-th action type, is the embedding vector of the data of the i-th context element in the context data to be predicted.
9. An attention situation representation device for dynamic decision making, characterized in that: It includes 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, and the instructions are executed by the processor to execute the attention context representation method for dynamic decision-making as described in any one of claims 1-8.
10. A non-volatile computer storage medium, characterized in that: The computer storage medium stores computer program instructions, which, when executed by one or more processors, implement the attention context representation method for dynamic decision-making as described in any one of claims 1-8.