# Deep Learning Entrusted to Fog Nodes (DLEFN) Based Smart Agriculture
## 1 Introduction  
In rural areas, the increasing age of populations and reduction in quantity will lead to weakness of economic power due to labor shortage. Smart agriculture technologies are already being used in many countries as an approach, using information and communication technology (ICT) to effectively solve rural problems such as the above-mentioned labor shortage [1; 2]. Recently, smart agriculture has attempted and implemented full automation incorporating other trending technologies such as big data, Internet of Things (IoT), and artificial intelligence (AI) to improve farmers' quality of life (QoL) [3]. AI has been extensively studied for decades and has become popular today, along with other high-end technologies [4]. AI technologies are used to extract valuable data from various data generated by IoT devices. Deep learning (DL), which is an AI technology, is effective in analyzing huge multimedia data such as images and videos. DL technology can be used to identify health conditions by analyzing the movement of livestock or to optimize the timing of harvests by analyzing the shape of agricultural products [5]. Thus, the proper utilization of DL in smart agriculture significantly improve farmers' economic power [6]. Fog computing (FC) is another recent technology that has improved quality of service (QoS) for modern ICT in the 4 th industrial revolution. Unlike cloud computing, which processes all data at a central server, fog nodes distributed in FC support the processing on a central server [7]. In modern environments where huge volumes of multimedia data are continuously generated from IoTmedia devices such as CCTV [8], processing all data on a central server may bring on low QoS, such as response delay due to burden of the server and limitations of the network. In FC, intermediate servers called fog nodes preprocess some of data received from devices and share the burden of the central server. In DL processes, valuable results are obtained after incoming data traverse through many layers, since a DL model is composed of multiple layers to analyze features. Processing at each layer extracts features and generates data for delivery to the next layer; the size of the generated data is thus significantly reduced compared with the incoming size. An architecture of DL models is appropriate for a FC system, since fog nodes can handle some layers that process incoming data and the cloud server can then handle residual layers to process the data transferred from fog nodes. Fog nodes reduce the data volume by dealing with the authorized DL layers. Therefore, DL operation on FC can reduce overall network traffic and computational overhead on a cloud server, thereby minimizing response delays and allowing more DL operations to be accommodated. Herein, we propose a deep learning entrusted to fog nodes (DLEFN) algorithm that decides the optimal number of DL layers that can be handled by each fog node. The proposed DLEFN aims to improve the availability and utilization of fog nodes distributed in an FC environment and to accommodate many applications effectively. The optimal layers are decided by taking into account the available computational capacity and bandwidth at each fog node. DL processing at fog nodes reduces the data volume sent to the cloud, which therefore reduces computational overhead at the cloud and network. The available resource capacities at each fog node commonly have the possibility of being different due to new device installation, execution of extra tasks, received data size, and network facilities. Considering an environment made up of fog nodes with differences in performance, the DLEFN defines handling layers for DL tasks at each fog node individually. We experimented with and compared the proposed DLEFN algorithm and other methods such as simple gateway and static and dynamic layer decisions. The results showed considerable improvement associated with the DLEFN compared to existing schemes in the number of accommodated DL applications and resource utilization at fog nodes.