## 5 Conclusion and Future Work  
We develop a multi-task framework for enhanced pest recognition, leveraging the strengths of the DAM-Net and the ResNet-50 for the main and subsidiary tasks, respectively. We confirm that the DAM-Net effectively identifies fine-grained features, with the ResNet-50 enhancing this by enriching texture details and global context, thus improving the framework's generalizability. The framework incorporates an adaptive weighted loss mechanism to dynamically adjust loss weights based on task uncertainty, aiming to improve overall accuracy. Tests on the D0 and IP102 datasets prove the robustness of our method, reaching accuracies of 99.7% and 74.1%, respectively, and outperforming existing methods. Despite the framework's efficacy in pest recognition, it demonstrates limitations when dealing with imbalanced datasets. To address this, it is crucial to collect a comprehensive collection of high-quality photos of insects at various stages of development. Future work will leverage diffusion models to augment scarce categories by synthesizing high-fidelity images, thus enhancing the framework's generalizability across diverse pest scenarios and improving its performance in pest control and crop protection amid data scarcity.  
Conceptualization, Z.D. and Z.Z.; methodology, Z.D., X.W.; software, Z.D., Y.W.; validation, X.W., Y.W.; formal analysis, Z.D.; investigation, Z.D.; data curation, Y.W.; writing--original draft, Z.D., X.W.; writing--review and editing, Z.Z. and J.G.; visualization, Z.D.; supervision, Z.Z. and J.G.; project administration, Z.Z. and J.G.; funding acquisition, Z.Z. and J.G. All authors have read and agreed to the published version of the manuscript.  
This research was funded by National Litchi and Longan Industry Technology System of China (CARS-32-11), Key Laboratory of Modern Agricultural Intelligent Equipment in South China, Ministry of Agriculture and Rural Affairs, China (HNZJ202209), Special Fund for the Rural Revitalization Strategy of Guangdong (2023 TS-3, 2024 TS-3) and Guangzhou Key Research and Development Project (2023B03J1363).  
Not applicable.  
Two public datasets including D0 and IP102 can be obtained from the links below: D0: [[https://www.dlearningapp.com/web/DLFautoinseects.htm](https://www.dlearningapp.com/web/DLFautoinseects.htm)]([https://www.dlearningapp.com/web/DLFautoinseects.htm](https://www.dlearningapp.com/web/DLFautoinseects.htm)), accessed on 24 June 2024; IP102: [[https://github.com/xpwu95/IP102](https://github.com/xpwu95/IP102)]([https://github.com/xpwu95/IP102](https://github.com/xpwu95/IP102)), accessed on 24 June 2024.  
\begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Method** & **Parameters (M)** & **FLOPs (G)** & **Acc (\%)** & **MRec (\%)** & **MF1 (\%)** \\ \hline MobileNetV3 [40] & **5.4** & **0.3** & 63.4 & 58.6 & 59.7 \\ GoogLeNet [41] & 23 & 1.8 & 67.8 & 58.7 & 57.9 \\ ResNet-50 [15] & 25 & 4.1 & 70.9 & 64.3 & 63.5 \\
**Our method** & 49 & 20.3 & **74.1** & **69.9** & 65.9 \\ ViT small [42] & 49 & 9.3 & 65.5 & 57.7 & 61.4 \\ EfficientNet b7 [43] & 66 & 4.9 & 66.3 & 60.4 & 64.2 \\ DenseNet-201 [27] & 69 & 12.2 & 61.9 & 56.4 & 59.2 \\ ConvNeXt base [44] & 89 & 8.2 & 71.4 & 67.5 & 65.8 \\ Swin Transformer base [45] & 88 & 15.7 & 73.2 & 69.1 & **69.9** \\ \hline \hline \end{tabular}
\end{table}
Table 5: The comparative analysis of parameters and performance of various methods on the IP102. Parameters are in million (M) and FLOPs are in gigaflop (G). Note that within our multi-task learning framework, the DAM-Net processes inputs of size 448 \(\times\) 448, while other methods use 224 \(\times\) 224. This results in higher FLOPs for our method due to the increased input dimensions. The bold highlights indicate the best results.  
**Acknowledgments:** We express our gratitude for the constructive guidance and valuable suggestions offered by the review experts and the editor.  
**Conflicts of Interest:** The authors declare no conflicts of interest.