# The Vision-Based Data Reader in IoT System for Smart Factory
## 4 Discussion  
This section shows the parameter setting and discussion about the experimental results. The experimental environment was built in two plastic injection factories. One had 12 machines with four types of panels and the training images were generated from four machines. There was one for each type of machine. The other had 10 machines also with four types of panels, and the testing images were generated from four of them. In the VDR system, the camera, Pcam 5C, was used as the vision module to be embedded on the FPGA development board, which was attached to monitor the screen on the control panel of the machines. The video streaming format was set as 30 frames per second for computation  
Figure 11: The architecture of the proposed deep learning model. consideration, although it supports another choice at 60 frames per second. Since the original imaging module is designed around the Omni-vision and provided a 5-megapixel color image by active array dimensions with a size of 2592 \(\times\) 1944, the performance of the proposed VDR system can be improved further. Since the camera provides a 5-megapixel image, the captured image of the control panel will contain each digit on the panel. In fact, there are many digits on a control panel. For the FPGA development board, an Intel. DE10 Lite with a powerful main chip was used as the hardware platform. Both training and testing processes were performed with the image dataset captured from the aforementioned experimental environment. When generating the image database, there was no restricted limitation about the illumination configurations. The situation was the same as the daily production of the factory. The image dataset contains 54,688 digit images. All of them were normalized to 28 \(\times\) 28 for the training process. To improve the accuracy and reduce the loss percentage of the deep learning model, the initial learning rate was finally set to be 0.01 based on the prior testing process on several different learning rates for optimal performance. Adam optimization [43] is the frequently used optimizer for deep neural networks and provides good results. The loss function adopted L2 regularization and a square coefficient is used as a penalty term. For the entire training dataset, the proposed model is trained for 100 epochs to see the change in learning rate. The loss curve vs. epochs of the training and testing process is shown in Figure 12. For comparing the performance with the existing methods, a VGG-based CNN method is also implemented for digit recognition [22]. Tests of the proposed method were implemented in a plastic injection factory. It showed the improvement in manufacturing products by the proposed system and achieved a high digit recognition accuracy of 97.56%. Furthermore, the ROI identification was 100%, because the edge of the ROI did not need to approach the boundary of the digit and the calibration of cameras can also improve the precision. In addition, the experiment was performed on low-power end devices with the micro control unit. The proposed network resulted in about 1% lesser accuracy than the existing VGG-based CNN method, but a few parameters were used to fit the hardware performance of FPGA. The comparison of the accuracy of the proposed and existing method is shown in Table 1. For Table 1, the training and testing of the VGG-based CNN method was performed on a GTX 1060 with  
Figure 12: The loss curve vs. epochs of the training and testing process. 6 GB memory and the power rate was 115.0 Watts. However, it needs only 5 Watts for the proposed method to train and test on the Intel. DE10 Lite. Although the network won't reach 100% accuracy, the need for an operator to check for false positives and false negatives is drastically reduced. To verify the efficiency of the developed method to the industrial reality, the developed architecture was implemented in a designed testing platform for simulating the online test. Two simulations based on the statistical model were adopted in this study.