# Improved YOLOv7 Algorithm for Small Object Detection in Unmanned Aerial Vehicle Image Scenarios
## 5 Experiments
### FPGA Implementation Results  
The hardware platform is the ALINX AXU3 EG based on the Xilinx Zynq UltraScale+ MPSoC development platform. To deploy the YOLOv7-UAV algorithm on it, we made the following preparations. First, the hardware project containing the DPU IP core was built in Vivado software, and the project was converted to a bitstream file [42]. B1600 was chosen as the system architecture of the DPU, which mainly considers the hardware \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Algorithm** & **[EMAIL_ADDRESS] (\%)** & **Parameter (M)** & **Model Size (MB)** & **GPU Utilization (\%)** & **FPS** \\ \hline YOLOv3 & 29.41 & 61.62 & 235 & 83 & 32 \\ YOLOv4 & 29.68 & 64.05 & 244 & 86 & 28 \\ YOLOv5 & 34.53 & 46.25 & 176 & 78 & 35 \\ YOLOv7 & 41.40 & 37.29 & 142 & 79 & 33 \\ YOLOv7-UAV & 45.30 & 26.77 & 102 & 79 & 30 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Comparison of different algorithms. Figure 9: Some visualization results. (**a**,**b**) Results from YOLOv7. (**c**,**d**) Results from YOLOv7-UAV. resources of the AXU3 EG. Table 4 shows the detailed information of these parameters. The usage of the lookup table (LUT), flip-flops (FFs), blocked random-access memory (BRAM), and digital signal processing (DSP) is 62.60%, 46.13%, 75.93%, and 86.67%, respectively. Second, a Linux system was created based on the bitstream file in Petalinux software, and the OpenCV library was added to pre-process and post-process the images [43]. Finally, the DPU executable model files of the YOLOv7-UAV algorithm and Linux system were copied to the SD card, and the whole system was run by the SD card. In order to deploy the YOLOv7-UAV model on the FPGA platform, we used the quantization operation based on Vitis-AI while using a calibrated dataset to reduce the loss of accuracy. Table 5 shows the comparison between the FPGA (AXU3 EG) platform, the GPU (Tesla V100) platform, and the embedded AI (Jetson TX2) platform. The AXU3 EG platform can achieve 22 FPS when the input image size is 640 \(\times\) 640. Although the FPS of Tesla V100 is higher, the power consumption of Tesla V100 is up to 250 W, which is 17 times more than the power consumption of AXU3 EG. The huge power consumption of the GPU cannot meet the low-power requirements of UAVs. If the energy efficiency of AXU3 EG is divided by the energy efficiency of Tesla V100, it is found that AXU3 EG is about 12 times more energy-efficient than Tesla V100. Although AXU3 EG and Jetson TX2 have the same low power consumption level, the FPS of AXU3 EG is almost ten times higher than that of Jetson TX2. Compared to Jetson TX2, the AXU3 EG deployment performs faster inference and is more suitable for UAV image object detection tasks with a real-time requirement. Therefore, the FPGA-based object detection deployment platform designed in our study is more suitable for deployment on low-power UAVs and can be extended to similar edge devices with limited energy. We also compared other algorithms on the same FPGA (AXU3 EG) platform to clearly understand the advantages and disadvantages of the proposed methods, as shown in Table 6. YOLOv3, YOLOv4, YOLOv5, and YOLOv7 were also implemented on FPGA with the described Vitis-AI scheme. The FPS of our proposed YOLOv7-UAV algorithm appears to have decreased from 33 to 22. This may be due to the large scale of features in the added prediction head (P2) and its associated networks, resulting in extended computation times during the DPU inference on FPGA. Nevertheless, the FPS of our proposed YOLOv7-UAV is still at an acceptable level for real-time applications on UAVs. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Resource** & **Utilization** & **Available** & **Percentage Utilization (\%)** \\ \hline LUT & 44,169 & 70,560 & 62.60 \\ FF & 65,099 & 141,120 & 46.13 \\ BRAM & 164 & 216 & 75.93 \\ DSP & 312 & 360 & 86.67 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Hardware resource utilization of FPGA.