# HFD: Hierarchical Feature Detector for Stem End of Pomelo with Transformers
## 7 Conclusions  
In this paper, to accurately and efficiently distinguish the stem end of pomelo from its black spot, we propose a hierarchical feature detector (HFD) model with the combination attention module (CAM) and the hierarchical feature fusion module (HFFM). Figure 8 shows the inference results of HFD.  
On our pomelo dataset, HFD achieved mAP of 89.65% at 70.92 FPS with 100.34 M parameters; the mAP is 8.37% greater than DETR, which also has the backbone of Swin Transformer (base). It is competitive with the state-of-the-art transformer-based detectors such as DETR, Deformable DETR, and YOLOS and one-stage detectors such as YOLO v4 and YOLO v5 with high detection accuracy and real-time performance. In particular, the mAP of the stem end of the pomelo reaches 98.23% in HFD-Swin-base, and the mAP of the black spot reaches 81.93%.  
The limitations of this paper are mainly that it reports some improvements of the object detection algorithm in the case of a specific fruit (pomelo). When it comes to possible future enhancements, the proposed HFD should be applied to a wider variety of fruits for object detection and have a wider practical application impact. The detector can continue to be optimized to achieve better accuracy and faster speed.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Model** & **HFFM** & **Parameters (MB)** & **mAP** & **Speed (FPS)** \\ \hline HFD-Swin-base & \(\times\) & 97.85 & 85.37 & 76.20 \\ HFD-Swin-base & \(\surd\) & 100.34 & 89.65 & 70.92 \\ \hline \hline \end{tabular}
\end{table}
Table 4: The effectiveness of the hierarchical feature fusion module for HFD with Swin-base.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Model** & **I\({}_{\text{IoU}}\)** & **I\({}_{\text{token}}\)** & **Parameters (MB)** & **mAP** \\ \hline HFD-Swin-base & \(\times\) & \(\times\) & 99.51 & 87.42 \\ HFD-Swin-base & \(\surd\) & \(\times\) & 100.26 & 88.91 \\ HFD-Swin-base & \(\surd\) & \(\surd\) & 100.34 & 89.65 \\ \hline \hline \end{tabular}
\end{table}
Table 5: Performance change with different loss function.  
**Author Contributions:** Conceptualization, B.H.; methodology, B.H.; software, B.H.; validation, B.H.; formal analysis, B.H.; investigation, B.H.; resources, G.L.; data curation, B.H.; writing--original draft preparation, B.H.; writing--review and editing, B.H.; visualization, B.H.; supervision, G.L.; project administration, G.L.; funding acquisition, G.L. All authors have read and agreed to the published version of the manuscript.  
**Funding:** This research was supported by the International Partnership Program of Chinese Academy of Sciences (no. 184131 KYSB20200033), the National Key R&D Program of China (no. 2018 YFD0700300), and the Chinese Academy of Sciences Engineering Laboratory for Intelligent Logistics Equipment System (no. KFJ-PTXM-025).  
**Institutional Review Board Statement:** Not applicable.  
**Informed Consent Statement:** Not applicable.  
**Data Availability Statement:** The datasets used to support the findings of this study are available from the corresponding author upon request.  
**Conflicts of Interest:** The authors declare no conflict of interest that could be perceived as prejudicing the impartiality of the research reported.