Time sequence clustering method based on u-Shape

By using discrete feature representation method DFR and extended Euclidean distance EED in the time series clustering algorithm, combining random masking technology and u-shapelets characteristics, the problems of high computational complexity and low clustering accuracy in the existing technology are solved, and the problem of high computational complexity and low clustering accuracy in the existing technology is realized. High-quality u-shapelets selection and superior clustering performance.

CN118940061AInactive Publication Date: 2024-11-12LANZHOU JIAOTONG UNIV
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202410946229.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-15
Publication Date
2024-11-12
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing time-series clustering algorithm based on u-shapelets may filter out high-recognition subsequences in the process of reducing the computational complexity, resulting in lower clustering accuracy.

Method used

The discrete feature representation method DFR represents the subsequence, and uses the extended Euclidean distance EED to measure the similarity between sequences, combined with random masking technology and u-shapelets characteristics to perform cluster division to ensure high-quality u-shapelets selection, while controlling The time complexity of the algorithm.

Benefits of technology

Effectively capture the key information and morphological changes of the time series, improve clustering accuracy, reduce computational complexity, and achieve better clustering performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118940061A_ABST
    Figure CN118940061A_ABST
Patent Text Reader

Abstract

The invention discloses a time sequence clustering method based on u-Shape, and relates to the technical field of unsupervised learning, the method takes time sequence clustering analysis with subsequences as objects, each extracted u-Shape can be used as a core common feature of a class, and the time sequence clustering analysis is carried out on the basis of the extracted u-Shape. All time sequences in the category have a sub-sequence similar to the u-shape in form, a basis is provided for clustering the corresponding time sequences in the data set, high interpretability is achieved, meanwhile, clustering is carried out through the difference of local features between different time sequences, the influence of noise data can be reduced, and the clustering efficiency is improved. And the method is suitable for sequences with different lengths.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of unsupervised learning, and in particular to a time series clustering method based on u-shapelets. Background Art

[0002] As an important unsupervised learning method, time series clustering has become a research hotspot. It can reveal the structure and regularity in the data and effectively analyze and understand the time series data.

[0003] In 2012, Keogh et al. proposed a time series clustering algorithm BruteForce based on u-shapelets (unsupervised-shapelets). Among them, u-shapelet is a discriminative subsequence in the time series. This method uses local shape features to distinguish the differences between sequences. It not only has high clustering accuracy, but also has good interpretability of clustering results. However, the BruteForce method has O(n 2 m 4 ), which leads to a high computational cost. In order to reduce the time complexity of the algorithm, researchers have proposed many methods to speed up the selection process of u-shapelets, but they focus on reducing the magnitude of candidate sets, which may cause highly discriminative subsequences to be filtered out, resulting in low clustering accuracy of the algorithm.

[0004] The present invention provides a time series clustering algorithm PUSH based on u-shapelets, which aims to select a group of high-quality u-shapelets while ensuring that the computational complexity of the algorithm is low, so as to improve the accuracy of time series clustering. Summary of the invention

[0005] The purpose of the present invention is to provide a time series clustering method based on u-shapelets in order to solve the above problems.

[0006] To achieve the above object, the technical solution adopted by the present invention is:

[0007] According to one aspect of the present invention, a time series clustering method based on u-shapelets is provided. The extracted subsequences are represented by a discrete feature representation method DFR to capture the morphological change trend and key information of the subsequences. Then, the extended Euclidean distance EED is used to measure the similarity between sequences to fully explore the trend information captured by DFR. Finally, the characteristics of u-shapelets are used to perform cluster division to obtain the clustering results, which are as follows:

[0008] S1: Time Series Representation: DFR

[0009] The DFR method uses a sliding window to discretely represent the time series, where the sliding window refers to a window of size w, which is used to slide from the starting point to the end point of the time series with a step size of sl. In the following, S = T j-2,l ={t j-2 ,t j-1 ,t j ...,t j+l-3} as an example, define the sequence in the sliding window as Q = {t x ,t x+1 ,...,t x+w-1}, the specific processing steps of DFR are given, and sl is fixed to 1;

[0010] Step 0. Initialize two lists and They are used to store the intermediate variables and the final discrete results obtained during the window sliding process;

[0011] Step 1. Calculate the global mean (gmean) and local mean (lmean) of S:

[0012]

[0013] Step 2. Update the list based on the sorted index of Q tmp :

[0014]

[0015] Among them, argsort(Q) returns the index of Q in ascending order, and argsort(-Q) returns the index of Q in descending order;

[0016] Step 3. Calculate the list dis :

[0017]

[0018] Among them, list dis Represents list dis The value of the i-th element in Q, indexof(Q,S[i]) is used to find the position index of S[i] in Q, m is the number of times the sliding window passes through S[i], and the final list is dis It is the discrete representation result of DFR;

[0019] S2: Distance metric: EED

[0020] Most time series clustering methods based on u-shapelets use length-normalized Euclidean distance to measure the similarity between time series columns, as described in Equation 7, where C is the positive correlation coefficient, as described in Equation 8,

[0021]

[0022] However, before using this distance, the time series needs to be z-normalized, which will greatly change the original meaning of the data, so that only the relationship between the data can be compared. To overcome this limitation, the extended Euclidean distance EED is derived from formula 7. The derivation process is shown in formula 9:

[0023]

[0024] Then calculate the distance between two unequal time series, as shown in formula 10:

[0025] sdist(S,T)=min 1≤i≤n-l EED(S,T i,l ); [1≤l≤n] (10)

[0026] S3: Algorithm clustering process

[0027] By using DFR to represent subsequences and obtaining u-shapelet candidate sets for pre-clustering, finally, clustering is performed using the u-shapelet feature. The left part is a single cluster, using each found Iteratively split the data and remove D A The time series in the dataset are Search and repeat this process until convergence, and finally get the clustering result.

[0028] Furthermore, the time complexity of each step is as follows: Let n be the number of time series and m be the length of the time series;

[0029] In S1, the time complexity of using the DFR method to represent all extracted subsequences is O(2sLen·(m-sLen+1)), where sLen is the length of the subsequence;

[0030] In S2, the time complexity of selecting candidate subsequences by random masking technology is

[0031] O(projectionNum)·O(sLen)·O(sLen)=O(projectionNum·sLen 2 ), where projectionNum is the number of rounds of random masking; the number of candidate subsequences remaining after filtering by random masking technology is z =0.01·(m-sLen+1);

[0032] In S3, the u-shapelet is extracted and clustered. The time complexity of calculating the distance between all candidate subsequences and n time series is O(z·sLen·m·n), and the time complexity of calculating the gap value of all candidate subsequences is O(z·n). Therefore, the time complexity of this step is O(z·sLen·m·n+z·n);

[0033] In summary, the total time complexity of the algorithm is O(2sLen·(m-sLen+1)+projectionNum·sLen 2 +z·sLen·m·n+z·n), where slen and projectionNum are both constants, so the time complexity is finally simplified to O(n·m 2 ).

[0034] Compared with the prior art, the present invention has the following beneficial effects:

[0035] ① A time series representation method DFR is proposed, which can effectively capture the key information and morphological change trends of time series.

[0036] ② The extended Euclidean distance (EED) is derived from the length-normalized Euclidean distance, which can more accurately measure the similarity between time series after feature representation.

[0037] ③The PUSH algorithm combines DFR and EED, which can effectively extract high-quality u-shapelets and has better clustering performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 This is a visual comparison of the DFR method and the classic SAX method;

[0039] Figure 2 This is a block diagram of the PUSH algorithm of the present invention. DETAILED DESCRIPTION

[0040] In order to make the technical means, creative features, objectives and effects achieved by the present invention easy to understand, the present invention is further explained below in conjunction with specific implementation methods.

[0041] The present invention provides a time series clustering method based on u-shapelets, using a time series data set D ={T 1 , T 2 ,..., T n} as an example. Each sample T i (1≤i≤n) contains an ordered set of real values, denoted by T i ={t1 ,t 2 ,...,t m}, where m is T i Length.

[0042] ① Subsequence: Subsequence S is a continuous sequence of a time series. i The subsequence S of length l starting at position j can be written as S = T j,l =t j ,t j+1 ,...,t j+l-1 .

[0043] ②Subsequence distance: subsequence S and time series T i The subsequence distance sdist(S,T i ) is relative to T i to "slide" S to find the minimum alignment distance.

[0044] ③u-shapelet candidate set: contains all candidate subsequences obtained through screening.

[0045] ④u-shapelet: the most recognizable time series segment. u-shapelet can be used in two subsets of dataset D (respectively denoted as D A and D B ) and meet the following conditions:

[0046] mean(sdist(S,D A ))< <mean(sdist(S,D B )).

[0047] ⑤gap: used to evaluate the quality of candidate u-shapelet:

[0048] gap=μ B -σ B -(μ A +σ A ) (1)

[0049] where μ A and μ B Respectively represent mean(sdist(S,D A )) and mean(sdist(S,D B )); A and σ B Respectively represent sdist(S,D A ) and sdist(S,D B )’s standard deviation.

[0050] The technology of the present invention uses the discrete feature representation method DFR to represent the extracted subsequences to capture the morphological change trend and key information of the subsequences. Then, the extended Euclidean distance EED is used to measure the similarity between sequences to fully explore the trend information captured by DFR, and finally the characteristics of u-shapelets are used to perform clustering to obtain the clustering results.

[0051] ①Time series representation: DFR

[0052] The DFR method uses a sliding window to discretely represent the time series. The sliding window refers to a window of size w, which is used to slide from the starting point to the end point of the time series with a step size of sl. j-2,l ={t j-2 ,t j-1 ,t j ...,t j+l-3} as an example, define the sequence in the sliding window as Q = {t x ,t x+1 ,...,t x+w-1}, the specific processing steps of DFR are given. Note that here we fix sl to 1.

[0053] Step 0. Initialize two lists and They are used to store the intermediate variables and the final discrete results obtained during the window sliding process.

[0054] Step 1. Calculate the global mean (gmean) and local mean (lmean) of S:

[0055]

[0056] Step 2. Update the list based on the sorted index of Q tmp :

[0057]

[0058] Among them, argsort(Q) returns the index of Q in ascending order, and argsort(-Q) returns the index of Q in descending order.

[0059] Step 3. Calculate the list dis :

[0060]

[0061] Among them, list dis Represents list disThe value of the i-th element in Q, indexof(Q,S[i]) is used to find the position index of S[i] in Q, and m is the number of times the sliding window passes through S[i]. The final list is dis DFR discrete representation results.

[0062] ②Distance metric: EED

[0063] Most time series clustering methods based on u-shapelets use length-normalized Euclidean distance. [4] To measure the similarity between sequences (Formula 7), where C is the positive correlation coefficient (Formula 8).

[0064]

[0065] However, since the time series needs to be z-normalized before using this distance, this will greatly change the original meaning of the data, so that only the relationship between the data can be compared. To overcome this limitation, we derive the extended Euclidean distance (EED) from the length-normalized Euclidean distance. The derivation process is shown in Equation 9.

[0066] The EED method does not require z-normalization and preserves the integrity and original characteristics of the time series. This feature allows the key information and trends captured by the discrete feature representation (DFR) to be fully preserved, allowing the EED method to more effectively mine this information in order to identify and select the optimal set of u-shapelets.

[0067]

[0068] Often, we also need to compute the distance between two unequal time series. Specifically, for a (usually short) subsequence S and a (usually much longer) time series T, we "slide" S relative to T to find the alignment that minimizes the distance, as shown in Equation 10.

[0069] sdist(S,T)=min 1≤i≤n-l EED(S,T i,l ); [1≤l≤n] (10)

[0070] ③Algorithm clustering process

[0071] PUSH is performed in three steps, namely (1) using DFR to represent subsequences, (2) obtaining u-shapelet candidate sets and (3) clustering by u-shapelet. The detailed process of PUSH is outlined in Algorithm 1. The first two steps are the pre-clustering stage, and the third step is clustering to obtain the clustering results. PUSH takes one input parameter, namely The length of (denoted as sLen).

[0072] In the first step, it drags a The same length window is used. Each new subsequence obtained through this process is converted into a discrete representation using DFR. In the second step, it uses random masking technology to filter the discrete representation subsequences obtained in the first step and selects 1% of the subsequences as the u-shapelet candidate set. In the third step, the gap scores of all subsequences of the u-shapelet candidate set are first calculated and sorted. The subsequence with the highest gap score is the current Then, the u-shapelet feature is used for clustering. We believe The left part is a single cluster, using each found Iteratively split the data, we remove D A The time series in the dataset are Search. Repeat this process until convergence, and finally get the clustering result.

[0073] ④Time complexity

[0074] Let n be the number of time series and m be the length of the time series. In the first step, the time complexity of using the DFR method to represent all extracted subsequences is O(2sLen·(m-sLen+1)), where sLen is the length of the subsequence. In the second step, the time complexity of using random masking technology to select candidate subsequences is

[0075] O(projectionNum)·O(sLen)·O(sLen)=O(projectionNum·sLen 2 ), where projectionNum is the number of rounds of random masking. The number of candidate subsequences remaining after filtering with random masking technology is z=0.01·(m-sLen+1). The third step is to extract u-shapelet and perform clustering. The time complexity of calculating the distance between all candidate subsequences and n time series is O(z·sLen·m·n), and the time complexity of calculating the gap value of all candidate subsequences is O(z·n). Therefore, the time complexity of this step is O(z·sLen·m·n+z·n). In summary, the total time complexity of the algorithm is

[0076] O(2sLen·(m-sLen+1)+projectionNum·sLen 2 +z·sLen·m·n+z·n), where slen and projectionNum are both constants, so the time complexity is finally simplified to O(n·m 2 ).

[0077] This method uses subsequences as the object of time series clustering analysis. Each extracted u-shapelet can be used as the core common feature of a class, and all time series in the class have a subsequence with a similar shape to the u-shapelet. This provides a basis for clustering the corresponding time series in the data set and has strong interpretability. At the same time, clustering using the differences in local features between different time series can reduce the impact of noise data and is applicable to sequences of different lengths.

[0078] Example data and evaluation results

[0079] This example uses 13 real-world datasets published in the UCR Time Series Library. The details are summarized in Table 1. Table 1 lists the number of sequence instances, the number of categories, and the length of the time series for each dataset.

[0080] Table 1 Description of the datasets used in the experiments

[0081]

[0082] Note: #CL:Number of clusters.#EL:Number of elements.#LEN:Time serieslength.#TYPE:Dataset type.

[0083] To verify the effectiveness of this algorithm, we compared PUSH with 12 algorithms of three different types:

[0084] 1) Time series clustering algorithms based on u-shapelets, including BruteForce, SUSH, USSL, and FOTS;

[0085] 2) Unsupervised feature selection methods based on original time series, including UDFS, NDFS, RUFS and RSFS;

[0086] 3) Time series clustering algorithms based on deep learning frameworks, including DEC, DSC, SDCN, and DTC.

[0087] Table 2 RI comparison on 12 comparison algorithms

[0088]

[0089]

[0090] We used the Rand Index (RI) baseline for evaluation. Table 1 summarizes the experimental results on the 13 datasets. The best results are marked in bold. From Table 1, we can see that the PUSH method has the highest RI value in all 13 datasets.

[0091] (2) Visual comparison between the DFR method and the classic SAX method

[0092] like Figure 1 As shown in the figure, DFR (red) and SAX (blue) show different effects in capturing the trends and characteristics of the original time series (black). In Figure (a), DFR (red) closely follows the original time series (black), closely capturing sharp turning points at about 5, 10, 15 and 20 on the x-axis, demonstrating its advantage in capturing the morphological changes and detailed characteristics of the time series. In Figure (b), DFR also shows excellent follow-up, accurately depicting the peaks and troughs of the original data, further demonstrating its ability to capture key changes. In contrast, SAX (blue) shows a smoother trend in Figures (a) and (b), and does not effectively capture sharp turning points and key peaks and troughs.

[0093] Figure 2 The proposed PUSH framework. From the original time series (①), we extract all subsequences of length sLen (②); the extracted subsequences are represented by the DFR method, and the candidate subsequence set is obtained by random masking technology (③); u-shapelet is selected, and the similarity between it and the time series is calculated using the EED method and clustered (④). Then, this process is repeated until convergence. Finally, the clustering result is obtained (⑤).

[0094] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and scope of the equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.

[0095] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.

Claims

1. A time series clustering method based on u-shapelets, characterized by: The discrete feature representation method DFR is used to represent the extracted subsequences to capture the morphological change trend and key information of the subsequences. Then, the extended Euclidean distance EED is used to measure the similarity between sequences to fully explore the trend information captured by DFR. Finally, the characteristics of u-shapelets are used to perform clustering to obtain the clustering results, as follows: S1: Time Series Representation: DFR The DFR method uses a sliding window to discretely represent the time series, where the sliding window refers to a window of size w, which is used to slide from the starting point to the end point of the time series with a step size of sl. In the following, S = T j-2,l ={t j-2 ,t j-1 ,t j ...,t j+l-3 } as an example, define the sequence in the sliding window as Q = {t x ,t x+1 ,...,t x+w-1 }, the specific processing steps of DFR are given, and sl is fixed to 1; Step 0. Initialize two lists and They are used to store the intermediate variables and the final discrete results obtained during the window sliding process; Step 1. Calculate the global mean gmean and local mean lmean of S: Step 2. Update the list based on the sorted index of Q tmp : Among them, argsort(Q) returns the index of Q in ascending order, and argsort(-Q) returns the index of Q in descending order; Step 3. Calculate the list dis : Among them, list dis Represents list dis The value of the i-th element in Q, indexof(Q,S[i]) is used to find the position index of S[i] in Q, m is the number of times the sliding window passes through S[i], and the final list is dis It is the discrete representation result of DFR; S2: Distance metric: EED Most time series clustering methods based on u-shapelets use length-normalized Euclidean distance to measure the similarity between time series, as described in Equation 7, where C is the positive correlation coefficient, as described in Equation 8, However, before using this distance, the time series needs to be z-normalized, which will greatly change the original meaning of the data, so that only the relationship between the data can be compared. To overcome this limitation, the extended Euclidean distance EED is derived from formula 7. The derivation process is shown in formula 9: Then calculate the distance between two unequal time series, as shown in formula 10: sdist(S,T)=min 1≤i≤n-l EED(S,T i,l );[1≤l≤n] (10) S3: Algorithm clustering process By using DFR to represent subsequences and obtaining u-shapelet candidate sets for pre-clustering, finally, clustering is performed using the u-shapelet feature. The left part is a single cluster, using each found Iteratively split the data and remove D A The time series in the dataset are Search and repeat this process until convergence, and finally get the clustering result.

2. A time series clustering method based on u-shapelets according to claim 1, characterized in that: The time complexity of each step is as follows: Let n be the number of time series and m be the length of the time series; In S1, the time complexity of using the DFR method to represent all extracted subsequences is O(2sLen·(m-sLen+1)), where sLen is the length of the subsequence; In S2, the time complexity of selecting candidate subsequences by random masking technology is O(projectionNum)·O(sLen)·O(sLen)=O(projectionNum·sLen 2 ), where projectionNum is the number of rounds of random masking; the number of candidate subsequences remaining after filtering by random masking technology is z=0.01·(m-sLen+1); In S3, the u-shapelet is extracted and clustered. The time complexity of calculating the distance between all candidate subsequences and n time series is O(z·sLen·m·n), and the time complexity of calculating the gap value of all candidate subsequences is O(z·n). Therefore, the time complexity of this step is O(z·sLen·m·n+z·n); In summary, the total time complexity of the algorithm is O(2sLen·(m-sLen+1)+projectionNum·sLen 2 +z·sLen·m·n+z·n), where slen and projectionNum are both constants, so the time complexity is finally simplified to O(n·m 2 ).

Citation Information

Cited By

  • Emergency control fault scene simplification method based on time sequence track feature mining

    CN119089223A