Hands-On Deep Learning for IoT

5 (2 reviews total)
By Dr. Mohammad Abdur Razzaque , Md. Rezaul Karim
    Advance your knowledge in tech with a Packt subscription

  • Instant online access to over 7,500+ books and videos
  • Constantly updated with 100+ new titles each month
  • Breadth and depth in over 1,000+ technologies
  1. The End-to-End Life Cycle of the IoT

About this book

Artificial Intelligence is growing quickly, which is driven by advancements in neural networks(NN) and deep learning (DL). With an increase in investments in smart cities, smart healthcare, and industrial Internet of Things (IoT), commercialization of IoT will soon be at peak in which massive amounts of data generated by IoT devices need to be processed at scale.

Hands-On Deep Learning for IoT will provide deeper insights into IoT data, which will start by introducing how DL fits into the context of making IoT applications smarter. It then covers how to build deep architectures using TensorFlow, Keras, and Chainer for IoT.

You’ll learn how to train convolutional neural networks(CNN) to develop applications for image-based road faults detection and smart garbage separation, followed by implementing voice-initiated smart light control and home access mechanisms powered by recurrent neural networks(RNN).

You’ll master IoT applications for indoor localization, predictive maintenance, and locating equipment in a large hospital using autoencoders, DeepFi, and LSTM networks. Furthermore, you’ll learn IoT application development for healthcare with IoT security enhanced.

By the end of this book, you will have sufficient knowledge need to use deep learning efficiently to power your IoT-based applications for smarter decision making.

Publication date:
June 2019


The End-to-End Life Cycle of the IoT

By enabling easy access it, and interaction with, a wide variety of physical devices and their environments, the Internet of Things (IoTwill foster the development of various applications in various domains, such as health and medical care, intelligent energy management and smart grids, transportation, traffic management, and more. These applications will generate big and real-time/streaming data, which will require big data analysis tools, including advanced machine learning, that is, deep learning (DL), to extract useful information and make informed decisions. We need to understand the end-to-end (E2E) life cycle of the IoT and its different components in order to apply advanced machine learning techniques on the generated data of IoT applications.

In this chapter, we will discuss the E2E life cycle of the IoT and its related concepts and components. We will explore its key characteristics and the IoT data issues that demand the use of DL in IoT. We will cover the following topics:

  • The E2E life cycle of the IoT:
    • IoT application domains:
      • The importance of analytics in IoT
      • The motivation to use DL in IoT data analytics
  • The key characteristics and requirements of IoT data

The E2E life cycle of the IoT

Different organizations and industries describe IoT differently. One way of defining it simply and tangibly is as a network of smart objects, which connects the physical and digital world together. Examining the E2E life cycle of the IoT solution or, more generally, of the IoT ecosystem, will help us to understand it further and show us how it is applicable to machine learning and DL. 

Similar to the definition of IoT, there is no single consensus on the E2E life cycle or the IoT architecture that is agreed universally. Different architectures or layers have been proposed by different researchers. The most commonly proposed options are the three and five-layer life cycles or architectures, as shown in the following diagram:

In the preceding diagram, (a) presents a three-layer IoT life cycle or architecture, and (b) presents a five-layer IoT life cycle or architecture.

The three-layer E2E IoT life cycle

This is the most basic and widely used IoT life cycle for IoT solutions. It consists of three layers: the perception, network, and application layers. These can be described as follows:

  • The perception layer: This is the physical layer or sensing layer, which includes things or devices that have sensors to gather information about their environments. As shown in the following diagram, the perception layer of an E2E life cycle of the IoT solution in healthcare consists of patients, hospital beds, and wheelchairs that are deployed with sensors.
  • The network layer: A network is responsible for connecting to other smart things, network devices, and servers. It is also responsible for transmitting and processing sensor data.
  • The application layer: This layer is responsible for delivering application-specific services to users, based on the data from the sensor. It defines various applications in which IoT can be deployed, for example, smart homes, smart cities, and connected health.

The following diagram presents a three-layer E2E life IOT cycle in healthcare:

The three-layer E2E IoT life cycle or architecture defines the key ideas of IoT, but it may not be enough for research and development, as these often deal with the finer aspects of IoT. This is why other life cycles or architectures, such as the five-layer life cycle, have been proposed.

The five-layer IoT E2E life cycle

 A five-layer IoT life cycle consists of the perception, transport, processing, application, and business layers. The role of the perception and application layers is the same as in the three-layer architecture. We outline the function of the remaining three layers as follows:

  • The transport layer: This is similar to the network layer of the three-layer life cycle. It transfers the data gathered in the perception layer to the processing layer and vice versa through networks such as wireless, 3G, LAN, Bluetooth, RFID, and NFC.
  • The processing layer: This is also known as the middleware layer. It stores, analyzes, and processes huge amounts of data that comes from the transport layer. It can manage and provide a diverse set of services to the lower layers. It employs many technologies, such as databases, cloud computing, and big data processing modules.
  • The business layer: This layer manages the whole IoT system, including applications, business and profit models, and user privacy.

IoT system architectures

Understanding the architecture of the IoT system is important for developing an application. It is also important to consider our data processing requirements in different computing platform levels, including the fog level and the cloud level. Considering the criticality and latency-sensitiveness of many IoT applications (such as an IoT solution for the healthcare domain, as shown in the previous diagram), fog computing is essential for these applications. The following diagram, very briefly, presents how fog computing works:

As we can see in the preceding diagram, in fog computing, a thing's (such as a car's) data does not move to the cloud for processing. In this way, fog computing addresses many challenges (such as high latency, downtime, security, privacy, and trust) faced by the cloud in IoT and offers many benefits, such as location awareness, low latency, support for mobility, real-time interactions, scalability, and business agility. The following diagram presents the protocol layer-wise architecture of fog computing:

As shown in the preceding diagram, the architecture of fog computing or fog computing with IoT consists of six layers: physical and virtualization, monitoring, preprocessing, temporary storage, security, and transport. Notably, the preprocessing layer performs data management tasks by essentially analyzing, filtering, and trimming collected data from physical or virtual sensors.


IoT application domains

By enabling easy access to, and interaction with, a wide variety of physical devices or things such as vehicles, machines, medical sensors, and more, IoT facilitates the development of applications in many different domains. The following diagram highlights the key application domains of IoT:

These include healthcare, industrial automation (that is, Industry 4.0), energy management and smart grids, transportation, smart infrastructure (such as the smart home and the smart city), retail, and many other areas that will transform our lives and societies for the better. These applications will have a global economic impact of $4 to $11 trillion per year by 2025. The key contributors (in order of their predicted contribution) of this quantity of money include the following:

  • Factories or industries, including operation management and predictive maintenance
  • Cities, including public safety, health, traffic control, and resource management
  • Healthcare, including monitoring and managing illnesses and improving wellness
  • Retail, including self-checkouts and inventory management
  • Energy, including the smart grid

The tremendous demand for these applications implies the incredible and steep growth of IoT services and the big data that they generate. 


The importance of analytics in IoT

The use of IoT in various application domains will only be effective if those applications can extract some business value from the data generated and collected by IoT devices. In this context, analysis of IoT data is essential in IoT solutions. Gartner identified IoT analytics as one of the two top technologies used in IoT.

IoT analytics is the application of data analysis tools and procedures to unlocking insights from the huge volumes of data generated by IoT devices in different ways. IoT analytics is essential for extracting insights from the data generated by IoT devices or things. More specifically, IoT business models analyze the information generated and collected by things in many ways – for example, to understand customer behavior, to deliver services, to improve products and services, and to identify and intercept business moments. The main element of most of these IoT business models or applications when it comes to understanding their data is an intelligent learning or machine learning mechanism for prediction, data mining, and pattern recognition. Traditional machine learning mechanisms or technologies work well with structured data, but they struggle with unstructured data. 

An example of this is Google's Nest learning thermostat, which records temperature data in a structured way and then applies machine learning algorithms to understand the patterns of its user's temperature preferences and schedules. However, it does not understand unstructured data, such as multimedia data, which is audio signals and visual images. Additionally, the training of traditional machine learning algorithms relies on handcrafted and engineered feature sets that may not be easy in many IoT applications because of heterogeneity and the dynamics involved in the applications. In factories, for example, faults could be random and feature sets might be unavailable to classify them. For this reason, IoT demands new analytics approaches, including DL.


The motivation to use DL in IoT data analytics

In recent years, many IoT applications have been actively exploiting sophisticated DL technologies, which use neural networks to capture and understand their environments. Amazon Echo, for example, is considered to be an IoT application as it connects the physical and human world with the digital world; it can understand human voice commands using DL.

Additionally, Microsoft's Windows face-recognition security system (an IoT application) uses DL technology to perform tasks such as unlocking a door when it recognizes its user's face. DL and IoT are among the top three strategic technology trends for 2017, and were announced at the Gartner Symposium/ITxpo 2016. The intensive publicity around DL is due to the fact that traditional machine learning algorithms do not address the emerging analytic needs of IoT systems. On the contrary, DL algorithms or models, in general, bring two important improvements over traditional machine learning approaches. First, they reduce the need for handcrafted and engineered feature sets to be used for the training of a model. As a result, some features in IoT applications, which might not be apparent to humans, can be extracted easily by DL models. Moreover, DL models improve prediction accuracy.

However, enabling DL in IoT applications, especially in edge computing devices, fog computing devices, and end devices, is difficult because of their resource-constrained properties. Moreover, IoT data is different from general big data. We need to explore the properties of IoT data and how they are different from those of general big data in order to better understand the requirements for IoT data analytics.


The key characteristics and requirements of IoT data

The data from IoT applications exhibits two characteristics that require different treatment from the analytics approach. Many IoT applications, such as remote patient monitoring or autonomous vehicles, generate streams of data continuously, and this leads to a huge volume of continuous data. Many other applications, such as consumer product analysis for marketing or inhabitant monitoring in forests or underwater, produce data that accumulates as a source of big data. Streaming data is generated or captured within short intervals of time and need to be quickly analyzed to extract immediate and useful insights and make fast decisions. 

On the contrary, the term big data refers to huge datasets that commonly used hardware and software platforms are not able to store, manage, process, and analyze. These two types of data need to be treated differently as their requirements for analytics response are different.

The results from big data analytics, such as business intelligence and transactional analysis, can be delivered after several days of data generation, but streaming data analytics results should be ready in anything from a few hundreds of milliseconds to a few seconds. For example, in driverless cars, the response time in the case of an emergency brake needs to be around 100 milliseconds. The following diagram highlights the key characteristics of IoT data and its analytics requirements:

Many IoT applications, such as an application to monitor real-time average temperatures, rely on multiple sources of data. Data fusion, aggregation, and sharing play a critical role in these applications. This is even more critical for time-sensitive IoT applications, such as remote patient monitoring, or driverless cars, where the timely aggregation of data is needed to bring all pieces of data together for analysis and, subsequently, to provide reliable and accurate actionable insights.

In general, the analysis of streaming data is challenging, even in high-performance computing systems or cloud platforms. A potential solution for streaming data analytics is frameworks based on data parallelism and incremental processing. Although these techniques may reduce time latency and return a response from the streaming data analytics framework, they are not the optimal solution for real-time IoT applications. In this context, it is better to bring streaming data analytics closer to the source of data, through IoT devices or edge devices, with the support of fog or edge computing. However, adding data analytics to IoT devices or things introduces new challenges such as the limitation of computing, storage, and power resources at the source of the data.

IoT is responsible for generating big data by connecting billions of smart devices together and collecting data about the status of the devices and their environments frequently. Identifying and mining meaningful patterns from the huge amount of data that comes from raw sensors is the core utility of big data analytics in IoT applications, as it results in further insights for decision-making and trend prediction. By extracting these insights, IoT big data is of extreme importance to many businesses, as it enables them to gain an advantage over their competitors. The following diagram highlights the characteristics of IoT big data using the six Vs (6Vs):

Real-life examples of fast and streaming IoT data

Remote patient monitoring is one of the most obvious and popular applications of IoT in healthcare. Through this application, which is sometimes known as telehealth, a patient will be connected to their care providers and get real-time feedback if necessary. The data generated by this application, such as variability in heart rate or blood pressure, is streaming data and needs to be processed quickly so that care providers can respond promptly to the patient's situation.

The following diagram presents a snapshot of a commercially available remote patient monitoring system:

Real-life examples of IoT big data

The smart grid is an important source of IoT big data. Smart meters play an important role in the smart grid system by generating and gathering a precise measurement of the energy consumption of their users. At present, energy providers in many countries are interested in learning local energy consumption patterns, predicting the needs of their customers, and making appropriate decisions based on real-time analytics.

Another example of IoT big data is the data generated by smart devices. The following diagram presents the process of consumer product analysis for marketing using IoT data:

As shown in the preceding diagram, an IoT enabled remote patient monitoring system can produce a massive amount of data to be processed, stored, and analyzed. Nevertheless, smart devices such as smart coffee machines, smart fridges, and smart vending machines also can generate big data, which can be used for consumer product analysis.



In this chapter, we presented two different layered views of the E2E life cycle of the IoT. We also looked at the IoT system architecture and key application domains of IoT. Following this, we defined what is meant by IoT analytics and its importance in IoT applications, with special emphasis on DL. We discussed the key characteristics of IoT and their corresponding requirements in analytics. Finally, we presented a few real IoT examples, which generate fast and streaming data as well as big data. In the next chapter, you will be introduced to several common DL models and the most cutting-edge architectures that have been introduced in recent years, and learn how they can be useful in analyzing IoT streaming and big data. 

It is essential to know the basics of different DL models and their different implementation frameworks in order to use them in different IoT applications. In the next chapter, we will present a list of popular DL models, including convolutional neural networks, long short-term memory, and autoencoders. In addition to this, we discuss a list of popular DL development frameworks, including TensorFlow and Keras.



About the Authors

  • Dr. Mohammad Abdur Razzaque

    Dr. Mohammad Abdur Razzaque is a senior lecturer in the School of Computing and Digital Technologies, Teesside University, UK. He has more than 14 years of research and development and teaching experience on distributed systems (Internet of Things, P2P networking, and cloud computing) as well as experience in cybersecurity. He is an expert in end-to-end (sensors-to-cloud) IoT solutions. He offers consultancy in the areas of IoT solutions and the use of machine learning techniques in businesses. He has successfully published more than 65 research papers in these areas. He holds a PhD in distributed systems (P2P wireless sensor networks, mobile ad hoc networks) from the School of Computer Science and Informatics, UCD, Dublin (2008).

    Browse publications by this author
  • Md. Rezaul Karim

    Md. Rezaul Karim is a researcher, author, and data science enthusiast with a strong computer science background, coupled with 10 years of research and development experience in machine learning, deep learning, and data mining algorithms to solve emerging bioinformatics research problems by making them explainable. He is passionate about applied machine learning, knowledge graphs, and explainable artificial intelligence (XAI). Currently, he is working as a research scientist at Fraunhofer FIT, Germany. He is also a PhD candidate at RWTH Aachen University, Germany. Before joining FIT, he worked as a researcher at the Insight Centre for Data Analytics, Ireland. Previously, he worked as a lead software engineer at Samsung Electronics, Korea.

    Browse publications by this author

Latest Reviews

(2 reviews total)
Great books at affordable prices. Topics in Packt books are often current and of practical value.
I just started and this book is helful

Recommended For You

Book Title
Unlock this book and the full library for only $5/m
Access now