深度学习的时间序列分类

为什么要进行时间序列分类? (Why Time Series Classification?)

First of all it’s important to underline why this problem is so important today, and therefore why it is very interesting to understand the role and the otential of Deep Learning in this sector.

首先,重要的是要强调为什么这个问题在今天如此重要,因此为什么理解深度学习在该领域的作用和潜力为什么非常有趣。

During the last years, Time Series Classification has become one of the most challenging problems in data mining. This has happened because any classification problem that uses data taking into account some notion of ordering, can be treated as a Time Series Classification problem.

在过去的几年中,时间序列分类已成为数据挖掘中最具挑战性的问题之一。 之所以会发生这种情况,是因为考虑到排序的任何使用数据的分类问题都可以视为时间序列分类问题。

Time series are present in many real-world applications ranging from health care, human activity recognition, cyber-security, finance, marketing, automated disease detection, anomaly detection, etc. With the increase of temporal data availability, many areas are strongly increasing their interest in applications based on time series, and then many algorithms have been proposed.

时间序列存在于许多实际应用中,包括医疗保健,人类活动识别,网络安全,金融,市场营销,自动疾病检测,异常检测等。随着时间数据可用性的增加,许多领域都在大力发展它们对基于时间序列的应用程序很感兴趣,因此提出了许多算法。

All these algorithms, apart from those based on deep learning, require some kind of feature engineering as a separate task before the classification is performed, and this can imply the loss of some information and the increase of the development time. On the contrary, deep learning models such as recurrent and convolutional neural networks already incorporate this kind of feature engineering internally, optimizing it and eliminating the need to do it manually. Therefore they are able to extract informations from the time series in a faster, more direct, and more complete way.

除了基于深度学习的算法以外,所有这些算法在进行分类之前都需要某种特征工程作为单独的任务,这可能意味着某些信息的丢失和开发时间的增加。 相反,深度学习模型(例如递归和卷积神经网络)已经在内部合并了这种特征工程,从而对其进行了优化并消除了手动进行此过程的需要。 因此,他们能够以更快,更直接,更完整的方式从时间序列中提取信息。

应用领域 (Applications)

Let’s see some important applications of Reinforcement Learning.

让我们看看强化学习的一些重要应用。

Electrocardiogram records can be used to find out various heart problems, and are saved in time series form. Distinguishing the electrocardiogram of a normal heart from the one of a heart with a disease, and recognizing the disease, is a Time Series Classification problem.

心电图记录可用于发现各种心脏问题,并以时间序列形式保存。 将正常心脏的心电图与患有疾病的心脏的心电图区分开并识别疾病是时间序列分类问题。

Today many devices can be controlled with the use of simple gestures, without physically touching them. For this purpose these devices record a series of images that are used to interpret the user’s gestures. Identifying the correct gesture from this sequence of images is a Time SeriesClassification problem. Anomaly detection is the identification of unusual events or observations which are significantly different from the majority of the data.

如今,许多设备都可以使用简单的手势进行控制,而无需实际触摸它们。 为此,这些设备记录了一系列图像,这些图像用于解释用户的手势。 从图像序列中识别正确的手势是一个时间序列分类问题。 异常检测是对与大多数数据有显着差异的异常事件或观察结果的识别。

Often the data in anomaly detection are time series, for example the temporal trend of a magnitude related to an electronic device, monitored to check that the device is working correctly. Distinguishing the time series of normal operations from that of a device with some anomaly, and recognizing the anomaly, is a Time Series Classification problem.

异常检测中的数据通常是时间序列,例如与电子设备相关的幅度的时间趋势,需要对其进行监视以检查设备是否正常工作。 将正常操作的时间序列与具有某些异常的设备的时间序列区分开,并识别异常是时间序列分类问题。

问题定义 (Problem definition)

Now we give a formal definition of a Time Series Classification problem. Suppose to have a set of objects with the same structure (for example real values, vectors or matrices with same size, etc.), and a fixed set of different classes. We define a dataset as a collection of pairs (object, class), which means that to each object is associated a determinate class. Given a dataset, a Classification problem is building a model that associates to a new object, with the same structure of the others, the probability to belong to the possible classes, accordingly to the features of the objects associated to each class.

现在我们给出时间序列分类问题的正式定义。 假设有一组具有相同结构的对象(例如,具有相同大小的实数值,向量或矩阵等),以及一组固定的不同类。 我们将数据集定义为对(对象,类)对的集合,这意味着每个对象都关联有一个确定的类。 给定一个数据集,分类问题正在建立一个模型,该模型与一个新对象相关联,并且具有与其他对象相同的结构,从而根据与每个类相关联的对象的特征,属于可能类的可能性。

An univariate time series is an ordered set of real values, while a M dimensional multivariate time series consists of M different univariate time series with the same length. A Time Series Classification problem is a Classification problem where the objects of the dataset are univariate or multivariate time series.

单变量时间序列是有序的实数值集,而M维多元时间序列由M个长度相同的不同单变量时间序列组成。 时间序列分类问题是一个分类问题,其中数据集的对象是单变量或多变量时间序列。

感知器(神经元) (Perceptron (Neuron))

Before introducing the different types of Deep Learning Architectures, we recall some basic structures that they use. First of all we introduce the Perceptron, that is the basic element of many machine learning algorithms. It is inspired by the functionality of biological neural circuits, and for this reason is also called neuron.

在介绍不同类型的深度学习架构之前,我们回顾一下它们使用的一些基本结构。 首先,我们介绍Perceptron,这是许多机器学习算法的基本要素。 它受到生物神经回路功能的启发,因此也称为神经元。

This Figure shows the architecture of a Perceptron. A Perceptron has one or more input values, and every input value is associated to a weight.

该图显示了感知器的体系结构。 感知器具有一个或多个输入值,并且每个输入值都与一个权重相关联。

Image for post

The goal of a Perceptron is to compute the wighted sum of the input values and then apply an activation function to the result. The most common activation functions are sigmoid, hyperbolic tangent and rectifier:

感知器的目标是计算输入值的加权总和,然后将激活函数应用于结果。 最常见的激活函数是S型,双曲正切和整流器:

Image for post

The result of the activation function is referred as the activation of the Perceptron and represents its output value.

激活功能的结果称为感知器的激活,并表示其输出值。

多层感知器 (Multi Layer Perceptron)

Now we introduce the Multi Layer Perceptron (MLP), that is a building block used in many Deep Learning Architectures for Time Series Classification. It is a class of feedforward neural networks and consists of several layers of nodes: one input layer, one or more hidden layers, and one output layer. Every node is connected to all the nodes of its layer, of the previous layer and of the next layer. For this reason we say that Multi Layer Perceptron is fully connected. Each node of the hidden layers and of the output layer is a Perceptron.

现在,我们介​​绍多层感知器(MLP),它是许多用于时间序列分类的深度学习架构中使用的构建块。 它是一类前馈神经网络,由几层节点组成:一个输入层,一个或多个隐藏层以及一个输出层。 每个节点都连接到其层,上一层和下一层的所有节点。 因此,我们说多层感知器已完全连接。 隐藏层和输出层的每个节点都是一个感知器。

Image for post

The output of the Multi Layer Perceptron is obtained computing in sequence the activation of its Perceptrons, and the function that connect the input and the output depends on the values of the weights.

多层感知器的输出是通过依次计算其感知器的激活而获得的,连接输入和输出的功能取决于权重的值。

多层感知器分类 (Classification with Multi Layer Perceptron)

Multi Layer Perceptron is commonly used for Classification problems: given a dataset (that we recall to be a collection of pairs (object, class)), it can be fitted to compute the probability of any new object to belong to each possible class. To do this, first of all we need to represent the pairs (object, class) in the dataset in a more suitable way:

多层感知器通常用于分类问题:给定一个数据集(我们记得它是对(对象,类)的集合),它可以适合计算任何新对象属于每个可能类的概率。 为此,首先我们需要以更合适的方式在数据集中表示对(对象,类):

  • Every object must be flattened and then represented with a vector, that will be the input vector for training.

    必须将每个对象弄平,然后用向量表示,该向量将作为训练的输入向量。
  • Every class in the dataset must be represented with its one-hot label vector. A one-hot label vector is a vector with size equal to the number of different classes in the dataset. Each element of the array corresponds to a possible class, and every value is 0 apart from that related to the represented class, that is 1. The one-hot label vector will be the target for training. We can see a simple exampe of one hot label vector in this Figure: in the original dataset the column Class has three different values, and the dataset with the one hot label vector has three columns, one for each class.

    数据集中的每个类都必须用其一号标签向量表示。 一键式标签向量是大小等于数据集中不同类的数量的向量。 数组的每个元素对应于一个可能的类,并且每个值除与表示的类相关的值外均为0 ,即1 。 一站式标签向量将成为训练的目标。 我们可以在此图中看到一个热标签向量的简单示例:在原始数据集中,列Class具有三个不同的值,而具有一个热标签向量的数据集具有三列,每个列对应一个。

Image for post

In this way we obtain a new dataset of pairs (input vector, target), and we are ready for training. For this process, MLP uses a supervised learning technique called Backpropagation, that works iterating on the input vectors

  • 3
    点赞
  • 60
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
基于Matlab的深度学习时间序列分类是一种利用深度学习技术对时间序列数据进行分类的方法。Matlab作为一种强大的数学和工程计算软件,在深度学习应用领域也具有一定的优势。 深度学习是指一类机器学习技术,其核心是神经网络的建模和训练。在时间序列分类任务中,深度学习可以通过构建适当的神经网络模型来对时间序列数据进行特征提取和分类预测。 在Matlab中,通过神经网络工具箱可以方便地搭建深度学习模型。首先,需要加载时间序列数据集并进行预处理,如划分训练集和测试集、标准化等。然后,可以选择合适的深度学习模型,如卷积神经网络(CNN)或循环神经网络(RNN)等,并设置模型的参数。 接下来,利用训练集对深度学习模型进行训练,通过反向传播算法优化模型的参数。训练完成后,可以使用测试集进行模型的评估和性能指标的计算,如准确率、精确率和召回率等。最后,可以使用已训练好的模型对新的时间序列数据进行分类预测。 Matlab提供了丰富的工具和函数,用于辅助深度学习时间序列分类任务的实施。例如,可以使用图形界面设计模型,或者使用脚本编程实现更复杂的任务。此外,Matlab还提供了可视化工具和函数,用于对模型和预测结果进行可视化展示和分析。 综上所述,基于Matlab的深度学习时间序列分类是一种使用Matlab软件搭建深度学习模型,并对时间序列数据进行分类预测的方法。利用Matlab的强大功能和丰富的工具,可以方便地进行实验和分析,提高时间序列分类任务的准确性和效率。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值