# Real-Time Image Detection for Edge Devices: A Peak Fruit Detection Application
## 4 Conclusions  
In this study, we proposed the use of a lightweight and hardware-aware MobileDet detector model for real-time peach fruit detection applications in conjunction with an edge device and TPU accelerator. A novel annotated dataset of three peach cultivars was created and made available for further studies.  
Models designed to run on a TPU device (e.g., SSD MobileDet and SSD EdgeTPU) (hardware-aware) performed approximately 4% (AP) better than models that were not designed to run on a TPU (native). An important result is that the inference speed was, on average, 20 times faster when the model ran on a TPU device than on a CPU. The MobileNetV1 model running on a TPU device performed at 21.01 FPS, and the MobileDet  
Figure 5: Models’ performance on the edge TPU device.  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Model** & **Device I Accel.** & **Price (O)** & **Input Size** & **Fruit** & **AP (\%)** & **Latency** \\ \hline Approach\_1 & Jetson Nano I GPU & 108 & 608 \(\times\) 608 & Citrus & 93.32 & 180 (ms) \\ \hline Approach\_2 & Jetson Xavier I GPU & 429 & - & Apple & 85 & 45 (ms) \\ \hline Our & Raspberry I TPU & 141 & 640 \(\times\) 480 & Peach & 88.2 & 50.4 (ms) \\ \hline \hline \end{tabular}
\end{table}
Table 5: Comparison of the models. Approach_1: Modified YOLOv5 [23], Approach_2: Modified YOLOv3 [22], Ours: SSD MobileDet.  
model performed at 19.84 FPS. At a loss of 1.17, the FPS did not significantly affect the performance for practical computer vision applications. Therefore, it is reasonable to use SSD MobileDet to improve the detection accuracy. A comparison was made with other approaches. However, a direct comparison between the approaches was not possible because different datasets and image sizes were used. Considering the price, AP, and latency, our approach of using a TPU accelerator is a good alternative for practical applications. Further research could also be conducted to explore fruit yield estimates based on the approach presented in this paper.  
Conceptualization: P.D.G. and E.A.; Data curation: E.A.; Formal analysis: E.A., P.D.G., M.P.S. and H.P.; Funding acquisition: P.D.G.; Investigation: E.A. and K.A.; Methodology: E.A. and P.D.G.; Project administration: P.D.G.; Resources: M.P.S., V.N.G.J.S., J.M.L.P.C. and K.A.; Software: E.A.; Supervision: P.D.G.; Validation: E.A. and K.A.; Visualization: E.A.; Writing--original draft: E.A.; Writing--review and editing: P.D.G. and H.P. All authors have read and agreed to the published version of the manuscript.  
This work was funded in part by the PrunusBot project--Autonomous controlled spraying aerial robotic system and fruit production forecast, Operation No. PDR2020-101-031358 (leader), Consortium No. 340, Initiative No. 140, promoted by PDR2020 and co-financed by the EAFRD and the European Union under the Portugal 2020 program.  
The dataset is available at [[https://github.com/PeachDataset/Dataset](https://github.com/PeachDataset/Dataset)]([https://github.com/PeachDataset/Dataset](https://github.com/PeachDataset/Dataset)), accessed on 25 September 2022.  
The authors declare no conflict of interest.  
A video demonstration is available at [[https://user-images.githubusercontent.com/99321854/153617667-830](https://user-images.githubusercontent.com/99321854/153617667-830) ce756-5e6b-4d08-9011-b68 acd001352.mp4]([https://user-images.githubusercontent.com/99321854/153617667-830](https://user-images.githubusercontent.com/99321854/153617667-830) ce756-5e6b-4d08-9011-b68 acd001352.mp4), accessed on 25 September 2022.  
The following abbreviations are used in this manuscript:  
APAverage precision  
FPSFrames per second  
GPUGraphics processing unit  
TPUTensor processing unit  
DSPDigital signal processor  
SSDSingle-shot detector  
YOLOYou only look once  
CNNConvolutional neural network  
AutoMLAuto-machine learning  
PTQPost-training quantization  
QATQuantization-aware training