Multivariable time sequence state classification method based on analytic hierarchy process and program product
By constructing a hierarchical analysis tree model and combining it with an autoregressive model, optimizing the judgment matrix and extracting time series information, the problem of high-dimensional calculation time and noise processing in multivariable time series classification is solved, and higher classification accuracy and adaptability are achieved.
Patent Information
- Application Number
- CN202410609564.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-16
- Publication Date
- 2024-08-30
AI Technical Summary
Existing multivariate time series classification methods take a long time to calculate when facing high-dimensional data, and are difficult to effectively handle the problems of noise, missing values, and uneven sampling, which affect the accuracy of classification results.
A multi-variable time series state classification method based on analytic hierarchy process is adopted. By constructing an analytic hierarchy process tree model, the differential evolution algorithm is used to optimize the judgment matrix, and combined with the autoregressive model to extract time series information to generate the final classification result.
It improves the accuracy and credibility of classification, enhances the processing efficiency of multi-variable time series data, improves recall rate and robustness, and is suitable for multiple application fields.
Smart Images

Figure CN118568602A
Abstract
Description
Technical Field
[0001] The invention belongs to the field of multivariate time series classification, and specifically relates to a multivariate time series state classification method and program product based on hierarchical analysis. Background Art
[0002] In daily social life, there are a large number of multivariate time series data. Multivariate time series classification has a wide range of applications, including but not limited to financial market analysis, biomedical signal processing, environmental monitoring, industrial process control, etc. However, these data often have high-dimensional characteristics, and there may be complex interdependencies between variables, which brings additional complexity to the classification task. In addition, in real life, time series data may have various types of noise, missing values, or uneven sampling problems, which will affect the accuracy of the classification results. In recent years, in order to better characterize time series and seek breakthroughs in classification performance, scholars at home and abroad have proposed many methods to solve the various challenges of multivariate time series classification, mainly the following:
[0003] 1. Feature-based methods
[0004] This method first extracts features from the original multivariate time series data, uses feature vectors to represent the original sample data, uses these feature vectors to train classifiers, and uses classifiers such as KNN for classification. Li C et al. proposed a manual feature extraction method based on singular value decomposition (Li C, Khan L, Prabhakaran B. Real-time classification of variable length multi-attribute motions [J] Knowledge and Information Systems, 2006, 10 (2): 163-183), using singular value decomposition to obtain the feature vectors of the original time series data, and then using SVM for classification. Weng X et al. made improvements on this basis and proposed a 2DSVD method (Weng X, Shen J. Classification of multivariate time series using two-dimensional singular value decomposition [J]. Knowledge-Based Systems, 2008, 21 (7): 535-539), using the inter-row singular value decomposition method to obtain the features of the time series data, and then using KNN for classification. The above feature-based time series classification method is simple to implement and easy to understand, but this method is very time-consuming when facing high-dimensional problems, which limits the application of this type of method.
[0005] 2. Distance-based methods
[0006] This type of method focuses on using distance formulas to measure the similarity between time series, and constructs a model classifier based on the similarity to classify multivariate time series. Common distance measurement methods are as follows: Data Error Distribution Distance Function (DEDF), which is suitable for treating multivariate time series as probability distributions. Euclidean Distance (ED), which is suitable for uniformly distributed multivariate time series. Dynamic Time Warping (DTW), a strategy method based on dynamic programming, is also a more advanced baseline method. Distance-based methods reduce computational loss and improve computational efficiency. However, it is difficult to find a very general method for distance measurement for different time series data.
[0007] 3. Model-based approach
[0008] This type of method directly trains models on multivariate time series data for classification. Classic model-based multivariate time series classification includes autoregressive (AR) model, autoregressive moving average (ARMA) model, hidden Markov model (HMM) model, etc. This type of method relies on the characteristics of the data, and it is difficult for the model to adapt well to different data characteristics. In addition, there are currently popular deep learning models such as the long short-term memory model (LSTM). This type of method can automatically extract rich feature information from the original time series data to achieve ideal classification results. However, the interpretability is poor, and the model requires a large amount of data and has high requirements for hardware equipment. Summary of the invention
[0009] The technical problem to be solved by the present invention is to overcome the defects of the prior art and provide a multivariate time series state classification method and program product based on hierarchical analysis with high classification accuracy and credibility.
[0010] The technical solution adopted to solve the above technical problems is: a multivariate time series state classification method based on hierarchical analysis, comprising the following steps:
[0011] Step 1. Build a hierarchical analysis tree model
[0012] Construct a hierarchical analysis tree, with all features as leaf nodes and the final classification results of the intermediate non-leaf nodes as root nodes. The reference value of each feature is set to the mode of the corresponding category of the feature in all training data;
[0013] Step 2. Use differential evolution algorithm to optimize the judgment matrix of hierarchical analysis method;
[0014] Step 2.1. Create a population based on the hierarchical analysis tree. Each individual in the population represents an upper triangular matrix of all judgment matrices in the hierarchical analysis tree.
[0015] Step 2.2. Flatten all matrix elements in a single individual into vector form, select three different individuals at random in the population, and generate mutant individuals according to the following formula;
[0016]
[0017] In the formula, v i,G+1 is the i-th mutant individual in the G+1 generation population, is the r1th individual in the Gth generation population, is the r2th individual in the Gth generation population, x 3,G is the r3th individual in the Gth generation population, r1,r2,r3∈{1,2,3…NP}, NP is the total number of individuals in the population, F is the pre-set mutation factor, F∈[0,2];
[0018] Step 2.3. Perform element crossover operation on the mutated individuals and the non-mutated individuals with a certain probability CR to increase population diversity, and check the consistency ratio during crossover;
[0019] The crossover operation is:
[0020]
[0021] In the formula, u ji,G+1 is the jth element of the i-th individual in the G+1-th generation population, v ji,G+1 is the jth element of the ith mutant individual in the G+1th generation population, x ji,G is the jth element of the i-th unmutated individual in the G-th generation population, randb(j) is the random number of the j-th element, rnbr(i) is the random index of the i-th individual, and M is the total number of all elements in the individual after flattening;
[0022] Step 2.4. Restore the flattened individuals to the upper triangular matrix form, use the multi-classification cross entropy loss function to compare the crossed individuals with the uncrossed individuals, select the individuals with lower loss, and obtain the optimized judgment matrix;
[0023] Step 3. Generate preliminary decision results
[0024] Step 3.1. Use the optimized judgment matrix to calculate the single-layer weight through the arithmetic average method to obtain the hierarchical single sorting. According to the single sorting result, recursively calculate layer by layer to obtain the global weight GW;
[0025] Step 3.2. Obtain the matching degree between the reference value of each feature and the corresponding training data according to the following formula;
[0026]
[0027] Where D km is the matching degree between the reference value of the kth feature and the mth training data, R k is the reference value of the kth feature, c km is the mth training data of the kth feature, ∈ is 10 -5 , the matching degree of all features constitutes the matching degree matrix D;
[0028] Step 3.3. Multiply the global weight GW by the matching matrix D to obtain the preliminary decision result Y;
[0029] Step 4. Use the autoregressive model to extract time series information and combine it with the preliminary decision result Y to obtain the final classification result
[0030] Step 4.1. Construct an autoregressive model based on the preliminary decision result Y;
[0031] Step 4.2. Use the weighted least squares method to obtain the autoregressive model coefficients, solve the autoregressive model to obtain the final decision result, and for each category, perform one-hot encoding to obtain multiple time series. For each time series, calculate and predict the autoregressive model coefficients to obtain the final prediction matrix. Each row of the prediction matrix is the prediction probability of a category at all times.
[0032] Step 4.3. Take the subscript of the maximum probability in each column of the prediction matrix to obtain the final classification result.
[0033] As a preferred technical solution, in step 2.3, probability CR∈[0,1], randb(j)∈[0,1], and consistency ratio <0.1.
[0034] As a preferred technical solution, the multi-classification cross entropy loss function in step 2.4 is:
[0035]
[0036] In the formula, y is the class label of the training data, is the predicted class label, y c is the true probability of the cth category, c is the total number of categories, is the predicted probability of the cth category.
[0037] As a preferred technical solution, the autoregressive model in step 4 is:
[0038]
[0039] Where, X t is the prediction result of the autoregressive model, is the classification result of the hierarchical analysis method, a is a constant term, X is the sequence data of the label, φ0~φ p is the required coefficient, and p is the order of the autoregressive model.
[0040] A computer program product comprises a computer program / instruction, which, when executed by a processor, implements the steps of a multivariate time series state classification method based on hierarchical analysis.
[0041] The beneficial effects of the present invention are as follows:
[0042] 1. By combining the analytic hierarchy process and the autoregressive model, the present invention can simultaneously consider the interrelationships between the features of multivariate time series data and the temporal information of the data, thereby improving the accuracy of classification.
[0043] 2. The present invention uses the differential evolution algorithm to optimize the judgment matrix in the hierarchical analysis method, which reduces the high subjectivity in designing the judgment matrix in the traditional method and makes the result more credible.
[0044] 3. The present invention improves the efficiency of processing multivariate time series data to a certain extent by optimizing the judgment matrix and combining time series information.
[0045] 4. Compared with the AR model used alone, the model of the present invention has improved recall rate after combining the hierarchical analysis method, which means that the model can better identify all relevant categories and reduce missed detections. Moreover, by considering the temporal characteristics of the data, it can better handle the common noise, missing values and uneven sampling problems in practical applications, thereby improving the robustness of the model.
[0046] 5. The present invention has achieved improvements in all performance indicators, including macro-average and weighted average precision, recall, F1 score and accuracy. It can be applied to multiple fields of multivariate time series classification, such as financial market analysis, biomedical signal processing, environmental monitoring and industrial process control, and has the characteristics of wide adaptability. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 It is a schematic diagram of the process of the present invention. DETAILED DESCRIPTION
[0048] The present invention will be further described in detail below in conjunction with the accompanying drawings and examples, but the present invention is not limited to the following embodiments.
[0049] Example
[0050] exist Figure 1 In the embodiment, the multivariate time series state classification method based on hierarchical analysis includes the following steps:
[0051] Step 1. Build a hierarchical analysis tree model
[0052] Construct a hierarchical analysis tree, with all features as leaf nodes and the final classification results of the intermediate non-leaf nodes as root nodes. The reference value of each feature is set to the mode of the corresponding category of the feature in all training data;
[0053] Step 2. Use differential evolution algorithm to optimize the judgment matrix of hierarchical analysis method;
[0054] Step 2.1. Create a population based on the hierarchical analysis tree. Each individual in the population represents an upper triangular matrix of all judgment matrices in the hierarchical analysis tree.
[0055] Step 2.2. Flatten all matrix elements in a single individual into vector form, select three different individuals at random in the population, and generate mutant individuals according to the following formula;
[0056]
[0057] In the formula, v i,G+1 is the i-th mutant individual in the G+1 generation population, is the r1th individual in the Gth generation population, is the r2th individual in the Gth generation population, x 3,G is the r3th individual in the Gth generation population, r1,r2,r3∈{1,2,3…NP}, NP is the total number of individuals in the population, F is the pre-set mutation factor, F∈[0,2];
[0058] Step 2.3. Perform element crossover operation on the mutated individuals and the unmutated individuals with a certain probability CR to increase the population diversity, where the probability CR∈[0,1], and check the consistency ratio at the same time of crossover. Set the number of attempts attempt. If the judgment matrix still does not meet the consistency ratio less than 0.1 after more than attempt times, select the uncrossed individuals.
[0059] The crossover operation is:
[0060]
[0061] In the formula, u ji,G+1 is the jth element of the i-th individual in the G+1-th generation population, vji,G+1 is the jth element of the ith mutant individual in the G+1th generation population, x ji,G is the jth element of the i-th unmutated individual in the G-th generation population, randb(j) is the random number of the j-th element, rnbr(i) is the random index of the i-th individual, and M is the total number of all elements in the individual after flattening;
[0062] Step 2.4. Restore the flattened individuals to the upper triangular matrix form, use the multi-classification cross entropy loss function to compare the crossed individuals with the uncrossed individuals, select the individuals with lower loss, and obtain the optimized judgment matrix A;
[0063] Among them, the multi-classification cross entropy loss function is:
[0064]
[0065] In the formula, y is the class label of the training data, is the predicted class label, y c is the true probability of the cth category, c is the total number of categories, is the predicted probability of the cth category;
[0066] Step 3. Generate preliminary decision results
[0067] Step 3.1. Use the optimized judgment matrix A to calculate the single-layer weight through the arithmetic average method to obtain the hierarchical single sorting. According to the single sorting result, recursively calculate layer by layer to obtain the global weight GW;
[0068] Step 3.2. Obtain the matching degree between the reference value of each feature and the corresponding training data according to the following formula;
[0069]
[0070] Where D km is the matching degree between the reference value of the kth feature and the mth training data, R k is the reference value of the kth feature, c km is the mth training data of the kth feature, ∈ is 10 -5 , the matching degree of all features constitutes the matching degree matrix D;
[0071] Step 3.3. Multiply the global weight GW by the matching matrix D to obtain the preliminary decision result Y;
[0072] Step 4. Use the autoregressive model to extract time series information and combine it with the preliminary decision result Y to obtain the final classification result
[0073] Step 4.1. Based on the preliminary decision result Y, construct an autoregressive model of order p:
[0074]
[0075] Where, X t is the prediction result of the autoregressive model, is the classification result of the hierarchical analysis method, a is a constant term, X is the sequence data of the label, φ0~φ p is the required coefficient;
[0076] Step 4.2. In order to improve the generalization ability of the model, especially to improve the performance of processing unbalanced data, the weighted least squares method is used to obtain the autoregressive model coefficients, and the autoregressive model is solved to obtain the final decision result, which is as follows:
[0077] Step S1. Construct the weight matrix W
[0078] The weight is assigned according to whether the previous sample and the predicted sample have changed. If the class label of the predicted sample has changed relative to the previous sample, the weight assigned is the number of predicted samples with unchanged class labels in the sample, denoted as g. Otherwise, the weight is assigned as the number of predicted samples with changed class labels in the sample, denoted as h. Based on this, the weight vector w is obtained, and w is used as the main diagonal element to form the weight matrix W;
[0079] Step S2. Construct a calculation matrix Z, which has tp rows in total;
[0080] Construct the calculation matrix Z row s according to the following rules s :
[0081]
[0082] In the formula, p is the order of the autoregressive model, is the prediction result of the hierarchical analysis method for the s+pth moment, x s is the sth row of time series data to be predicted;
[0083] Step S3. Solve the weighted least squares as follows:
[0084] φ=(Z T WZ) -1 Z T Wy
[0085] Among them, Z is the calculation matrix, W is the weight matrix, y is the observation vector, and φ is the autoregressive model coefficient.
[0086] Step S4. Input the autoregressive model coefficient φ into the following formula to obtain the final decision result;
[0087]
[0088] Where Y tis the predicted probability of the final result at time t, Y t-1 is the state at the moment before time t;
[0089] For each category, one-hot encoding is performed to obtain multiple time series. The autoregressive model coefficients are calculated and predicted for each time series to obtain the final prediction matrix. Each row of the prediction matrix is the prediction probability of a category at all times.
[0090] Step 4.3. Take the subscript of the maximum probability in each column of the prediction matrix to obtain the final classification result.
[0091] A computer program product comprises a computer program / instruction, which implements the steps of the method described in the embodiment when the computer program / instruction is executed by a processor.
[0092] experiment
[0093] In order to verify the beneficial effects of the present invention, the applicant conducted the following simulation experiments.
[0094] 1. Simulation conditions
[0095] (1) The experiment is divided into three groups: single analytic hierarchy process (AHP), single AR model, and the method of the present invention: Data set selection UCI data set activity recognition with healthy older people using a bat-teryless wearable sensor. The data set contains the motion data of 14 healthy elderly people aged between 66 and 86 years old, including seven features: X-axis acceleration, Y-axis acceleration, Z-axis acceleration, antenna sensor ID, received signal strength indicator, stage, frequency, and four categories: sitting on a chair, sitting on a bed, lying down, and walking.
[0096] (2) Dataset processing: First, remove discrete features: antenna sensor ID. Hierarchy analysis training set: randomly select a fixed number of samples from each class label in all data of the same person. AR model training set: continuous data of the same person within a certain time interval. Test set: continuous data of the same person within a certain time interval.
[0097] 2. The simulation content and results are shown in Table 1 below.
[0098] Table 1
[0099]
[0100] Simulation results: As can be seen from Table 1, the classification effect of the present invention is significantly improved compared with that of AR or AHP alone. The AR model alone performs best in accuracy, but is slightly insufficient in recall. The AHP model alone cannot extract the time series information in the data, so it is slightly lacking in accuracy and recall. The model of the present invention can not only extract the relationship between features, but also combine the time series relationship before and after the data, so that the model can achieve improvements in all performance indicators.
[0101] In summary, after combining the AR and AHP models, the present invention has achieved a good performance improvement in the classification of multi-classification time series data.
Claims
1. A multivariate time series state classification method based on hierarchical analysis, It is characterized in that The following steps are involved: Step 1. Build a hierarchical analysis tree model Construct a hierarchical analysis tree, with all features as leaf nodes and the final classification results of the intermediate non-leaf nodes as root nodes. The reference value of each feature is set to the mode of the corresponding category of the feature in all training data; Step 2. Use differential evolution algorithm to optimize the judgment matrix of hierarchical analysis method; Step 2.
1. Create a population based on the hierarchical analysis tree. Each individual in the population represents an upper triangular matrix of all judgment matrices in the hierarchical analysis tree. Step 2.
2. Flatten all matrix elements in a single individual into vector form, select three different individuals at random in the population, and generate mutant individuals according to the following formula; In the formula, v i,G+1 is the i-th mutant individual in the G+1 generation population, is the rth population in the Gth generation 1 Individuals, is the rth population in the Gth generation 2 Individuals, x 3,G is the rth population in the Gth generation 3 Individuals, r 1 ,r 2 ,r 3 ∈{1,2,3…NP}, NP is the total number of individuals in the population, F is the pre-set variation factor, F∈[0,2]; Step 2.
3. Perform element crossover operation on the mutated individuals and the non-mutated individuals with a certain probability CR to increase population diversity, and check the consistency ratio during crossover; The crossover operation is: In the formula, u ji,G+1 is the jth element of the i-th individual in the G+1-th generation population, v ji,G+1 is the jth element of the ith mutant individual in the G+1th generation population, x ji,G is the jth element of the i-th unmutated individual in the G-th generation population, randb(j) is the random number of the j-th element, rnbr(i) is the random index of the i-th individual, and M is the total number of all elements in the individual after flattening; Step 2.
4. Restore the flattened individuals to the upper triangular matrix form, use the multi-classification cross entropy loss function to compare the crossed individuals with the uncrossed individuals, select the individuals with lower loss, and obtain the optimized judgment matrix; Step 3. Generate preliminary decision results Step 3.
1. Use the optimized judgment matrix to calculate the single-layer weight through the arithmetic average method to obtain the hierarchical single sorting. According to the single sorting result, recursively calculate layer by layer to obtain the global weight GW; Step 3.
2. Obtain the matching degree between the reference value of each feature and the corresponding training data according to the following formula; Where D km is the matching degree between the reference value of the kth feature and the mth training data, R k is the reference value of the kth feature, c km is the mth training data of the kth feature, ∈ is 10 -5 , the matching degree of all features constitutes the matching degree matrix D; Step 3.
3. Multiply the global weight GW by the matching matrix D to obtain the preliminary decision result Y; Step 4. Use the autoregressive model to extract time series information and combine it with the preliminary decision result Y to obtain the final classification result Step 4.
1. Construct an autoregressive model based on the preliminary decision result Y; Step 4.
2. Use the weighted least squares method to obtain the autoregressive model coefficients, solve the autoregressive model to obtain the final decision result, and for each category, perform one-hot encoding to obtain multiple time series. For each time series, calculate and predict the autoregressive model coefficients to obtain the final prediction matrix. Each row of the prediction matrix is the prediction probability of a category at all times. Step 4.
3. Take the subscript of the maximum probability in each column of the prediction matrix to obtain the final classification result.
2. According to the multivariate time series state classification method based on hierarchical analysis according to claim 1, Features: In step 2.3, probability CR∈[0,1], randb(j)∈[0,1], and consistency ratio <0.
1.
3. According to the multivariate time series state classification method based on hierarchical analysis as claimed in claim 1, It is characterized in that The multi-classification cross entropy loss function in step 2.4 is: In the formula, y is the class label of the training data, is the predicted class label, y c is the true probability of the cth category, c is the total number of categories, is the predicted probability of the cth category.
4. According to the multivariate time series state classification method based on hierarchical analysis as claimed in claim 1, It is characterized in that The autoregressive model in step 4 is: In the formula, X t is the prediction result of the autoregressive model, is the classification result of the hierarchical analysis method, a is a constant term, X is the sequence data of the label, φ 0 ~φ p is the required coefficient, and p is the order of the autoregressive model.
5. A computer program product comprising a computer program / instructions, It is characterized in that When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
