# Edge Computing Based on Federated Learning for Machine Monitoring
## 4 Experimental Results  
This section describes the experimentation of the proposed method, which was built in a plastic injection factory. The edge node was implemented by a simple camera, Pcam 5C, embedded on Terasic DE2-115 board to monitor machines and only process low-level data and part of the fog computing. The video streaming formats of Pcam 5C was set to be 1080 p at 30 frames per second to fit the real-time monitoring requirement. TensorFlow Lite was initially trained with a database including 58,688 images generated under the environment of the plastic injection factory. Normalization process resized each image to be 32 \(\times\) 32 pixel in the training process. The real-time image capturing provides input images for scene change detection. Figure 9 illustrated the result of scene change in six continues frames Figure 9A-F. For Figure 9A,B, There is no change between them such that the SSIM value is almost equal to 1. However, the SSIM value between Figure 9C,D (Figure 9E,F) is 0.51 (0.2), respectively. It represents that scene change happens in those frames and that the TensorFlow Lite model is further applied to extract low-level features. The monitoring process of the actual operation of plastic injection machines is captured for 18 s and presented in Figure 10. The horizontal axis in the figure represents time, and each unit scale is 1 s. The vertical axis indicates the reciprocal of the SSIM measurement index, which varies from 0 (no change) to 1 (scene change) and each scale is 0.1. The figure contains four machines presented as lines in different colors. It is observed that most SSIMs are less than 0.2 such that it is set to be the threshold value T for determining scene change. There is a dramatic change in SSIM between the third and fourth seconds, which represents the temperature change of all machines caused by the unstable power at that time. After the product was completed, the residual temperature of the mold opening caused temperature changes and reflected that SSIM changes in the seventh, eleventh, and seventeenth seconds at the same time. There are 21 image pairs exceeding the T value in the image sequence, which contains 540 images. Fog computing integrated end devices for further verifications, and 17 data changes were excluded. Cloud computing can clarify the cause of the four signals to determine the possibility of abnormal event. Figure 9: The result of scene changes in six continuous frames (**A**)frame 1; (**B**) frame 2; (**C**) frame 3; (**D**) frame 4; (**E**) frame 5; (**F**) frame 6. When SSIM exceeds threshold T, edge computing performed on Terasic DE2-115 board extracts image features using the image pre-analysis model and transmit it to fog computing. The status of edge node is used to note the scene change result and stores in the database. When scene change detection is true, its status is changed from 0 to 1. When the image is the same as the previous one under the test by SSIM, the edge computing environment does not change, and the state remains 0. The fog node receives features from end nodes and performs multiple feature analysis, according to the machine state information. Otherwise, it does nothing and waits for the next state change. Because duplicate images are not processed, computing performance and visual accuracy of images can be improved. In Figure 11, the status is 1 for event 1 to event 12 and event 14 to event 18, but image 13 is 0. Figure 11: The record of the status of scene change detection in the database. Figure 10: The real-time monitoring process of the actual operation of plastic injection machines. In the scenario, when the digit number of temperature information on the PLC panel screen changes, SSIM will detect the scene change on the edge computing. The edge node also extracted low-level features of images in which SSIM exceeded T and transmits features to fog computations. The average accuracy of the image capturing based on the trained TensorFlow Lite model approached 99.8% under the online test in a plastic injection factory for a week.