# Carbon Oxides Gases for Occupancy Counting and Emergency Control in Fog Environment
## 1 Introduction  
With the development of sensor network technologies, multiple forms of objects surrounding us can be connected to the network through a nearby access point. The proliferation of sensing devices in communicating-actuating networks paved the way for the Internet of Things (IoT) [1], while simultaneously generating enormous amounts of data. Data collected by sensors are transmitted or analyzed to yield a better understanding of the current states, make intelligent decisions or predict future trends. Cloud Computing [2], which enables ubiquitous, convenient, on-demand network access to a shared pool of configurable computing resources (e.g., networks, servers, storage, applications, and services), can be rapidly provisioned and released with minimal management effort or service provider interaction. The \"pay-as-you-go\" Cloud Computing model is an efficient alternative for customers to store or analyze data. Some public Cloud service vendors, such as Google Cloud Dataproc, provide virtual machines with managed data analytics frameworks like Apache Spark or Hadoop for batch processing, querying, streaming and machine learning. Tremendous data such as multimedia data [3] can be processed in Cloud efficiently. Wireless Sensor Networks (WSNs) combined with Cloud makes it easier to share and analyze data on-the-fly, meanwhile providing Sensing as a Service (SaaS) and Sensor Event as a Service (SEaaS) to the clients over the Internet [4]. Applications of WSN, such as weather forecasting [5], health care [6], 3D scene reconstruction [7], smart car [8] have been studied in Cloud environment. However, when considering real-time processing, uploading/downloading to/from Cloud may cause longer latencies due to network transmission or congestion. In order to satisfy delay requirements of latency-sensitive applications, in 2012, Cisco proposed the definition of Fog Computing [9], which extends the Cloud Computing to the edge of the network. Fog Computingis located between end devices and traditional Cloud Computing Data Centers. It provides computing, storage and networking services in order to make it convenient for critical Internet of Things services and applications. Authors in [10] also pointed out that Fog computing has emerged as a promising edge device to decentralize data processing, decrease latency, and bring more reliability for WSNs in IoT. [PERSON] et al. [11] proposed an Internet of Everything architecture for Fog Computing with energy-aware algorithm for Fog data center. [PERSON] et al. [12] proposed an energy-efficient adaptive resource scheduler for Networked Fog Centers (NetFCs) and provide real-time services to vehicular clients. In [13], the authors presented a Fog-supported smart city network architecture in which the applications running on things jointly compute, route, and communicate with one another through the smart city environment to decrease latency and improve energy provisioning and the efficiency of services among things with different capabilities. For the past decades, fire has caused many losses and personal injuries around the world. Usually, people prevent fire passively by fire alarm systems triggered by dense smoke. When there is a fire, informations about the room/building is very crucial for fire fighters, which can help them to make rescue strategy properly. However, traditional alarm systems cannot provide useful information about the room states. Motivated by these considerations, we present an intelligent system for fire control and occupancy counting, where machine learning algorithms are adopted to build a model to describe the relationship between the concentration of CO\({}_{2}\) and human occupancy. Notice that the emergency control application requires prompt processing, considering the limit computing power of local computers, it is highly possible that the computer is not able to handle complex computing tasks.