{'fraction_non_alphanumeric': 0.023860303918954946, 'fraction_numerical': 0.00913089842708611, 'mean_word_length': 4.926145339652448, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
AIOT-Arch: Furthering Artificial Intelligence in Big Data IoT Applications

Applications for the Internet of Things (IoT) have evolved in excessive numbers, producing a vast amount of data needed for intelligent processing. The varying IoT infrastructures such as cloud and IoT application layer protocol limitations in the transmission/receiving of messages become the barriers in the implementation of intelligent IoT apps. In this paper, we review the importance of Big data, cloud computing and fog computing in IoT and the challenges of using machine learning in IoT. Finally, we discuss the general statistics of using artificial intelligence in IoT applications.


Introduction:
The word "smart" fascinates us but the tools that we are using today are far from being smart like a human being. Artificial intelligence is designed to make computers do human reasoning that why we need machine learning [1] and data analysis [2] to be combined in one system. Machine learning creates methods to make the network's component automatic and self-sufficient while data analysis analyzes the data to identify the historical trends and be more effective and accurate in the future. IoT [3] is the main object of this trend that will provide a word full of intelligent devices called "smart objects" [4] integrated through the internet, Bluetooth or infrared. In this paper, we research and evaluate the role of machine learning in promoting data analytics for the IoT systems.

Big Data in IoT environments:
Intrinsically, IoT data is a type of big data. The widespread use of sensors for data collection, the utilization of the data collected over long periods of time and the need to evaluate them on a scale to help decision taking means that they overlap with many dimensions of big data [5]. In the following section we will describe the main characteristics of big data found in IoT and how these characteristics are considered as a challenge when using traditional machine learning techniques. Figure 1 shows the IoT data characteristics, the left part of the figure concerning big data characteristics will be discussed in the following section.

Characteristics of big Data which lead to inefficiency of Traditional Machine Learning Techniques:
3.1. Velocity IOP Publishing doi: 10.1088/1757-899X/1051/1/012008 2 velocity is one of the main properties of big data hence IoT data. The velocity dimension refers to how quickly the data is being produced and how fast the application needs to process it. "Fast data" is endemic to IoT, since the generated data is in most cases a continuous and unbounded stream from a multitude of sensors [6]. The velocity of IoT data is affected by many factors. It's affected directly by the sampling rate and the number of sensors in a given environment. Very high sampling rates can also often lead to redundancy if the observations are changing slowly. Nonetheless, a certain amount of redundancy will be optimal with some degree of trust for detecting the events with some level of confidence [5].

Volume
volume of data is not less important than velocity. Big data implies enormous volumes of data. One view is the volume of data generated per sensor and the number of sensors (distributed). But these sensors are constantly observing, and the streaming data is potentially unbounded.

Variety
The variety component of big data is representative of the various potential types of data representations and protocols. IoT data heterogeneity is common, and can be due to different data sources, data types, or networks. IoT applications collect data from a wide range of sensors and in a wide range of formats due to the variety of environment variables being monitored.

Veracity
veracity refers to the biases, noise and abnormality in data. The question here is whether the data that is being stored, and mined is relevant to the problem being analyzed. Figure 2 shows the characteristics of Big Data [31].

Role of Cloud Computing in IoT:
Cloud computing is the on-demand of computer resources like data storage and computing power over the internet. Companies prefer to use a cloud service provider [7] rather than using their own data centers. Cloud computing helps in the storage and the analysis of the large amount of data generated by the IoT applications and connects objects and people together to provide a high visibility [8]. IoT Links existing devices and smart devices to the internet and reduces gaps between Information Technology and Operational technology teams to create a single systems/data view. Nowadays the deployment of comprehensive hardware and the management of networks in IoT systems is not the main problem with the help of cloud computing.

Role of Fog Computing in IoT:
Fog computing is a platform that uses edge devices to conduct a large amount of local and routed storage, computation and communication over the internet [7]. It is a distributed environment that is  Figure 3 shows different IoT components, and how analytics apply to these components [9]. Fog computing aims to form low latency network links between devices and the endpoints of their analyses and reduces the bandwidth required [10]. An additional advantage is the advanced security features that users can implement in a fog network such as network traffic segmentation and virtual extension of firewalls to provide network security.

IoT-Generated Data Processing for Machine Learning Analysis
Because IoT devices send data repetitively, big data challenges are experienced [14,15]. To get past this problem, distributed processing can be leveraged to partition data into chunks and assign each partition to a different computer for processing. Different frameworks can be used to achieve distributed processing like Hadoop and Spark, which can be used in machine learning. When using distributed computing, the following benefits are gained: 1) Network load is lessened.
2) Faster processing of data.
3) Lower energy consumption. 4) Processing of huge volumes of data becomes feasible. [5] 6. Challenges in Developing Intelligent IoT Solutions 6.1. Security Communication technologies used by IoT devices such as Zigbee, Z-Wave and Wi-Fi have their own limitations in terms of security, which hinders the security of IoT applications [11]. The widespread use of IoT devices increases the vulnerability of an IoT system to attacks. Moreover, devices used in IoT systems usually are resource limited, which makes the use of advanced security techniques to protect IoT devices hardly achievable.

Performance
Some machine learning algorithms like Deep Convolutional Neural Networks can achieve high accuracies, but they have high computational and memory requirements, which make it hard to implement and sometimes infeasible on the resource-constrained devices used in IoT systems, for example in safety-critical applications like autonomous driving, which requires real-time image processing [11]. The following table 1 shows frame rates of YOLO algorithm, which is a state-of-theart algorithm used in object detection applications, accomplished using Nvidia Jetson TX1 embedded module [12], which is made to be used in visual computing applications [35]. As shown in the Table 1, the frame rate didn't exceed 17.85, which is too slow for applications that require real-time processing, which requires a frame rate of 30 [11].

Reliability
This is another core issue in machine learning algorithms. Machine learning algorithms like neural networks are not entirely accurate, which makes it unreliable for applications with high sensitivity to accuracy, like self-driving vehicles, and cancer diagnosis. Moreover, deep learning is being introduced in many industrial applications including data mining & analytics, where certain industrial standards need to be met, like IEC 61508 [13], which specifies reliability specifications to be met in industrial applications. Therefore, deep learning-based systems reliability needs to be ensured [13].  Figure 4 shows the difference between machine learning and deep learning.

. Convolutional Layer
The major building blocks used in convolutional neural networks are the conventional layers. A convolution is simply applying a filter to an input resulting in an activation. Repeated application of the same filter to an input results in an activation map called a feature map, which indicates the location and strength of a detected feature in an input such as an image [16].The innovation of convolutional neural networks is the ability to automatically learn, under the constraints of a specific predictive modelling problem, such as image classification, a large number of filters in parallel specific to a training dataset. The result is highly specific features, which can be detected on input images anywhere [17].

Pooling or Subsampling layer
Convolution layer in CNN is often immediately followed by the pooling or subsampling layer. Its role is to down sample the output of a convolution layer along both the height and width dimensions of the

Fully Connected Layer
Fully Connected Layer can be defined as a feed forward neural network. Fully Connected Layers are considered from the last few layers in the network [18]. The output from the final pooling or Convolutional layer is the input to the fully connected layer, which is flattened first then fed into this last layer [19].

Comparisons between different machine learning Techniques for IoT Application:
Use Case for IoT Machine learning algorithm (Data processing tasks)

Advantages Disadvantages
Traffic

Smart City
Smart cities use IoT devices such as sensors to collect data and cloud computing systems to store and analyze data [26]. The IoT devices are connected to each other using Wi-Fi connection or Bluetooth or infrared to create a huge single network that improves the citizen's lifestyle and public services such as energy consumption and water management. Smart city uses the data collected from IoT devices to monitor and manage the city's assets. Smart City is the main use case of IoT applications because of the following three reasons: Firstly, 60% of the publications examined is on the Smart City sector, secondly, smart City includes many other IoT use cases and finally, huge number of open datasets for Smart City applications exists that are easily accessible to researchers.

Case-Study of IoT in smart cities 9.2.1. Smart Road
Municipalities use IoT systems to provide smart road that helps people to navigate through places rapidly and safely. Different Sensors and Data collected from smart phone's GPS help smart road applications to determine the vehicles number, position and speed. Smart road manages the traffic light that is connected to a cloud platform depending on the actual traffic situation [27]. By the time, the smart road system can predict the time and the location of the traffic and prevent that automatically.

Smart parking
Smart parking applications create a real time map of parking spots using sensors implemented in the parking spots and data collected from driver's GPS [28]. This data is sent to the server which is a cloud system that collects and analyze the data. After analysis, the server sends notifications of the available parking spots to the driver's smart phone application. The drivers are capable of paying by cash or visa (using the smart phone's application) as shown in Figure 6.

Smart Street lighting
Smart Street lighting system consists of sensors in the lighting poles. The poles are connected together using Wi-Fi connection. The data collected from these sensors is sent to the cloud system (control and management system) that analyzes the data and control the street lighting schedule [29] as shown in Figure 7. The sensors collect data concerning the movement of citizens in the road, the movement of cars and the degree of illuminance. The lighting poles gets brighter when a walker crosses the road or a bus arrives to the bus stop.

. Transportation Mode Detection
The dataset of the transportation mode is collected using smartphones. Three main sensors are used to collect data which are the accelerometer, gyroscope and sound. The idea is to detect/recognize what type of vehicle the user uses, as there are five classes which are car, bus, train, walking and still. The process is considered as (HAR) Human Activity Recognition (HAR) [30]. The Specifications of this dataset are shown in Table 3. Table 3. Specifications of the Transportation Mode detection dataset

Rain Prediction
The dataset is collected from Australia through the observation of weather stations. The dataset includes many attributes such as: rainfall, evaporation, sunshine, temperature, direction, wind speed, pressure, clouds and humidity. The dataset is used to predict whether there will be rain the next day or not [31]. The Specifications of this dataset are shown in Table 4. F1-score 2 * * +

Number of Samples Number of Features Number of Target Classes
The harmonic mean of precision and recall. Accuracy The ratio of accurately classified data items to the total number of observations.

Confusion Matrix
Allows to measure Recall, Precision, Accuracy, and AUC-ROC curve. Its main usage is when a classification problem has two or more outputs.

ROC-AUC score
Used for discriminating the positive and negative classes in binary classification and demonstrates how good a model is.

Performance comparison of the algorithms on Transportation Mode Detection dataset:
The accuracy rate is the most reliable measure in this case because for each target class in the dataset there are equal numbers of labels which means that the dataset is balanced [32] as shown in Table 6.

Performance comparison of the algorithms on Rain Prediction dataset:
The Rain Prediction dataset has 24 features, three of the features are categorical features each one of them has 16 different values, for that kind of information the dataset required much more pre-processing tasks. One-hot encoding techniques are applied to the dataset to convert the categorical features to numeric ones, which lead to tripling the number of features [33] as shown in Table 7.  Table 7. Performance Metrics of different algorithms on Rain Detection dataset

Conclusion:
Nowadays, the IoT applications are integrated in everything. This paper shows the importance of the usage of artificial intelligence in Big data IoT applications using our proposed framework and shows the power of machine learning in providing benefits to the consumers. The proposed framework is examined on two datasets (Transportation Mode Detection dataset and Rain Prediction). When using different machine learning techniques with the first dataset, it gives best accuracy of 85/87% with RF algorithm but when using these same techniques with the second dataset, it gives best accuracy of 85/86% with the ANN algorithm. Our innovative architecture is opening up new opportunities for potential machine-to-machine communications work.