摘要
This study introduces a lightweight visual segmentation model named TinySegformer, specifically designed for agricultural pest detection, aiming to address edge computing issues in real-world scenarios. The innovation of TinySegformer lies in its effective combination of Transformers and neural networks, enhancing its ability to handle semantic segmentation tasks and significantly improving image segmentation performance. Additionally, through the use of sparse attention mechanisms and quantization techniques, it adopts a lightweight architecture, enabling the model to adapt to the computational and storage limitations of edge devices. This study evaluates TinySegformer on multiple datasets, revealing that whether on public datasets or our self-collected datasets, TinySegformer outperforms current mainstream visual segmentation models such as DeepLab, SegNet, UNet, PSPNet (Pyramid Scene Parsing Network), FCN (Fully Convolutional Networks), etc. In terms of key performance indicators like precision, recall, accuracy, mIoU, Dice coefficient, and FPS, TinySegformer shows outstanding results, reaching 0.92, 0.90, 0.93, 0.85, 0.91, and 65 respectively, and achieves real-time image processing at 32.7 frames per second on edge devices. Furthermore, the study elaborately discusses the process of deploying TinySegformer onto NVIDIA Jetson devices, and successfully adapts the model to resource-constrained devices through network pruning and quantization techniques. In conclusion, with its efficiency, accuracy, and lightweight characteristics, the TinySegformer model provides a robust and practical solution for agricultural pest detection, offering new insights and directions for future research in the field of agricultural pest monitoring.