Detecting anomalies in IoT time-series data by using deep learning Romeo Kienzler
Published on May 16, 2017
FacebookTwitterLinked InGoogle+E-mail this page 0 Content series: This content is part 1 of 5 in the series: Developing cognitive IoT solutions for anomaly detection by using deep learning
Although predictions are always controversial, Gartner says that there are 8.4 billion connected IoT devices in 2017 (not counting smartphones) and some analysts say that by 2020 there will be 50 billion. Even if over-estimated, soon the number of IoT devices will exceed the number of humans on the planet. And guess what, all these devices are continuously generating data; data that is useless unless you can analyze it.
A cognitive system provides a set of technological capabilities such as artificial intelligence (AI), natural language processing, machine learning, and advanced machine learning to help with analyzing all that data. Cognitive systems can learn and interact naturally with humans to gather insights from data and help you to make better decisions. In my last article I stated cognitive computing is not just human-computer interaction (HCI), it is advanced machine learning driven by powerful algorithms (models) and nearly unlimited data processing capabilities.
To understand a cognitive system that uses IoT sensors and deep learning analysis, you first need to understand the leap from advanced machine learning to neural networks. In this article, I try to help you make that leap. In the coming weeks, I will present three different tutorials about anomaly detection on time-series data on Apache Spark using the Deeplearning4j, ApacheSystemML, and TensorFlow (TensorSpark) deep learning frameworks to help you fully understand how to develop cognitive IoT solutions for anomaly detection by using deep learning. From machine learning to neural networks and deep learning
If a cognitive system is based on models, you need to look first at what a machine-learning model is. It is a statistical model (black box) that in contrast to a physical model (white box) has been trained with data to learn a hidden pattern.
Look at Table 1. It contains historic data on different parameters, measured observations on a manufacturing pipeline, and a binary outcome. Table 1. Machine-learning model
| Part No. |
Max Temp. 1 |
Min Temp. 1 |
Max Vibration 1 |
Outcome |
| 100 |
35 |
35 |
12 |
Healthy |
| 101 |
36 |
35 |
21 |
Healthy |
| 130 |
56 |
46 |
3412 |
Faulty |
In this highly artificial example, the numbers speak for themselves. As you might guess, a high temperature and high vibration led to a faulty part. The root cause for this situation might be the result of a broken bearing in a machine.
In this example, a (supervised) machine-learning algorithm is capable of considering all this data (and much more) to learn and predict faults from pure data. The component that such an algorithm produces is called a machine-learning model.
A special type of machine-learning algorithm is a neural network. It is highly adaptable to data, and it is able to learn any hidden mathematical function between the data and the outcome. The only catch with neural networks is the tremendous amount of computational resources and data that they need to perform well. So why am I talking about neural networks at all? We live in an IoT world with tremendous amounts of data available and also (nearly) unlimited computational power available by using the cloud. This situation makes neural networks especially interesting for IoT data processing.
Neural networks are inspired by the human brain, and so are deep learning networks. The main difference between a neural network and a deep learning one is the addition of multiple neural layers. The most obvious example of how deep learning is outperforming traditional machine learning is with image recognition. Every state-of-the-art system uses a special type of deep learning neural network (called a convolution neural network) to perform their tasks.
For example, deep-learning-based image recognition algorithms are capable of distinguishing healthy parts from faulty parts in a manufacturing pipeline. I'd call this machine intelligence and it is available as in the IBM Watson Visual Recognition Service. For this particular example, the machine might accomplish the same task with the same accuracy as a human. The only machine advantage is that it never sleeps, never calls in sick, and never gets hurt. And, if you need to double the throughput, just double the amount of hardware or cloud resources. But applying a root-cause analysis on why parts are sometimes faulty is still the domain of human experts. However, this scenario is where cognitive solutions applying deep learning.
In fact, a visual recognition service returns much more information than just a binary outcome of "healthy" or "faulty." Just like a human, the service detects structures and regions in the images that deviate from the norm. Now, if you were to correlate all sound and vibration sensor data with all visual recognition data, I'm sure such a system could detect the root causes of faults as well as, or even better than, humans. How artificial neural networks work
If the IoT sensors that connected to a message broker (like the MQTT-based IBM Watson IoT Platform) are the central nervous system of cognitive solutions, then deep learning is the brain. And, to understand deep learning, you need some basic understanding of regression, perceptrons, biological and artificial neural networks, and hidden layers. Start with linear and logistic regression
A ton of scientific literature exists on regression, so I'll try to give you a short-path explanation that is tailored for developers. Consider Table 2. It is the same as Table 1 except here I've turned the outcome into a binary representation. Table 2. Artificial neural network data
| Part No. |
Max Temp. 1 |
Min Temp. 1 |
Max Vibration 1 |
Outcome |
| 100 |
35 |
35 |
12 |
1 |
| 101 |
46 |
35 |
21 |
1 |
| 130 |
56 |
46 |
3412 |
0 |
It's pretty easy to write a piece of software to make the classification.