# Edge Computing Based on Federated Learning for Machine Monitoring
## 3 System Design for Edge Computing in IoT  
### The Architecture of the Proposed System  
The Industry 4.0 trend is bringing many new applications that require low latency and network independence. This can only be provided through edge processing in IoT. These cases include computer vision for machine monitoring. It can be further accelerated and improved by incorporating machine learning inference on embedded systems. In this paper, we propose a three-layer IoT system to perform computer vision for machine monitoring, which includes edge layer, fog layer, and the cloud layer. The architecture of the proposed system is shown in Figure 4.  
The first layer captures images for data generation and training/testing for low-level features. The low-level features in the image include color, texture, line, shape, etc.  
Figure 4: The architecture of the proposed system.  
Although these multiple features can obtain the most direct panel information, the images obtained in the factory environment are highly variable, and the degree of variation will affect subsequent identifications. The large amount of generated data creates a huge burden on the cloud server, e.g., causing latency problems. Therefore, we added the fog node in the IoT as a middle layer placed between the cloud and the edge devices to assist the convergence of training and accelerate the transmission process. The fog node can be set in the factory's own server. The method divides computing tasks and pushes them down to edge devices. It intelligently decomposes the computation of edge and fog nodes, which not only conforms to the distributed setting but also protects the user's data privacy. Therefore, the mid-level features in the second layer are logical features in the image that can generate specific types of panel information objects through the identification results of low-level features. These objects can be combined into multiple logical features, including knobs, pointers, bar charts or pie charts, and other objects. The relationship between scale and length can be used for further logical reasoning feature identification. The strategy in the architecture is to reduce the training cost by applying local learning on edge devices and perform federated learning on fog nodes. This method successfully reduces the data samples, the communication costs of training models, and protects the user's privacy. The final layer of the system is on the cloud with highest computing power, and it is responsible for high-level features in images. It generates semantic conceptual description for the behavior of objects, including digital recognition, text message recognition, or real-time production status flow charts, etc. They can be used to detect abnormal events and integrate multiple information and provide operators and manager the basis for decision making.  
Based on the architecture of the proposed system, Figure 5 shows the IoT system implemented in a plastic factory. The end device performs real time monitoring by scene change detection and extracts low-level features. Fog node gathers low-level features from end devices to form mid-level features and transmits to the cloud. The fog node was set in the factory in the proposed experiment. Finally, decision making is performed by high-level features in the cloud server with its high computing power. Only the abstract data are stored in the cloud database for further analysis, which can avoid the revelation of the factory's confidential data. Each component in Figure 5 will be described in the following sections.  
Figure 5: The IoT system implemented in a plastic injection factory.