## 4 Similarity Measurement Model and Clustering Model
### Algorithm Structure  
The detailed process of the MDCAE-CSBD-Vol algorithm is shown in Figure 2.  
Firstly, the time series data is input into the system, and the max-min normalization processing of the data is performed to ensure that the data is compared on the same scale. The normalization formula is as follows:  
\[x^{\prime}=\frac{x-min}{max-min} \tag{5}\]  
where \(max\) represents the maximum value of the time series within this time period, and \(min\) represents the minimum value.  
Although max-min normalization ensures that different time series are brought to a common scale, it may obscure differences in variance and potentially distort the relative distances between data points. To mitigate this issue, the proposed MDCAE-CSBD-Vol model incorporates several robustness mechanisms. First, the MDCAE architecture leverages multi-scale fusion and dilated convolutions to extract hierarchical features that capture both local fluctuations and global patterns, which are less sensitive to raw value scales. Second, spectral regularization is applied during training to prevent overfitting to particular scale ranges. Finally, in the similarity measurement phase, we introduce a volatility-based distance metric that includes statistical descriptors such as variance, kurtosis, and interquartile range. These enhancements ensure that the model maintains robustness against the limitations of basic normalization and preserves essential shape characteristics of the time series.  
After the time series data is input into the system, the combination of the MDCAE model and the CSBD algorithm, after performing the max-min normalization processing of the data, ensures the comparison of different time series on a unified scale. This process covers the calculation of the maximum and minimum values of the data within a specific time period. Then, based on the normalized data, the model is initialized according to the characteristics of the specific time series data, and the appropriate size of the constrained time window and the optimal number of iterations are determined. During the model training stage, the early stopping method is used to determine whether the best model fitting effect is achieved. Specifically, we monitor the changes in four clustering evaluation metrics: Silhouette Coefficient (SC), Rand Index (RI), Adjusted Rand Index (ARI) and Normalized Mutual Information (NMI). If none of these indicators improve significantly within 10 consecutive iterations, the training is terminated early. This prevents overfitting and reduces unnecessary computation.  
After the training is completed, the low-dimensional feature vectors extracted by the model are used to perform the initial k-means clustering, and the evaluation index of the clustering effect, such as the Rand Index (RI), is recorded at the same time. At this time, the CSBD algorithm calculates the shape similarity index of each time series based on the extracted feature vectors and constructs the similarity matrix. Using this matrix, the algorithm performs iterative clustering, and dynamically adjusts the size of the constrained  
Figure 2: Flowchart of the MDCAE-CSBD-Vol algorithm.  
time window during the process until the clustering effect no longer improves significantly and then outputs the final clustering result to complete the clustering analysis task of the time series.