Enabling Smart Buildings by Indoor Visible Light Communications and Machine Learning

The smart building (SB), a promising solution to the fast-paced and continuous urbanization around the world, is an integration of a wide range of systems and services and involves a construction of multiple layers. The SB is capable of sensing, acquiring and processing a tremendous amount of data as well as performing proper action and adaptation accordingly. With rapid increases in the number of connected nodes and thereby the data transmission demand in SBs, conventional transmission and processing techniques are insufficient to provide satisfactory services. To enhance the intelligence of SBs and achieve efficient monitoring and control, both indoor visible light communications (VLC) and machine learning (ML) shall be applied jointly to construct a reliable data transmission network with powerful data processing and reasoning abilities. In this regard, we envision an SB framework enabled by indoor VLC and ML in this article.


INTRODUCTION
Urbanization has been being promoted sharply in recent decades and the United Nations Population Fund (UNFPA) forecast that circa 60 percent of the world population would live in urban areas by 2030 [1].Feasible solutions to settle down such a huge number of people are being sought so as to provide sustainable and high-quality life and efficient resource management in urban areas.Among a number of potential solutions, the smart building (SB) stands out.The SB is a high-profile concept belonging to the category of smart city and has attracted researchers' attention with the advances of artificial intelligence (AI) and the Internet of Things (IoT).It integrates a wide range of systems and services into a unified platform.An SB is able to perceive the environment, acquire and process relevant data as well as respond to the changes of the environment and/or users' needs with a high degree of intelligence and autonomy [2].With the aforementioned abilities, the SB can provide various intelligent indoor services (e.g., tracking, navigating, positioning, and downloading) for residents.Moreover, the SB can also monitor and control global operating status.
To realize such complex functionality, the framework of the SB must be constructed over a multi-layer structure, which consists of the sensing layer, network layer, semantic layer, software layer, processing layer, and reasoning layer as well as the service layer.Note that, here we intend not to include the interactive interface for user interaction in the multi-layer structure, since this is an independent functional module and can to some extent be regarded as a part of the external The authors are with Computer, Electrical and Mathematical Science and Engineering (CEMSE) Division, King Abdullah University of Science and Technology (KAUST), Thuwal 23955-6900, Kingdom of Saudi Arabia (e-mail: {shuping.dang,guoqing.ma,basem.shihada,slim.alouini}@kaust.edu.sa).environment.The multi-layer structure of the SB with the interactive interface is illustrated in Fig. 1.In order to fully exploit the advantages of the SB and provide satisfactory services to residents, reliable connectivity and efficient information processing infrastructures for data transmission and distributed processing are indispensable.As a consequence, high reliability and high intelligence are two crucial technical barriers hindering the promotion of the SB in practice [1].
To overcome these two barriers, in this article, we propose a framework for enabling the SB by indoor visible light communications (VLC) and machine learning (ML).Indoor VLC module is implemented for reliable and massive data transmission to ensure that the raw data collected by distributed sensors can be properly received and used throughout the entire framework.As a by-product, indoor VLC can also satisfy the communication demands as a supplementary of radio frequency communications (RFC) by residents living in the SB.ML is mainly employed to enhance the intelligence of the SB and enable real-time smart control.This framework is validated by simulation results and believed to be a feasible solution to overcome the two main barriers currently handicapping the development of the SB.To the best of the authors' knowledge, hitherto, this is the first complete framework of the SB enabled by indoor VLC and ML.

Related Works
The original work enabling smart functionality for smart cities through a cognitive management framework and the IoT is presented and validated in [1].In this work, when and how objects should be connected in a smart space has been stipulated.In the meantime, a scalable VLC networking and sensing framework are proposed in [3], in which VLC is employed to build reliable and seamless connections among devices in smart space and perform simplistic context-aware arXiv:1904.07959v1[cs.NI] 9 Apr 2019 functionality.A three-layer VLC-based communication architecture is constructed for smart cities in [4] without involving intelligent technology.Integrated VLC system supported by the IoT for sensing and intelligent control is illustrated in [5], which relies on a central controller and light emitting diode (LED) luminaries with Internet Protocol (IP) addresses.Though mentioned, no specific intelligent technology has been specified in this work, which results in the absence of network adaptation and thereby less practicality.In order to cope with the heterogeneous nature, the coexistence of RFC and VLC is considered in [6], which has been verified to provide reliable and vast-volume communication service for heterogeneous networks (HetNets).
Perception-action cycle and the IoT are first introduced as a whole for building context-aware and proactive smart home as a notion only and operational functions are explicitly defined in [7], which is envisioned to support intelligent and robust control, but no simulation/experimental result is provided for verification purposes.Quality of Experience (QoE)-driven big data architecture supported by machine learning is proposed for smart cities in [8] so as to acquire accurate data and deliver precise information to end users.On the other hand, it can be noticed that big data and machine learning introduced in this work are only able to efficiently deal with the data storage, processing, and analysis, while the reliable data transmission and exchange are still problematic.Reinforcement learning is implemented to enable cognitive smart cities in combination with big data techniques and cloud/fog computing in [2].However, the key to implementing the architecture proposed in this work is the decentralization of analytic data computations, which is still a difficulty without support from vast-volume data transmission techniques.Summarized from the above literature, the two technical barriers hindering the promotion of SBs in practice: high reliability and high intelligence, are still hardly resolved simultaneously.

Motivations
In order to materialize the SB with high reliability and high intelligence, we try to enable SBs by indoor VLC and ML and propose a complete framework with details of all key fabrics in this article.As shown in Fig. 1, the framework of the SB can be split into seven functional layers and the interactive interface, in which the sensing and network layers are partially supported by indoor VLC in combination with other communication approaches and the semantic, software, processing as well as reasoning layers are highly associated with ML techniques.The service layer and interactive interface are also directly affected by ML techniques, which carry out and display ultimate outcomes output by a complex reasoning procedure by ML algorithms.By such a framework, the SB, ML and indoor VLC are intricately interconnected and form a dynamic and holistic system.We systematically detail the benefits and motivations of the proposed framework as follows.
Because the most important feature of VLC is the large and unregulated available bandwidth, indoor VLC is a promising approach to handle the massive data transmission in SBs where there exist a huge number of sensors for data collection [9].Meanwhile, because the security of SBs takes priority over other design metrics, indoor VLC is able to offer secure and reliable connections well against jamming, eavesdropping and other cyber attacking via constructing a physically isolated network.Apart from security, reduction of energy consumption is also a key metric for SBs, and because all data transmissions are piggybacked into illumination, indoor VLC can help reduce a large portion of energy consumption for data transmission.As a by-product, indoor VLC can also help to offload the cellular and household communication demands of residents and improve the quality of service (QoS) when coexisting with RFC.To be clear, we provide comprehensive comparisons between RFC and VLC in Table I.Besides, the high intelligence is another key feature of the SB.This indicates that an adaptive mechanism needs to be implemented so that an SB can learn from the collected data and improve itself over time with a high degree of intelligence and autonomy.Because of the real-time control requirement and the vast volume of data collected in SBs, traditional processing techniques are not competent anymore and ML stands out and shows its unique advantages and capabilities to deal with big data in SBs [8].ML is more computationally efficient and is more suitable for volatile environments.In particular, ML is able to extract useful information from massive observed data to make decisions and improve the setting parameters in an iterative way.We illustrate a generic schematic of ML in Fig. 2. Besides, ML could also help with pattern recognition and prediction as well as resource allocation by utilizing historical data, which are helpful for extracting contextual information and providing proactive actions considering long-term objectives.In the semantic layer, ML can interpret users' demands and allows demand inputs via voice or other customized interactive ways by pattern recognition.ML is supposed to be used throughout the software, processing and reasoning layers as a kernel to  construct a complete adaptive mechanism and improves the services provided in SBs according to established objectives.In the service layer, ML supports a large number of auxiliary functions (e.g., energy saving, space planning, resource coordinating, indoor navigating, positioning, and smart alerting).
Although indoor VLC and ML enable SBs, SBs also make indoor VLC and ML successes.Due to the physical properties of VLC, it suits indoor scenarios and SBs provide such an application scenario for VLC.Also, SBs provide reliable and sufficient transmit power for VLC.For ML, SBs not only offer sufficient power for computing but also provide tremendous storage space and processors to carry out fast big data analytics.For clarity, we depict the interdependent relation among the SB, indoor VLC, and ML in Fig. 3.

PROPOSED FRAMEWORK
In this section, we present more details of the multi-layer framework with the interactive interface.

Interactive Interface
The interactive interface is designed for interactions between human users and intelligent systems embedded in SBs.Two kinds of interactive interfaces can be provided in SBs depending on users' accessibility and usage habits, which are the fixed control panel and mobile control terminal.The former can be installed by upgrading currently established smart electricity meter or centralized temperature controller.The latter can be downloaded online as an app to one's smart phone and/or tablet.By the interactive interface, residents can monitor the security status of the spaces of interest and obtain the resource usage profile as well as other basic information.As a bidirectional system, users can also provide feedback, submit requests for services and report issues for attention.The interactive interface is directly linked to the semantic layer.

Semantic Layer
In the semantic layer, the original inputs by users are treated as raw data and mapped to machine languages.With the help of ML in the semantic layer, voice and gesture recognition are allowed to extract contextual information and interpret users' demands accurately.Meanwhile, the extracted information and interpreted demands from users are pre-processed and compressed before sending to the network layer for transmission.Another important function of the semantic layer is to label the users' feedback, so that the emergency feedback can be transmitted and processed in priority over other messages.

Sensing Layer
Apart from a small portion of information sent from interactive interfaces by users, the main data throughput comes from the sensing layer.The signals generated in the sensing layer contain a variety of observable environmental information, including security, safety, temperature, humidity, space occupancy, electricity usage, water usage, other optical, and acoustic information.To collect such a variety of environmental information and ensure to draw an accurate picture of the surrounding environment, a huge number of sensors are indispensable.To reduce the implementation cost of the proposed framework, one should try the best to reuse the existing facilities and instruments and only require installations of new sensing modules and devices if necessary.

Network Layer
The network layer is employed to support the transmission and reception among functional layers.Also, because the cloud and distributed computing architectures are adopted in the following layers, the network layer requires to construct a secure and reliable connection among a large number of distributed controllers and processors.Meanwhile, the accessibility to the Internet and cellular networks is a basic demand, which should also be supported in the network layer.Indoor VLC, owing to its advantageous properties, has been employed as the protagonist in the network layer.However, to overcome some of the drawbacks of indoor VLC and optimize the communication service provided, we need another two supporting roles: RFC and power line communications (PLC) [10].RFC can be employed for mobile data transmission and provides a supplementary transmission mechanism via mode selection.Meanwhile, due to the low cost of deployment, PLC relying on the existing power supply infrastructure in SBs is an attractive approach to connect LED transmitters and is adopted in the proposed framework as a networking backbone.

Software Layer
The software layer is employed as an interface to receive the raw data from the network layer and provide software platforms to process and store these data.In particular, the software layer should support the interaction with the external environment and the service layer by defining numerous I/O interfaces and activating control programs.In order to achieve these functions, first, a powerful database must be constructed, which is used to store historical data from various sensors and interactive interfaces.Also, cloud and distributed computing should be supported, since the hardware architecture adopted in the proposed framework is based on distributed controllers and processors.

Processing Layer
The processing layer is utilized to pre-process a large amount of raw data, which are presented in different formats and structures, so as to minimize the data redundancy and restore missing data if possible.Dimensionality reduction is another important function supported in the processing layer, which aims to maintain the validity of sensory information by a minimum number of variables by means of data redundancy elimination.To achieve this goal, the processing layer must be able to extract features of different data and perform selection and projection accordingly.ML techniques can also play a role in this functionality.In short, the processed data must be ready in unified and appropriate forms for the use by ML techniques in the reasoning layer.

Reasoning Layer
The reasoning layer is the intelligence kernel in the proposed framework, which supports all intelligent functions and services in SBs.In this layer, ML is the absolute protagonist and performs diverse intelligent reasoning based on the various application requests.In essence, ML in the reasoning layer provides an adaptive mechanism that learns from historical data when the learning objectives are specified by users or system designers.All intelligent functions and services as well as the status of the entire SB are controllable by a set of parameters, which can be changed in reasoning layer according to the input data containing users' demands and sensory information.Between the input data and output parameter set, there are diligently designed ML algorithms suitable for different scenarios, which can adaptively optimize its parameters according to the feedback of output results.After being trained by several training data sets, the reasoning layer will be capable of producing optimized output parameters for the service layer.

Service Layer
The service layer consists of actuators that are controllable by the output parameters from the reasoning layer and can change the status of the SB.For a typical SB, these actuators include but are not limited to temperature and humidity controllers in air-conditioning, smart switches of a variety of electric apparatuses, dimming controller, smart stereos, safety alarm, video surveillance camera, LED transmitter for VLC, and so on.By such a smart framework and the smart functions supported by ML, all services in SBs are expected to be continuously improved in the long term by iterative training with new data sets.

PROMISING VISIONS
When indoor VLC and ML are integrated and work together, some new features emerge.By these new features, more advanced services can be provided for users and the operational efficiency of the SB can be significantly improved.We thereby envision the following promising application scenarios based on this integration as follows.

Accurate Real-Time Monitoring of Indoor Environment
When jointly applying indoor VLC and ML, the most obvious benefit is to enable accurate real-time monitoring of indoor environment in SBs.High reliability and high intelligence are necessary to realize this service, because magnanimous data generated by distributed sensors is required to be transmitted and processed.By employing VLC in combination with other communication approaches (e.g., RFC and PLC integrating optical sensing), environmental parameters in SBs can be accurately detected and transmitted to higher layers.ML supports the fast processing of such a huge amount of data and enables the display of real-time monitoring information to users on interactive interfaces.Besides, with the help of indoor VLC and ML, data from multiple physically distributed sensors can be collected and processed to yield accurate and complex results.Overall, applying indoor VLC and ML technologies, an accurate profile of the indoor environment can be drawn in real time.

Accurate Location-Aware Services
Providing accurate information of the indoor environment in real time, the by-products are various location-aware services, including localization and navigation.location-aware services constitute a considerable portion of wireless communication throughput and are supported by the Global Positioning System (GPS) in outdoor scenarios.However, the GPS is unable to help with indoor scenarios, and the WiFi based solution is inaccurate [10].Since VLC can get rid of multi-path fading in indoor scenarios and has a higher number of transmitters, more accurate localization can thus be realized by indoor VLC in combination with RFC.Meanwhile, one can employ ML to enhance localization accuracy.Specifically, ML can partially filter out interference and predict moving trajectories of devices of interest and thereby makes associated location detectors proactive for service provision.

Smart and Fast Control of Indoor Environment
Despite excellent observability, jointly applying indoor VLC and ML in SBs also results in far better controllability.This better controllability benefits from the high-rate transmission and powerful reasoning capability provided by indoor VLC and ML techniques, respectively.As the distributed and cloud computing architectures are adopted in the proposed framework, the prerequisite of efficient processing and reasoning is to ensure reliable massive data transmission among different devices and functional layers.As most data are generated by stationary sensors and transmitted to stationary processing units, indoor VLC can accomplish the transmission requirement.Except for high-rate transmission, powerful reasoning capability is all-important to ensure appropriate controllability.In this context, ML can obtain historical data and compare them with the current environmental data as well as users' habits to determine the optimal actions to coordinate a variety of actuators.In this way, the indoor environment in SBs can be adjusted to be more comfortable for residents in a smart and fast manner.

CASE STUDY AND VALIDATION
To be observable, we use a simple indoor localization example to reveal the superiority of the combination of VLC and ML algorithms.We set a simulation platform within a cuboid room, of which width, length, and height are 10 m, 10 m, and 3 m, respectively.To simulate the scenario incorporating VLC and ML, we further assume that there are commercial LEDs modeled by point light sources installed on the ceiling with one-meter separation from each other.The configuration is similar to the case in [11], where there are four white spotlight LEDs installed in a cuboid room.Consequently, there are 81 LEDs on the ceiling.Moreover, we assume four WiFi access points (APs) to be installed on the ceiling with 2.5 m to the walls and five-meter separation to each other, which is even more than a usual configuration in practice.In order to make a comprehensive comparison between the performance of WiFi and VLC, we further assume another scenario where there are four LEDs to be installed in the same way as WiFi APs.We denote the results for this configuration as VLC-4, and denote the results when utilizing 81 LEDs as VLC-81.
We utilize received signal strength (RSS) based algorithms to predict locations of receivers.Normally, these algorithms require the pre-installment of receivers to collect RSS data to build a data set.Then, these RSS based algorithms can manipulate on the data set so as to predict locations of a new receiver with new RSS.Without loss of generality, the pre-installed receivers are assumed to be located at the height of 1 m to the floor, which is typically the height of phones held by humans.We set 99×99 receivers that each separates 0.1 m to adjacent receivers with the received field of view (ROV) of 0.7854, and the azimuth angle of each receiver is randomly chosen from -60°to 60°.The RSS data set for VLC is generated by Candles, a communication and lighting emulation platform [12].
To generate the data sets for training purposes, we run the simulation for 50 times for both VLC scenario and WiFi scenario, respectively.Instead of training a single ML model in a two-dimensional space, we establish two ML models for the localization on x-axis and y-axis, separately.Accordingly, for each ML model, we have 50×99 instances for training.After training the models for both VLC and WiFi, we again apply the same settings to generate new data sets to test the trained models.Specifically, we utilize the accuracy rate corresponding to different prediction error distances (PEDs) to evaluate different localization approaches.The PED is defined as the Euclidean distance between the predicted location and the authentic benchmark.The accuracy rate with which is defined as the number of predicted locations whose distances to the authentic benchmarks are smaller than the PED.A larger accuracy rate corresponding to a smaller PED thus yields a more accurate localization system.As we generate the training data sets for each receiver with 0.1-meter separation to adjacent receivers, the precision of the simulated system is 0.1 m.The accuracy rates for different PEDs with various localization methods are presented in Table II.To be comprehensive, we employed three representative ML algorithms: support vector machine (SVM), neural network (NN), and K-nearest neighbors (KNN) to assist the localization data processing.
As shown in Table II, different ML algorithms would bring different accuracy gains to the localization systems, and the superiority among different ML algorithms could change in terms of the required PED and affordable system complexity.It is also obvious that the accuracy rate increases with an increasing PED for all adopted ML algorithms, which is consistent with our expectation.As the results shown, the performance of VLC-4 with KNN is better than that of WiFi with KNN.However, the performance of VLC-4 is worse than that of WiFi, when applying the SVM and NN algorithms.The reason is that VLC has a better directionality than WiFi, which indicates that the received signal at different locations of VLC has a higher degree of independence.As expected, VLC-81 generates the best results equipped with all three algorithms, and the results generated by the SVM and KNN algorithms converge when PED goes large.
Considering the physical size of a human, 0.3 m of PED is deemed applicable for practical indoor localization systems.The corresponding accuracy rates to this PED produced by VLC based localization assisted by multiple ML algorithms are higher than 95 percent, which leads to the feasibility and promising future of such a joint approach in SBs.

CHALLENGES AND POTENTIAL FUTURE RESEARCH DIRECTIONS
As a prototype framework, there is much we can do to further promote and realize the framework in practice, which is worth investigating as future work.In this regard, we articulate several challenges and potential future research directions.

HetNet and Interference Management
As described above, a HetNet architecture is adopted in the network layer of the proposed framework, consisting of VLC, RFC, and PLC, which are inherently beneficial and make the entire network layer operate efficiently.However, coordination among heterogeneous communications is not a trivial task [6].Gateway design and compatibility should be given special attention.Relevant standardization works should also be completed in order to support this HetNet architecture for SBs in practice.
Also, by Table I, we know that interference has a severer impact on VLC than RFC.Therefore, to guarantee the performance superiority of indoor VLC in the proposed framework, interference mitigation technologies must be applied to ensure the interference level below a certain threshold.Because the lights from different LED transmitters would be the main source of interference in the indoor environment, appropriate VLC network deployment and LED transmitter placement become the keys to alleviating interference.Also, resource allocation and multiple-input and multiple-output (MIMO) beamforming could also be promising approaches to mitigate interference and optimize the overall performance [13], [14].All these are still being researched in the context of SBs.

Architecture of ML Algorithms
One should note that ML is a generic concept and represents a package of different learning techniques, which can be classified into several major parts such as supervised learning, unsupervised learning, semi-supervised learning, and reinforcement learning according to whether training data sets have labels or not.Moreover, it can also be divided according to the various training methods, for example, SVM, NN, KNN, decision tree (DT), and logistic regression (LR).It is a consensus that there is not a learning technique that can fit all cases, as they all have different pros and cons as well as applicable scenarios.For example, the KNN algorithm is a non-parameter ML algorithm, which implies that it does not require a model training process before making inference on new data instances.However, as the dataset becomes larger over time, the inference complexity for this kind of non-parametric ML algorithms will increase sharply.On the contrary, for other algorithms such as the above-mentioned NN and SVM algorithms, they need a model training process, but the inference complexity for these algorithms maintains fixed.Therefore, real-time applications can be fulfilled well by meticulously designing a parametric algorithm.In spite of the superiority of computing time, these parametric algorithms designed based on historical records might not produce accurate inference on new instances.This is because the preference of users may vary over time, which makes the distribution of collected data change over time and is termed the 'concept drift'.
Also, the architecture designs of either conventional algorithms and deep learning networks are also of great importance in terms of the functionality and performance of the proposed framework, which include how many parameters should be trained and what kind of structures of the training networks should be placed.More research pertaining to the selections of machine learning techniques and the deep leaning neural network architecture should be carried out.

SB-Edge-Cloud Computing Architecture
In most cases, all data are collected locally and the ML models for processing the data are also trained locally.However, with a rapidly growing amount of data, local computing power could be insufficient to cope with the increasing complexity of the ML model.For this reason, SB-Edge-Cloud computing architecture might be a potential technique for extracting useful information from the complicated dataset pertaining to the SB.The local processors in SBs provide limited computing power to deal with the most sensitive information, such as human-related data.On the other hand, edge computing with more computing resources but causing less latency can help to satisfy the computing tasks with high-reliability and lowlatency requirements.Cloud computing equipped with almost infinite computing resources could be played as the 'trump card' for the computation-hungry tasks.SB-Edge-Cloud computing architecture provides a bright future for intelligent applications in SBs.However, how to schedule the offloading of tasks remains a huge challenge to researchers.

Realistic Factors Affecting the Implementation
As we can see from the description of the proposed framework, high-rate data collection, transmission, and preprocessing/processing over multiple functional layers might result in great challenges to reliability, stability, and security.These challenges become severer, especially when the collected data are subject to data pollution, malicious user behaviors, and active network attacks.In this regard, anomaly detection mechanisms regulated by strict standards shall be involved to ensure the reliability, stability, and security of the entire data network, which is waiting for future explorations.
Meanwhile, a large number of sensors constitute the sensing layer.By implementing such a framework, it means that all residents and their living conditions are observable and can be 'seen' by high-layer programs and processing procedures.Therefore, the privacy of residents is at the risk of being divulged.To further promote the proposed framework, more investigations and legislation should be conducted to ensure a sufficiently secure data protection mechanism, so as to reduce the risk of information divulging.

CONCLUSIONS
To accomplish the rapid trend of urbanization, the SB plays an irreplaceable role.To enable the SB with environment perception and logic reasoning abilities, we envisioned an SB framework enabled by indoor VLC and ML in this article, which is supported by a multi-layer structure.Both indoor VLC and ML are jointly applied to construct a reliable transmission infrastructure and perform big data analytics as well as adapt the indoor environment of the SB.By this framework, the SB is envisioned to provide a variety of advanced services to residents in a smart and efficient manner.To promote further research and implement the framework in practice, we also simulated a simplistic case to verify its feasibility and expatiated on the challenges and potential future research directions.

Fig. 1 .
Fig. 1.Multi-layer structure of the SB with the interactive interface.

TABLE II ACCURACY
RATES FOR DIFFERENT PEDS WITH VARIOUS CASES.