## 4 Analysis
### Experiment Result  
We implemented our protocol on real devices to evaluate its performance. Our implementation adopts the TensorFlow library with Python 3.8. We used a Raspberry Pi 4 (Model B) as the IoT device, which is configured with Raspbian Debian GNU/ Linux 11 (bulleye) and has an 1.5 GHz quad-core ARM Cortex-A72 processor, 8 GB SDRAM of LPDDR4, and 32 GB SD card storage. We use a desktop as the edge device, which is configured with Ubuntu 20.04.3 LTS, an 8-core 3.60 GHz Intel i7-9700K processor, 32 GB memory, two Nvidia \begin{table}
\begin{tabular}{c c c} \hline \hline \multicolumn{3}{c}{**Computational Cost of IoT Device**} \\ \hline \multicolumn{3}{c}{**Convolutional Layers**} & **Fully-Connected Layer** \\ \hline Local execution & \(2H\hat{n}k^{2}\hat{n}^{\prime 2}\) & \(\hat{n}\hat{m}\) \\ \hline Ours & \(\hat{n}^{2}DT+\hat{n}^{\prime 2}HT\) & \((\hat{n}+\hat{n})T\) \\ \hline \hline \end{tabular}
\end{table} 
Table 3: The comparison of computational cost of IoT device between local execution and our scheme. GeForce RTX 2080 Ti GPU, and 2 TB HDD storage. The IoT device and the edge device are deployed in the same building and connected through 2.4 GHz WiFi of 300 Mbps. We used ImageNet [16] as the dataset and implemented a privacy-preserved SqueezeNet and ResNet-50 to compare with the current state-of-the-art cryptographic 2 PC-NN solution CrypTFlow2 [17]. The result depicted in Table 4 shows that our solution has 4.7\(\times\) to 24.7\(\times\) speed-up in terms of computation as compared to CrypTFlow2 on the two CNN models being evaluated. For the communication overhead, our design requires an interaction of the client and the edge node only for the transmission of the encrypted data and the encrypted scalar product, which are of the same size compared to the expanded ciphertext using heavy cryptographic primitives such as homomorphic encryption. As a result, the communication cost of our protocol is 65 to 4000 times less than CrypTFlow2. We summarize the experimental results from AlexNet in Table 5 and compare the performance of each layer with local execution and the overall performance with the literature [15]. As shown in Table 5, our protocol significantly improves the efficiency of the AlexNet inference task, achieving a 14.26\(\times\) speed-up compared with executing the inference task on IoT devices locally. It is noteworthy that, for the convolutional layer, our protocol achieves up to over 66\(\times\) faster than local computation. With the number of convolution layers increasing in more complicated CNNs such as ResNet-50, DenseNet-121, our secure inference scheme retains the advantage of performance, as shown in Table 4.  
In terms of storage overheads, in our design, the storage cost, which contains mainly the secret-key pool \(\mathcal{R}\) and the pre-computation table, is fixed once the pre-trained CNN model is selected. For SqueezeNet and ResNet-50, the storage overhead of our protocol is 0.54 GB and 2.61 GB, respectively. For the implementation of AlexNet, considering the extremely imbalanced ratio between parameters and FLOPs, where there are over 586 million parameters with 58 million FLOPs performed in fully connected layers, while the number is 3 million parameters with over 665 million FLOPs, we outsource the convolutional layers only and keep the fully-connected layers computed locally. The storage overhead for the convolutional layers of AlexNet is 1.98 GB. We want to mention that better performance is expected when the IoT devices with sufficient storage can pre-load the complete pre-computation table for AlexNet. Our experiment also shows that [15] is faster than our protocol. According to our experiments, it takes [15] around 2.51 s to execute the AlexNet, while ours took around 6.76 s, though both are significantly faster than other crypto-based solutions such as [17]. However, as mentioned earlier, one outstanding limitation of [15] is that its storage cost on the IoT device grows linearly to the number of inference instances being executed.