TFB: Towards Comprehensive and Fair Benchmarking of Time Series Forecasting Methods

https://http://arxiv.org/abs/2403.20150

Foundation Models for Time Series Analysis: A Tutorial and Survey

https://http://arxiv.org/abs/2403.14735

Large Language Models for Forecasting and Anomaly Detection: A Systematic Literature Review

https://arxiv.org/abs/2402.1035

Unsupervised Model Selection for Time Series Anomaly Detection (ICLR 2023) [paper]

TimesNet: Temporal 2D-Variation Modeling for General Time Series Analysis (ICLR 2023) [paper]

Detecting Multivariate Time Series Anomalies with Zero Known Label (AAAI 2023) [paper]

Towards a rigorous evaluation of time-series anomaly detection (AAAI 2022) [paper]

Ts2vec: Towards universal representation of time series (AAAI 2022) [paper]

Deep variational graph convolutional recurrent network for multivariate time series anomaly detection (ICML 2022) [paper]

Rethinking graph neural networks for anomaly detection (ICML 2022) [paper]

GRELEN: Multivariate time series anomaly detection from the perspective of graph relational learning (IJCAI 2022) [paper]

Neural Contextual Anomaly Detection for Time Series (IJCAI 2022) [paper]

Time Series Anomaly Detection with Association Discrepancy (ICLR 2022) [paper]

Graph-augmented normalizing flows for anomaly detection of multiple time series (ICLR 2022) [paper]

Graph Neural Network-Based Anomaly Detection in Multivariate Time Series (AAAI 2021) [paper]

Time Series Anomaly Detection with Multiresolution Ensemble Decoding (AAAI 2021) [paper]

Neural Transformation Learning for Deep Anomaly Detection Beyond Images (ICML 2021) [paper]

Conformal prediction interval for dynamic time-series (ICML 2021) [paper]

Timeseries anomaly detection using temporal hierarchical one-class network (NeurIPS 2020) [paper]

基于LOF和CBLOF的时间序列异常检测(Python,pyod模块) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:基于LOF和CBLOF的时间序列异常检测(Python,pyod模块)

基于孤立森林-KNN的时间序列异常检测(Python,pyod模块) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:基于孤立森林-KNN的时间序列异常检测(Python,pyod模块)

基于正态分布的时间序列异常检测(Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:基于正态分布的时间序列异常检测(Python)

基于深度学习的时间序列预测、异常检测和降维(Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:基于深度学习的时间序列预测、异常检测和降维(Python)

简单的基于机器学习的时间序列异常检测(Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:简单的基于机器学习的时间序列异常检测(Python)

基于Luminaire模块的时间序列异常检测(Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:基于Luminaire模块的时间序列异常检测(Python)

基于changefinder模块的变点检测方法(Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:基于changefinder模块的变点检测方法(Python)

简单基于的Prophet时间序列异常检测(Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:简单基于的Prophet时间序列异常检测(Python)

基于机器学习的分离器罐压力时间序列异常检测(第4部分,Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:基于机器学习的分离器罐压力时间序列异常检测(第4部分,Python)

基于机器学习的分离器罐压力时间序列异常检测(第3部分,Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:基于机器学习的分离器罐压力时间序列异常检测(第3部分,Python)

基于机器学习的分离器罐压力时间序列异常检测(第2部分,Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:基于机器学习的分离器罐压力时间序列异常检测(第2部分,Python)

基于机器学习的分离器罐压力时间序列异常检测(第1部分,Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:基于机器学习的分离器罐压力时间序列异常检测(第1部分,Python)

泵传感器时间序列异常检测(Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:泵传感器时间序列异常检测(Python)

对NASA的铣刀磨损数据进行数据分析、时间序列预测和异常检测(Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:对NASA的铣刀磨损数据进行数据分析、时间序列预测和异常检测(Python)

简单地基于ADTK模块的KPI时间序列异常检测(Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:简单地基于ADTK模块的KPI时间序列异常检测(Python)

基于DeepAnt方法的时间序列异常检测(Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:基于DeepAnt方法的时间序列异常检测(Python)

基于ARIMA, LSTM和DBSCAN的时间序列异常检测(Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:基于ARIMA, LSTM和DBSCAN的时间序列异常检测(Python)

基于STL的时间序列异常检测(Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:基于STL的时间序列异常检测(Python)

基于聚类算法的时间序列异常检测(Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:基于聚类算法的时间序列异常检测(Python)

基于机器学习和深度学习的时间序列异常检测(Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:基于机器学习和深度学习的时间序列异常检测(Python)

简单地基于向量自回归和统计检验的时间序列异常检测(Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:简单地基于向量自回归和统计检验的时间序列异常检测(Python)

基于KNN的时间序列异常检测(Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:基于KNN的时间序列异常检测(Python)

基于深度学习模型的多元时间序列数据异常检测(Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:基于深度学习模型的多元时间序列数据异常检测(Python)

基于STL模型的时间序列数据异常检测(Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:基于STL模型的时间序列数据异常检测(Python)

基于机器学习的物联网温度时间序列数据异常检测(Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:基于机器学习的物联网温度时间序列数据异常检测(Python)

基于DARTS模块的时间序列异常检测(Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:基于DARTS模块的时间序列异常检测(Python)

基于机器学习股票时间序列数据异常检测(Python,ADTK工具包) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:基于机器学习股票时间序列数据异常检测(Python,ADTK工具包)

基于机器学习(孤立森林等)的能耗时间序列数据异常检测(第一部分,Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:基于机器学习(孤立森林等)的能耗时间序列数据异常检测(第一部分,Python)

基于机器学习的工业传感器时间序列异常检测(Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:基于机器学习的工业传感器时间序列异常检测(Python)

基于PCA和Kmeans的时间序列异常检测(Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:基于PCA和Kmeans的时间序列异常检测(Python)

基于机器学习的多元时间序列异常检测-以心电信号为例(Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:基于机器学习的多元时间序列异常检测-以心电信号为例(Python)

基于机器学习的风力涡轮机输出功率异常检测(Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:基于机器学习的风力涡轮机输出功率异常检测(Python)

股票时间序列异常检测(Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:股票时间序列异常检测(Python)

简单的基于深度学习的NASA轴承时间序列数据异常检测(Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:简单的基于深度学习的NASA轴承时间序列数据异常检测(Python)

简单的基于孤立森林的时间序列数据异常检测(Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:简单的基于孤立森林的时间序列数据异常检测(Python)

心电信号时间序列异常检测(Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:心电信号时间序列异常检测(Python)

基于机器学习的BTC时间序列数据异常检测(Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:基于机器学习的BTC时间序列数据异常检测(Python)

基于DBSCAN的多元时间序列异常检测(Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:基于DBSCAN的多元时间序列异常检测(Python)

基于传感器时间序列数据的机器故障预测(第一部分,Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:基于传感器时间序列数据的机器故障预测(第一部分,Python)

基于机器学习的传感器时间序列数据异常检测(Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:基于机器学习的传感器时间序列数据异常检测(Python)

基于LSTM自编码器的S&P 500收盘价时间序列异常检测(Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:基于LSTM自编码器的S&P 500收盘价时间序列异常检测(Python)

水处理设备异常检测方法(Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:水处理设备异常检测方法(Python)

利用重构误差对多元时间序列数据进行无监督异常检测(Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:利用重构误差对多元时间序列数据进行无监督异常检测(Python)

基于卷积神经网络的多元时间序列异常检测(Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:基于卷积神经网络的多元时间序列异常检测(Python)

基于时域卷积神经网络的时间序列异常检测(Python) - 哥廷根数学学派的文章 - 知乎

哥廷根数学学派:基于时域卷积神经网络的时间序列异常检测(Python)

学术咨询:

担任《Mechanical System and Signal Processing》《中国电机工程学报》等期刊审稿专家,擅长领域:信号滤波/降噪,机器学习/深度学习,时间序列预分析/预测,设备故障诊断/缺陷检测/异常检测。

基于连续小波变换的信号滤波方法(Python,ipynb文件)

基于连续小波变换的信号滤波方法(Python,ipynb文件)

压缩包包括数据和Jupyter Notebook (.ipynb)代码文件。

Filtering by continuous wavelet transform

import numpy as np
from waveletFunctions import wavelet, wave_signif
import matplotlib.pyplot as plt
​
sst = np.loadtxt('sst_nino3.dat')
n = len(sst)
dt = 0.25
time = np.arange(len(sst)) * dt + 1871.0  # time epochs
xlim = ([1870, 2000])
​
​
%matplotlib inline
plt.figure(figsize=(12, 4))
plt.plot(time, sst)
plt.xlim(xlim[:])
plt.xlabel('time (year)')
plt.ylabel('NINO3 SST (°C)')
plt.title('NINO3 sea surface temperature (seasonal)')
plt.show()

Let us filter this signal such that we keep components with periods between 2-8 years.

Let us use again the function of the inverse wavelet transform which has been written earlier.

def icwt(W, sj, dt, dj=1/8, mother='morlet'):
    """
    Inverse continuous wavelet transform.
​
    Parameters
    ----------
    W : wavelet transform
    sj : vector of scale indices
    dt : sampling interval
    dj : discrete scale interval, default 0.125.
    mother : mother wavelet (default: Morlet)
    
    Result
    --------
    iW : inverse wavelet transform
    """
    mother = mother.upper()
    if mother == 'MORLET':
        Cd = 0.7785  
        psi0 = 0.751126
    elif mother == 'PAUL': # Paul, m=4
        Cd = 1.132
        psi0 = 1.07894
    elif mother == 'DOG':   # Dog, m=2
        Cd = 3.541
        psi0 = 0.86733
    else:
        raise Error('Mother must be one of Morlet, Paul, DOG')
​
    a, b = W.shape
    c = sj.size
    if a == c:
        sj = (np.ones([b, 1]) * sj).transpose()
    elif b == c:
        sj = np.ones([a, 1]) * sj
    else:
        raise Warning('Input array dimensions do not match.')
​
    iW = dj * np.sqrt(dt) / (Cd * psi0) * (
        np.real(W) / np.sqrt(sj)).sum(axis=0)
    return iW
​
pad = 1  # zero padding (recommended)
dj = 0.125  # 8 sub-octaves (in one octave)
s0 = 2 * dt  # 6 month initial scale
j1 = 7 / dj  # 7 octaves
mother = 'MORLET'

Calculate CWT and determine corrected signal power, filter for 2-8 year periods and make reconstruction of the filtered signal with inverse CWT.

wave, period, scale, coi = wavelet(sst, dt, pad, dj, s0, j1, mother)
scale_ext = np.outer(scale,np.ones(n))
power = (np.abs(wave))**2 /scale_ext  # power spectrum (corrected)
​
# filtering for periods between 2-8 years
zmask = np.logical_or(scale_ext<2, scale_ext>=8) # zero here
power[zmask] = 0.0
wavethr = np.copy(wave)
wavethr[zmask] = 0.0
​
# reconstruction by inverse wavelet transform
x = icwt(wavethr, scale, dt, dj, 'morlet')

Plot wavelet map and filtered signal:

import matplotlib
​
plt.figure(figsize=(10, 6))
levels = np.array([2**i for i in range(-15,5)])
with np.errstate(divide='ignore'):
    CS = plt.contourf(time, period, np.log2(power), len(levels))  
    im = plt.contourf(CS, levels=np.log2(levels))
plt.xlabel('time (year)')
plt.ylabel('period (year)')
plt.title('NINO3 SST Morlet wavelet filtered power spectrum')
plt.xlim(xlim[:])
plt.yscale('log', base=2, subs=None)
plt.ylim([np.min(period), np.max(period)])
ax = plt.gca().yaxis
ax.set_major_formatter(matplotlib.ticker.ScalarFormatter())
plt.ticklabel_format(axis='y', style='plain')
plt.gca().invert_yaxis()
plt.show()
​
plt.figure(figsize=(12, 4))
plt.plot(time, x)
plt.xlim(xlim[:])
plt.xlabel('time (year)')
plt.ylabel('SST (°C)')
plt.title('NINO3 SST inverse CWT filtered (2-8 year period)')
plt.show()

Filtering wheel accelerometry with CWT

aint = np.loadtxt('aint.dat')
tint= aint[:,0]
axi = aint[:,1]
ayi = aint[:,2]
n = len(tint)
dt = 0.01
​
xlim = [32,48]
plt.figure(figsize=(12, 8))
plt.plot(tint, axi, label='ax')
plt.plot(tint, ayi, label='ay')
plt.xlim(xlim[:])
plt.xlabel('time (s)')
plt.ylabel('m/s^2')
plt.title('wheel accelerations (Á. Vinkó)')
plt.legend()
plt.show()

pad = 1  
dj = 0.125 
s0 = 2*dt
j1 = 10/dj 
mother = 'MORLET'
​
wave, period, scale, coi = wavelet(axi,dt,pad,dj,s0,j1,mother)
# power spectrum (Compo)
power = (np.abs(wave)) ** 2 
# filtering by thresholding
pvar = np.std(power)**2  # signal variance
lvl = 0.15     # threshold (relative to signal variance)
thr = lvl*pvar
zmask = power <=thr # set zero here
powerthr = np.copy(power)
powerthr[zmask] = 0.0
wavethr = np.copy(wave)
wavethr[zmask] = 0.0
​
# reconstruction by inverse wavelet transform
axr = icwt(wavethr, scale, dt, dj, 'morlet')

Plot wavelet map of the tangential acceleration component:

plt.figure(figsize=(12, 8))
levels = np.array([2**i for i in range(-15,5)])
CS
 = plt.contourf(tint, period, np.log2(power), len(levels))  im = plt.contourf(CS, levels=np.log2(levels))
plt.xlabel('time (s)')
plt.ylabel('period (s)')
plt.title('tangential acceleration, wavelet power spectrum')
plt.xlim(xlim[:])
plt.yscale('log', base=2, subs=None)
plt.ylim([np.min(period), np.max(period)])
ax = plt.gca().yaxis
ax.set_major_formatter(matplotlib.ticker.ScalarFormatter())
plt.ticklabel_format(axis='y', style='plain')
plt.gca().invert_yaxis()
plt.show()

Plot filtered signal and its wavelet map

plt.figure(figsize=(12, 8))
levels = np.array([2**i for i in range(-15,5)])
with np.errstate(divide='ignore'):
    CS
 = plt.contourf(tint, period, np.log2(powerthr), len(levels))      im = plt.contourf(CS, levels=np.log2(levels))
plt.xlabel('time (s)')
plt.ylabel('period (s)')
plt.title('tangential acceleration, filtered power spectrum')
plt.xlim(xlim[:])
plt.yscale('log', base=2, subs=None)
plt.ylim([np.min(period), np.max(period)])
ax = plt.gca().yaxis
ax.set_major_formatter(matplotlib.ticker.ScalarFormatter())
plt.ticklabel_format(axis='y', style='plain')
plt.gca().invert_yaxis()
plt.show()
​
plt.figure(figsize=(12, 8))
plt.plot(tint, axr)
plt.xlim(xlim[:])
plt.xlabel('time (s)')
plt.ylabel('a_x (m/s^2)')
plt.title('tangential acceleration, inverse WT filtered')
plt.show()

Periodic acceleration transients at 33 s and 36 s are probably due to the slipping driven wheel. This is confirmed by zooming at these places:

plt.figure(figsize=(12, 6))
plt.subplot(121)
plt.plot(tint, axr)
plt.xlim([33.2,33.7])
plt.xlabel('time (s)')
plt.ylabel('a_x (m/s^2)')
plt.title('1st transient')
plt.subplot(122)
plt.plot(tint, axr)
plt.xlim([35.8,36.3])
plt.xlabel('time (s)')
plt.ylabel('a_x (m/s^2)')
plt.title('2nd transient')
plt.show()

plt.figure(figsize=(12, 8))
levels = np.array([2**i for i in range(-15,5)])
CS
 = plt.contourf(tint, period, np.log2(power), len(levels))  im = plt.contourf(CS, levels=np.log2(levels))
plt.xlabel('time (s)')
plt.ylabel('period (s)')
plt.title('tangential acceleration, wavelet power spectrum')
plt.xlim(xlim[:])
plt.yscale('log', base=2, subs=None)
plt.ylim([np.min(period), np.max(period)])
ax = plt.gca().yaxis
ax.set_major_formatter(matplotlib.ticker.ScalarFormatter())
plt.ticklabel_format(axis='y', style='plain')
plt.gca().invert_yaxis()
# 95% significance level
plt.contour(tint, period, sig95, [-99, 1], colors='k')
plt.show()

完整代码可通过学术咨询获得:

Logo

魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。

更多推荐