Abstract:In the anomaly detection of time series data, a single model often only extracts temporal features related to its model structure and thus tends to ignore other features. At the same time, facing large-scale temporal data, it is difficult for models to model local trends in temporal data. To address these two issues, this study proposes an anomaly detection model called PEAD based on particle swarm optimization (PSO) and external knowledge. The PEAD model uses a deep learning model as the base model and introduces external knowledge generated by the fast Fourier transform to improve the modeling ability of the base model for local trends. Subsequently, the PEAD model trains the base model through Stacking ensemble learning and then uses the PSO algorithm to sum the weighted output of the base model. The weighted sum of the reconstructed data is used for anomaly detection. The PSO algorithm enables the final output of the model to focus on the global and temporal features of the temporal data and enriches the temporal features extracted by the model, thereby improving its anomaly detection ability. By testing six publicly available datasets, the research results show that the PEAD model performs well on most of the datasets.