A human behavior recognition method based on a decision tree model

By incremental training and adjusting leaf node weights in decision tree model, the problem of catastrophic forgetting in incremental learning is solved, the model's learning and recognition ability is improved, and the integrity of old knowledge is maintained.

CN116340763BActive Publication Date: 2025-07-29BEIJING UNIV OF POSTS & TELECOMM
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310042930.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-28
Publication Date
2025-07-29
Estimated Expiration
2043-01-28

AI Technical Summary

Technical Problem

The existing decision tree-based machine learning model has catastrophic forgetting problems in incremental learning, and it is difficult to maintain the anti-forgetfulness of old knowledge while learning new knowledge, resulting in a decline in recognition and classification capabilities.

Method used

The new decision tree is trained through incremental data and expanded into the decision forest, adjust the leaf node weights of the expanded decision forest, construct the loss function using the classification loss function and the distillation loss function to optimize the model, and selectively perform incremental training in combination with the differential detection mechanism.

Benefits of technology

It improves the learning ability of the model and the anti-forgetfulness of old knowledge, enhances the accuracy of recognition and classification, reduces the forgetting of old knowledge, and improves the overall recognition and classification ability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116340763B_ABST
    Figure CN116340763B_ABST
Patent Text Reader

Abstract

The present invention discloses a human behavior recognition method based on a decision tree model. The human behavior recognition method includes: training a new decision tree with incremental data; inputting video or image data captured by a camera for the human behavior to be recognized into a pre-trained decision tree-based model; obtaining a behavior recognition result of the object according to the output of the model; wherein, the decision tree-based model is pre-trained according to the following method: adding the trained decision tree to the decision forest of the model to obtain an expanded decision forest; adjusting the weights of the leaf nodes of the expanded decision forest with incremental data to obtain a model updated by incremental data training. Applying the present invention can improve the anti-forgetting ability of old knowledge while ensuring the new knowledge learning ability of the model, so as to improve the recognition or classification ability of the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and particularly to a human behavior recognition method based on a decision tree model. Background Art

[0002] Currently, there are very serious catastrophic forgetting problems when current machine learning systems are retrained with new data. Since these learning systems will reconstruct the system or relearn all parameters during the update, the learning systems almost completely forget the past knowledge and can only handle newly learned tasks. With the development of machine learning, the derived technologies are also moving closer to artificial intelligence. Obviously, the purpose of artificial intelligence is to explore the learning ability and thinking mode of humans, and to generate machine learning algorithms that can make corresponding decisions in a way similar to human intelligence. Such algorithms can develop rapidly in multiple fields such as robots, speech recognition, image recognition, signal processing, and natural language processing. Such a human-like learning method is called incremental learning. It will gradually maintain and update the system as new data arrives on a trained classification system, and minimize the forgetting of old knowledge as much as possible.

[0003] Incremental learning is an important research branch of machine learning. Incremental learning focuses on solving the problem of concept drift and the catastrophic forgetting problem of the model. Concept drift refers to the drift of data over time, and its statistical information, data distribution, or semantic information has changed significantly. The catastrophic forgetting problem means that when a machine learning model (especially deep learning methods based on backpropagation) is trained on a new task, its performance on the old task usually drops significantly. The main reason for catastrophic forgetting is that the training of traditional models assumes that the distribution of the input data is consistent and stable, and the training samples are independent and identically distributed. When the subsequent new data has a distribution difference from the old data, it will cause the model to forget the old data, that is, the newly incoming data will interfere with the old data. To overcome the trouble brought by the catastrophic forgetting problem, the model should be able to learn and absorb new knowledge from the new data while preventing the newly learned knowledge from destroying the existing knowledge system. The conflict between these two constitutes the so-called stability-plasticity dilemma. The ability of incremental learning is the ability to continuously process the continuous information flow in the real world and retain, integrate, and optimize old knowledge while absorbing new knowledge.

[0004] Current research on incremental learning focuses on the field of deep learning and less on the traditional machine learning field. As a widely used algorithm in the traditional machine learning field, decision trees do not support incremental learning by themselves. Therefore, how to improve decision trees to enable incremental learning has always been a research focus in the field of incremental learning. Currently, incremental learning algorithms explored on decision trees include the ID5R algorithm and a series of its derivative improvement algorithms. However, the learning ability of these algorithms for new knowledge and the anti-forgetting ability for old knowledge are both limited. Summary of the Invention

[0005] In view of this, the purpose of the present invention is to propose a human behavior recognition method and computer device based on a decision tree model, which can improve the anti-forgetting ability of old knowledge while ensuring the new knowledge learning ability of the model, so as to improve the recognition and classification ability of the model.

[0006] Based on the above purpose, the present invention provides a human behavior recognition method based on a decision tree model, including:

[0007] Input the video or image data captured by the camera for the human behavior to be recognized into the pre-trained decision tree-based model; obtain the behavior recognition result of the object according to the output of the model; wherein, the decision tree-based model is pre-trained according to the following method:

[0008] Use incremental data to train a new decision tree;

[0009] Add the trained decision tree to the decision forest of the model to obtain an expanded decision forest;

[0010] Use incremental data to adjust the weights of the leaf nodes of the expanded decision forest to obtain a model updated by incremental data training.

[0011] Preferably, the incremental data is constructed according to the following method:

[0012] Let S i and E i-1 together form the data set D i , which is used as the incremental data for the i-th stage of construction;

[0013] wherein, S i is the i-th batch of data arriving in the i-th stage; E i-1 is the example set selected and stored from the data sets of the previous (i - 1) stages.

[0014] Preferably, the use of incremental data to train a new decision tree specifically includes:

[0015] Use D iTrain a new decision tree, which is the decision tree incrementally trained in the i-th stage.

[0016] Preferably, adding the trained decision tree to the decision forest of the model to obtain an expanded decision forest specifically includes:

[0017] Expand the decision tree incrementally trained in the i-th stage to the decision forest of T i-1 , to obtain an expanded decision forest; where T i-1 is the model trained in the (i - 1)-th stage.

[0018] Preferably, adjusting the weights of the leaf nodes of the expanded decision forest by using the incremental data specifically includes:

[0019] Input D i into the model T i , and use the loss function constructed by the classification loss function and the distillation loss function to adjust the weights of the leaf nodes of the expanded decision forest in the model T i ;

[0020] where T i is the model constructed from the expanded decision forest.

[0021] Furthermore, the method further includes: performing a difference detection on the incremental data; and

[0022] The training of a new decision tree by using the incremental data specifically includes:

[0023] If the difference is large, then train a new decision tree by using the incremental data.

[0024] Preferably, the performing a difference detection on the incremental data specifically includes:

[0025] Input D i into the old model T i-1 , and obtain the prediction result output by T i-1 ;

[0026] Compare the prediction result output by T i-1 with the label of D i , calculate the prediction accuracy of T i-1 ; if the prediction accuracy is less than the set threshold, then determine that the difference is large;

[0027] where T i-1 is the model trained in the (i - 1)-th stage.

[0028] The present invention also provides a computer device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, it is used to implement the steps of the above-mentioned human behavior recognition method based on the decision tree model.

[0029] The present invention also provides a computer-readable storage medium, in which a computer program is stored. The computer program can be executed by at least one processor, so that the at least one processor executes the steps of the above-mentioned human behavior recognition method based on the decision tree model.

[0030] In the technical solution of the present invention, in the technical solution of the present invention, incremental data is used to train a new decision tree; the trained decision tree is added to the decision forest of the model to obtain an expanded decision forest; incremental data is used to adjust the weights of the leaf nodes of the expanded decision forest to obtain a model updated by incremental data training. During this model training process, using incremental data to train a new decision tree and expand it into the decision forest of the model can enhance the learning ability of the model; furthermore, using incremental data to adjust the weights of the leaf nodes of the expanded decision forest can improve the anti-forgetting ability of the model after weight adjustment, so as to improve the recognition or classification ability of the model. Description of the Drawings

[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0032] Figure 1 It is a flowchart of a method for training a model based on a decision tree provided by an embodiment of the present invention;

[0033] Figure 2 It is a flowchart of a method for detecting the difference of incremental data provided by an embodiment of the present invention;

[0034] Figure 3 It is a schematic diagram of the hardware structure of a computer device provided by an embodiment of the present invention. Detailed Embodiments

[0035] To make the purpose, technical solutions and advantages of the present invention clearer and more understandable, the following will further describe the present invention in detail with reference to specific embodiments and the accompanying drawings.

[0036] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present invention should have the ordinary meanings understood by those of ordinary skill in the art to which this disclosure belongs. The "first", "second" and similar terms used in this disclosure do not denote any order, quantity or importance, but are only used to distinguish different components. Words such as "comprising" or "including" mean that the elements or objects appearing before this word cover the elements or objects listed after this word and their equivalents, without excluding other elements or objects. Words such as "connected" or "coupled" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right", etc. are only used to represent relative position relationships. When the absolute position of the object being described changes, the relative position relationship may also change accordingly.

[0037] The inventors of the present invention considered that over time, the data arriving at different times belongs to the same task. However, as the data arrives in batches, the domain has changed, and the data in different batches no longer conforms to the assumption of static identical distribution. Therefore, the present invention proposes an incremental learning framework based on Boosting class ensemble learning algorithms such as XGBoost. Since the establishment of each decision tree requires all samples, but when performing incremental training, according to the definition of incremental training, the storage space is very limited and all old data will not be saved. Therefore, if new batch data is used to reconstruct the decision forest, it will inevitably cause the model to forget most of the old knowledge. If only new batch data is used to adjust the weights of the leaf nodes, such adjustment is very limited for the model to learn new knowledge. In the technical solution of the present invention, incremental training includes two stages: the expansion stage of the decision forest and the adjustment stage of the leaf nodes of the decision tree. The former stage aims to help the model learn and expand new knowledge points, and the latter stage aims to help the model consolidate all the knowledge learned. At the same time, in order to alleviate the infinite growth of the model, the present invention adds the detection of the new batch data distribution before pre-incremental training. When the data distribution of the new batch data does not change significantly compared with the old data, it is possible to skip this round of incremental training to alleviate the problem of infinite growth of the model.

[0038] The trained model can be applied to various recognition tasks or classification tasks: input the sensor data collected for the object to be recognized into the trained model; and then the classification result of the object can be obtained according to the output of the model.

[0039] Among them, the object to be recognized can be a static thing or a dynamic thing; the sensor data can specifically be video or image data captured by a camera, or temperature data collected by a temperature sensor, or data collected by other types of sensors.

[0040] For example, the trained model can be applied to the classification task of human behavior: Under the background of the human behavior recognition task, a large amount of data is collected through sensors for verification tests, and input into the trained model. Through the model, five behaviors of stillness, walking, going up and down stairs, going up and down elevators, and going up and down escalators can be recognized, and stillness and walking are classified as flat-level movements, while going up and down stairs, going up and down elevators, and going up and down escalators are classified as cross-level movements. Therefore, we conduct tests in two task methods of five-classification tasks and two-classification tasks to achieve comprehensive testing. The final test results show that in terms of the five-classification task, after a single round of incremental testing, compared with the theoretically optimal global training (i.e., training the model using all data), the difference is only 1.11%. The global training test result is 89.88%, and the result of the single-round incremental testing is 88.77%. From the perspective of the commonly used evaluation indicators (learning rate and forgetting rate) in incremental learning, the learning rate is the difference in the test accuracy of the second batch of test data on the basic model and the test accuracy on the model after one round of incremental training, reaching 64.29%. The forgetting rate is the difference in the test accuracy of the first batch of test data on the basic model and the test accuracy on the model after one round of incremental training, which is 1.77%. It can be seen that the model trained by the method of the present invention has strong learning ability and low forgetting degree.

[0041] The technical solutions of the embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0042] A model training method based on a decision tree provided by an embodiment of the present invention has a process as Figure 1 shown, and includes the following steps:

[0043] Step S101: Construct incremental data;

[0044] Specifically, for solving the domain increment problem, data arrives in batches over time. The data that arrives may be of the same distribution or may be of different distributions, which is consistent with the data collection method in the real scenario. Assume there are N stages, where the 0th stage is the initial stage, and the remaining (N - 1) stages are incremental stages.

[0045] In the initial stage (the 0th stage), the initial dataset S0 is used to train the initial model. Using a traditional classification loss function (such as cross-entropy loss), the initially trained model T0 is learned, and then T0 is saved in the memory of the system.

[0046] In the i-th stage (i > 0), that is, the i-th incremental stage, the i-th batch of data S i arriving in the i-th stage is used to train the model T i-1 that has undergone (i - 2) incremental trainings, and the model T i that has undergone (i - 1) incremental trainings is obtained.

[0047] Specifically, in line with the actual scenario, the memory space is limited and cannot store all data in each stage. Therefore, a small number of sample data E for each stage are selected and stored. i (At the same time, the balance of samples between classes is ensured), forming an exemplar set |E|, and |E| will satisfy |E| << ∑|D|, where D is the total amount of sample data in each incremental stage. In the i-th stage, there will be three parts in the memory: (1) The model T that has undergone (i - 2) incremental trainings. i-1 ; (2) The exemplar set E selected and stored from the datasets of the previous (i - 1) stages. i-1 ; (3) The i-th batch of data S arriving in the i-th stage. i .

[0048] Therefore, in this step, the data set D jointly composed of S i and E i-1 is used as the incremental data for the constructed i-th stage; it is used to train the model T that has undergone (i - 2) incremental trainings. i , and the model T that has undergone (i - 1) incremental trainings is obtained. i-1 i .

[0049] Among them, E i-1 is an exemplar set constructed from partial data extracted from each batch of data in the previous (i - 1) batches of data.

[0050] Step S102: Perform differential detection on the incremental data; if the difference is large, continue to execute the following steps S103 - S105 for incremental training; if the difference is not large, do not use this batch of data for training.

[0051] In fact, since this patent deals with the domain incremental problem and the data source of the task is consistent with the actual scenario, it may encounter a situation where the data distribution is the same as before. Therefore, to avoid waste of computing resources and contamination of the model, incremental training can be determined after determining that the data distribution of the scenario is inconsistent. Concept detection drift mainly uses whether the prediction results and confidence levels of the current data set exceed a certain threshold for judgment. Next, this framework will expand the model, add new decision trees to learn new knowledge, and then use the current data set to adjust the weights of the decision tree leaf nodes to consolidate all the learned knowledge. Finally, the trained model of this stage will be saved and the exemplar set will be adjusted.

[0052] That is to say, in the face of the real scenario of domain incremental learning, in fact, when many new batches of data arrive, the distribution of the data does not change much. If these new data with little distribution difference are also trained using the incremental learning framework, the effect may be counterproductive because incremental learning will inevitably lead to a loss of accuracy in current technologies, and the prediction accuracy of data with little distribution difference on the basic model is not very poor. Therefore, an appropriate detection mechanism can be adopted to skip the incremental training of these batches of data with little distribution difference. Through the analysis of the concept drift detection mechanism, the present invention adopts a result-oriented strategy. The newly arrived data is tested using the old model. If the test accuracy and test confidence reach a certain threshold, a new round of incremental training is not performed on this batch of new data.

[0053] Based on this, in this step, the model (old model) T trained in the previous stage (the i - 1th stage) i-1 is imported. And since the calculation of the loss function and the detection of concept drift in the subsequent training process will use the prediction results of the old model on the data set D i , therefore, after the old model is read in, the data set will be predicted to obtain pred old .

[0054] Specifically, after importing the data, this detection process will use the current model to make predictions, obtain the prediction probability of each label, and select the label with the largest prediction probability as the correct label, thereby calculating the prediction accuracy. And to make the prediction results more persuasive, this patent also statistically calculates the average prediction probability of the prediction probabilities as the confidence. If both the confidence and the prediction accuracy are greater than the threshold, incremental training is not performed; otherwise, incremental training is performed. And since the model complexity increases during incremental training, this patent will also adjust the threshold accordingly. The specific process is as Figure 2 shown, including the following sub - steps:

[0055] Sub - step S201: Input D i into the old model T i-1 , and obtain the prediction result output by T i-1 ;

[0056] In this sub - step, input D i into the old model T i-1 . Take the recognition result or classification result output by T i-1 as the prediction result;

[0057] Sub - step S202: Compare the prediction result output by T i-1 with the label of D i , and calculate the average prediction accuracy of T i-1 ;

[0058] In this sub-step, the prediction result output by T i-1 is compared with the label of D i to calculate the prediction accuracy of T i-1 . Furthermore, the prediction probabilities can be statistically counted, and finally the average prediction probability is calculated and used as the confidence level.

[0059] Specifically, for each sample in D i input to T i-1 , the prediction result of T i-1 for this sample is compared with the label of this sample to obtain the prediction accuracy of T i-1 for this sample. The prediction accuracies of T i-1 for each sample in D i are averaged to obtain the average prediction accuracy.

[0060] Sub-step S203: If the average prediction accuracy is less than the set threshold, it is determined that the difference is large, and then the following steps S103 - S105 are continued for incremental training; otherwise, it is determined that the difference is not large, and this batch of data is not used for model training.

[0061] Step S103: Use the incremental data to train a new decision tree;

[0062] In this step, D i is used to train a new decision tree, which is the decision tree incrementally trained in the i-th stage. The main goal of the decision tree expansion stage is to enable the model to learn new knowledge. Since the creation of a decision tree requires the use of all data, if a new model is retrained using the current new data set, most of the old knowledge will surely be forgotten. If only the leaf nodes of the previous model are adjusted, the new knowledge learned will be very limited. Therefore, whenever a new batch of data arrives, the decision tree is expanded on the basis of the original forest to learn new knowledge.

[0063] Step S104: Add the trained decision tree to the decision forest of the model to obtain an expanded decision forest;

[0064] In this step, the decision tree incrementally trained in the i-th stage is expanded into the decision forest of T i-1 to obtain an expanded decision forest, that is, to obtain the model T i constructed by the expanded decision forest.

[0065] After the expansion is completed, in order to reduce the loss, the present invention adjusts the new decision forest using the current data set. In this stage, the already built decision trees will not be modified anymore, but the weights of the leaf nodes of the decision trees will be modified. Because in the expansion stage, from the old decision forest to the subsequently newly built decision trees, the decrease in loss is discontinuous. The previous decision trees were built using the previous data sets, and the newly added decision trees are built using the existing data sets, which will result in discontinuous loss. Therefore, an adjustment stage with the following steps is required to recalculate the weights of the leaf nodes, so as to achieve the purpose of reducing loss and consolidating all knowledge.

[0066] Step S105: Apply the incremental data D i Adjust the weights of the leaf nodes of the expanded decision forest to obtain a model updated by training with the incremental data; jump to step S120.

[0067] This step is the adjustment stage of the decision tree leaf nodes; considering that the newly added decision trees are a relatively small part compared to the original decision tree forest and most of the data used for updating is new data, in order to better learn new knowledge and not forget old knowledge, the present invention introduces a new loss function, which includes two parts - classification loss and distillation loss. The classification loss is to ensure that the model can learn correct knowledge, and the distillation loss is to ensure that the model avoids forgetting old knowledge.

[0068] To give a clear definition, assume that the data set D at the current stage i has K classes, x is a piece of data in the data set, and its label is y, T i is the current new model, and the cross-entropy loss is defined as shown in Equation 1:

[0069]

[0070] where p k (x) is the output value (or predicted value) of x after passing through the model T i and σ y=k is the indicator function.

[0071] In a typical multi-class classification task, the softmax (normalization) function is usually used to normalize the output value. The probability calculation formula for a sample x is shown in Equation 2:

[0072]

[0073] where, p i (x) represents the predicted probability of the i-th class output by the model T i for x, and F i (x) represents the i-th decision tree forest model (the prediction of each class corresponds to the model Ti in a sub - decision tree forest model). For classification tasks with more than two classes, multiple decision forests are usually formed. Each decision forest only gives the prediction probability of one class. The formation processes of these decision forests are the same, and finally they jointly constitute the overall decision forest of the model.

[0074] The ordinary softmax function often turns an output with little difference into a very extreme distribution (that is, the prediction probabilities of different classes will vary greatly). This results in the information of negative labels being hidden when using the probabilities calculated by the ordinary softmax function as soft labels. Therefore, in the technical solution of the present invention, a softmax function with a temperature coefficient, that is, the softmax_T function, is used on the basis of the ordinary softmax function. Compared with the softmax function, there is an additional temperature coefficient T. The value of T is generally a constant greater than 1. The larger the set T, the more negative label information (i.e., noise information) will be brought to the model. The addition of this information improves the generalization ability of the model;

[0075] When the softmax_T function normalizes the output value of T i for a sample x, the probability calculation formula is as shown in Equation 3:

[0076]

[0077] In the technical solution of the present invention, both the classification loss function and the distillation loss function use the conventional cross - entropy loss function as shown in Equation 1 above; only in order to retain the knowledge of the old model, the distillation loss function uses soft labels, that is, the current data set D i is predicted by the old model T i-1 and the obtained prediction result is used as the prediction label. Moreover, in order to ensure purity during the distillation process, the impurity data with different prediction labels and true labels is removed. Therefore, the formula of the distillation loss function is as shown in Equation 4:

[0078]

[0079] where M is the total number of samples in the data set D i , is the output value (or prediction value) of the softmax_T function of the i - th sample in D i in the old model T i-1 , is the output value (or prediction value) of the softmax_T function with temperature coefficient T being t of the i - th sample in D i in the new model T i . Among them, t is a set constant greater than 1.

[0080] The formula of the classification loss function is shown in Equation 5:

[0081]

[0082] Wherein, is the output value (or predicted value) of the i-th sample in D i based on the softmax_T function with a temperature coefficient T of 1 in the new model T i , and label i is the true label value of the i-th sample, and this true value is represented by a vector formed by one-hot encoding;

[0083] After obtaining the classification loss function and the distillation loss function, the final loss function can be constructed, as shown in Equation 6:

[0084]

[0085] Wherein, α is a set weight parameter (adjustable) used to control the balance between the anti-forgetting ability and the learning ability, and L d represents L calculated by Equation 4 distillation , and L c represents L calculated by Equation 5 classification , label represents the true label of the sample, and pred old is the output value (or predicted value) of the i-th sample in D i in the old model T i-1 for the softmax_T function. The predicted label of the model can be obtained using the argmax function. argmax(pred old ) = label means that only when the final prediction result of the sample in the old model is consistent with the true label, it will be added to the calculation of the distillation loss. This operation is to remove the impurity data with different predicted labels and true labels as mentioned in the above description, ensuring that the model learns and retains the correct knowledge.

[0086] In this step, the incremental data D i is input into the model T i , that is, when adjusting the leaf node weights of the expanded decision forest in the model T i using the incremental data D i , the loss function of Equation 6 above is used, that is, the loss function constructed by the classification loss function and the distillation loss function. The model T i after adjusting the leaf node weights is the model trained in the i-th stage.

[0087] Step S106: Update the example set.

[0088] Specifically, to effectively utilize the limited memory, a part of the data can be retained in each batch of data, and at the same time, a part of the data from the previous batches will be deleted to maintain the stability of the storage space size of the example data. Assume that the size of the storage memory space is M, and the total number of classes in the data is K. At the i-th stage (i > 0), that is, the i-th incremental stage, when the i-th batch of data arrives or is trained, the memory space is adjusted in three steps to construct the example set E i-1 :

[0089] First, the number of samples of each class in the example set E i-1 formed by the (i - 1) batches of data in the previous (i - 1) stages will be reduced by r samples to ensure that the example memory size remains fixed;

[0090] Then, construct the example set e i of the current batch of data (the i-th batch of data);

[0091] Finally, combine the reduced E i-1 with the example set e i of the current batch of data to form E i , that is, the example set E i selected and stored from the data sets of the previous i stages, so as to obtain the updated example set E i . The calculation of r is shown in Equation 7:

[0092] r = M / bacth_num / K (Equation 7)

[0093] where bacth_num represents the number of batch training rounds carried out so far.

[0094] There are two methods for how to select the example set of the current batch: (1) Method 1 is to select the most central samples in the class sample space. These samples can be selected by retesting this batch of data with the model just trained with the new batch of data, and select a part of the data with the highest confidence. At the same time, the selected data can be arranged in order, and when deleting later, the calculation time can be saved by directly deleting the lower-confidence data in the second half. (2) Method 2 is to randomly select data. The randomly selected data may be more representative. These data are distributed in the entire class sample space and can more completely present the size of the entire class sample space.

[0095] In machine learning, the commonly used metrics for evaluating classification models are: accuracy, precision, recall, and F-Score. The present invention decides to focus on using accuracy as the evaluation metric for the classification effect achieved by this indoor and outdoor recognition method. For a binary classification problem, the general formula of its confusion matrix can be expressed as Table 1:

[0096] Table 1

[0097]

[0098]

[0099] In the context of human activity recognition (HAR) based on sensor signals, this paper focuses on solving the domain increment problem in the field of incremental learning. That is, over time, the sensor signal data arriving at different times belongs to the same human activity recognition task. However, as the data arrives in batches, the domain changes, and the data in different batches no longer conforms to the assumption of static identical distribution. In this context, we designed a comparative experiment, mainly comparing with the models trained by global training (i.e., using all data to train the model) and local training (i.e., using the current batch of data to train the model).

[0100] The human activity recognition method mentioned in this paper belongs to a binary classification / five-classification problem, and its accuracy can be represented by the ratio of the sum of the diagonal sample numbers of the matrix to all samples. The specific calculation method is shown in Equation 8:

[0101]

[0102] After a large number of data tests, this invention obtained a comparison of the results of a round of incremental tests (five-classification results / binary-classification results), as shown in the results of Table 2 below:

[0103] Table 2

[0104]

[0105]

[0106] The above Table 2 counts the results of the incremental global training model, the incremental training model, and the local training model after another round of training on the basic model. From the above table, it can be seen that after one incremental training of the incremental training model of this invention, the binary-classification accuracy of the test set in Scenario 2 increased by 64.29%, and the five-classification accuracy increased by 57.15%. Moreover, the recognition accuracies of the test sets in Scenario 1 for binary classification and five-classification only decreased by 1.77% and 0.24% respectively. It can be seen that the learning ability and anti-forgetting ability of the model trained by this invention are very strong.

[0107] At the same time, in order to detect the importance of each part of the model, this invention also conducted ablation experiments on the model. The comparison of the ablation experiment results (five-classification results / binary-classification results) is shown in Table 3 below:

[0108] Table 3

[0109]

[0110]

[0111] In Table 3 above, the first column shows the test results of the basic model, that is, the model obtained by using the traditional model training method for the first batch of data. It can be seen that the test results of the basic model for the second batch of test data are not good, indicating that there are relatively large distribution differences between the second batch of data and the first batch of data. To test the importance of each module in the framework, in this paper, each part was evaluated by ablation means. In this experiment, the model training process was mainly divided into three important parts, namely the decision tree expansion module (Incremental), the decision tree leaf node weight adjustment module (Adjustment), and the custom loss function module (Loss); the subsequent four columns are the complete framework, the framework without the custom loss function module, the framework without the decision tree leaf node weight adjustment module, and the framework without the decision tree expansion module. From the comparison between the complete framework and the subsequent three columns, it can be seen that the decision tree leaf node value adjustment module is the most important. After removing this module, in the tests of all scenario test sets, the test accuracies of five-classification and two-classification decreased by 10.6% and 7.76% respectively. The test results of removing the custom loss function module and the incremental module also decreased slightly. Moreover, in the experiments of removing these modules, the multi-classification loss of the model also increased significantly, which also reflects to some extent that the performance of the model has decreased.

[0112] In the technical solution of the present invention, incremental data is used to train a new decision tree; the trained decision tree is added to the decision forest of the model to obtain an expanded decision forest; incremental data is used to adjust the weights of the leaf nodes of the expanded decision forest to obtain a model updated by incremental data training. During this model training process, using incremental data to train a new decision tree and expand it into the decision forest of the model can enhance the learning ability of the model; furthermore, using incremental data to adjust the weights of the leaf nodes of the expanded decision forest can improve the anti-forgetting ability of the model after weight adjustment.

[0113] Figure 3 FIG. schematically shows a hardware architecture diagram of a computer device 1300 for a decision tree-based model training method according to an embodiment of the present application. In this embodiment, the computer device 1300 is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions. For example, it can be a smart phone, a tablet computer, a notebook computer, a desktop computer, a rack-mounted server, a blade server, a tower server, or a cabinet server (including an independent server, or a server cluster composed of multiple servers), etc. As Figure 3 shown, the computer device 1300 at least includes, but is not limited to: a memory 1310, a processor 1320, and a network interface 1330 that can communicate with each other through a system bus. Among them:

[0114] The memory 1310 includes at least one type of computer-readable storage medium. The readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (such as SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disc, etc. In some embodiments, the memory 1310 may be an internal storage module of the computer device 1300, such as the hard disk or memory of the computer device 1300. In other embodiments, the memory 1310 may also be an external storage device of the computer device 1300, such as a plug-in hard disk equipped on the computer device 1300, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. Of course, the memory 1310 may also include both the internal storage module and the external storage device of the computer device 1300. In this embodiment, the memory 1310 is generally used to store the operating system and various application software installed on the computer device 1300, such as the program code of the model training method based on the decision tree. In addition, the memory 1310 can also be used to temporarily store various data that have been output or will be output.

[0115] In some embodiments, the processor 1320 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips. The processor 1320 is generally used to control the overall operation of the computer device 1300, such as performing control and processing related to data interaction or communication with the computer device 1300. In this embodiment, the processor 1320 is used to run the program code stored in the memory 1310 or process data.

[0116] The network interface 1330 may include a wireless network interface or a wired network interface, which is generally used to establish a communication link between the computer device 1300 and other computer devices. For example, the network interface 1330 is used to connect the computer device 1300 to an external terminal through a network, and to establish a data transmission channel and a communication link between the computer device 1300 and the external terminal. The network may be a wireless or wired network such as an enterprise intranet (Intranet), the Internet, the Global System of Mobile communication (GSM for short), Wideband Code Division Multiple Access (WCDMA for short), 4G network, 5G network, Bluetooth, Wi-Fi, etc.

[0117] It should be noted that Figure 3 Only the computer device with components 1310 - 1330 is shown, but it should be understood that it is not required to implement all the shown components, and more or fewer components can be implemented alternatively.

[0118] In this embodiment, the decision tree-based model training method stored in the memory 1310 can also be divided into one or more program modules and executed by one or more processors (processor 1320 in this embodiment) to complete the embodiments of the present application.

[0119] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tapes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible by a computing device.

[0120] Those of ordinary skill in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of the present disclosure (including the claims) is limited to these examples; under the concept of the present invention, the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations in different aspects of the present invention as described above, and they are not provided in detail for the sake of brevity.

[0121] In addition, for simplicity of explanation and discussion, and in order not to make the present invention difficult to understand, the well-known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided drawings. Further, the devices may be shown in block diagram form in order to avoid making the present invention difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform on which the present invention is to be implemented (i.e., these details should be fully within the understanding of those skilled in the art). In cases where specific details (such as circuits) are set forth to describe exemplary embodiments of the present invention, it will be apparent to those skilled in the art that the present invention can be practiced without these specific details or with variations of these specific details. Therefore, these descriptions should be considered illustrative rather than restrictive.

[0122] Although the present invention has been described in connection with specific embodiments thereof, many alternatives, modifications, and variations of these embodiments will be apparent to those of ordinary skill in the art based on the foregoing description. For example, other memory architectures (such as dynamic RAM (DRAM)) may be used with the embodiments discussed.

[0123] Embodiments of the present invention are intended to cover all such alternatives, modifications, and variations that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.

Claims

1. A human behavior recognition method based on a decision tree model, characterized in that Including: Inputting video or image data captured by a camera for a human behavior to be recognized into a pre-trained decision tree-based model; Obtaining a behavior recognition result according to the output of the model; wherein, the decision tree-based model is pre-trained according to the following method: Train a new decision tree using incremental data; wherein, the incremental data is constructed according to the following method: S i and E i-1 together form a data set D i , which is used as the incremental data for the i-th stage of construction; wherein, S i is the i-th batch of data arriving at the i-th stage; E i-1 is the set of exemplars selected and stored from the data sets of the previous (i - 1) stages; Add the trained decision tree to the decision forest of the model to obtain an expanded decision forest, including: expand the decision tree incrementally trained in the $i$-th stage to the decision forest of $T$ i-1 to obtain an expanded decision forest; where $T$ i-1 is the model trained in the $(i - 1)$-th stage; Adjusting the leaf node weights of the expanded decision forest using incremental data includes: inputting D i into model T i , and using the loss function constructed by the classification loss function and the distillation loss function to adjust the leaf node weights of the expanded decision forest in model T i ; thereby obtaining the model updated by incremental data training.

2. The method according to claim 1, characterized in that, The training of a new decision tree using incremental data specifically includes: Use D i Train a new decision tree as the decision tree incrementally trained in the i-th stage.

3. The method according to claim 2, wherein Also included: Performing a difference detection on the incremental data; And The training of a new decision tree using incremental data specifically includes: If the difference is large, training a new decision tree using the incremental data.

4. The method according to claim 3, characterized in that, The performing of the difference detection on the incremental data specifically includes: Input D i into the old model T i-1 and obtain the predicted result i-1 output by T Compare the predicted result output by T i-1 with the label of D i to calculate the prediction accuracy of T i-1 ; if the prediction accuracy is less than the set threshold, it is determined that the difference is large. Among them, T i-1 is the model trained in the (i - 1)-th stage.

5. A computer device, the computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, it is used to implement the steps of the human behavior recognition method of the decision tree-based model according to any one of claims 1 to 4.

6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and the computer program can be executed by at least one processor, so that the at least one processor executes the steps of the human behavior recognition method of the decision tree-based model according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Decision tree incremental learning method oriented to information big data

    CN107194468A

  • Multi-class decision-making method combining a fuzzy set and a random forest tree

    CN109657721A