# Exploring Distributed Deep Learning Inference Using Raspberry Pi Spark Cluster
## 3 Methodology
### Neural Network Models & Datasets Used  
The first experiment used the ImageNetV2 [21] and CIFAR10 [22] datasets for evaluating the inference performance in image classification for every system stated in Section 3.6. ImageNetV2 was chosen as it is considered the benchmark dataset for classification models. CIFAR10 was chosen to complement it as a simpler and smaller dataset in contrast to the complex nature of ImageNetV2. The next experiment deals with face detection performance using the WIDER FACE [23] image dataset, which was the face detection benchmark dataset for the second experiment. Convolutional neural networks (CNN) such as Inceptionv3 and its lightweight counterpart, MobileNetV3, were used for image classification for all system configurations in the first experiment, whereas RetinaFace, YOLOface, and Multi-task Cascaded Convolutional Network (MTCNN) were used solely for face detection in the second and third experiments. Nowadays, there are a wide variety of CNN architectures for different use cases. Newer CNN architectures can classify datasets with a high number of labels, such as \begin{table}
\begin{tabular}{c l} \hline \hline
**Evaluation Metrics** & **Equations** \\ \hline \multirow{2}{*}{\begin{tabular}{c} Execution Time \\ [14; 16; 17] \\ \end{tabular} } & \(ET=T_{e}-T_{s}\) \\  & where \(ET\) represents execution time, \(T_{e}\) represents the end time of \\  & request, and \(T_{s}\) represents the start time of request. \\ \hline \multirow{2}{*}{\
\begin{tabular}{c} Frames Per Second \\ (FPS) [18; 19] \\ \end{tabular} } & \(FPS=\frac{N}{s}\) \\  & where \(N\) represents the number of image frames rendered and \(s\) \\  & represents one second. \\ \hline \multirow{3}{*}{
\begin{tabular}{c} Speedup \\ \end{tabular} } & \(S_{n}=\frac{T_{1}}{T_{s}}\) \\  & where \(S_{n}\) represents speedup in configuration \(n\), \(T_{1}\) represents execution \\ \cline{1-1}  & time for the baseline configuration and \(T_{n}\) represents the execution time \\ \cline{1-1}  & in the configuration \(n\) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Evaluation metrics used in the experiments and their respective equations. ImageNet, at higher accuracy, as with InceptionV3. InceptionV3 is the newest version of the Inception neural network model and contains a different neural network structure as opposed to its predecessors. It is pre-trained on the ImageNet dataset, which saves the hassle of transfer learning, as inference can be done on the test set of the ImageNet dataset directly. It is one of the best image classification models in terms of accuracy and is therefore chosen for the experiment to investigate the performance trade-off for the testing accuracy gained. MTCNN [24], RetinaFace [25], and YOLOface [26] are other CNN architectures optimized for face detection. YOLOface is a version of the YOLOv3 CNN model trained on the WIDER FACE dataset, and it obtains higher accuracy than YOLOv3 in detecting faces. MTCNN is different and is comprised of 3 components. As explained in [27], the first component is the Proposal Network (P-Net) which generates candidate windows that help in classifying images as 'face' or a 'non-face'. These candidate windows are used to estimate bounding boxes on face locations. The second component, the Refine Network (R-Net), is intended to reject false candidate windows. Finally, the Output Network (O-Net) outputs the facial landmarks' positions based on the results of the two previous components. RetinaFace is a recent state-of-the-art face detection architecture that uses feature pyramid networks that are based on the concept of convolution seen in CNNs. Notably, it achieved one of the highest accuracies in the WIDER FACE dataset at 91.4%. Table 3 summarizes the datasets and models used in Experiments 1 to 3.