Lightweight CNN–Transformer Hybrid Network with Contrastive Learning for Few-Shot Noxious Weed Recognition
In resource-constrained edge agricultural environments, the accurate recognition of toxic weeds poses dual challenges related to model lightweight design and the few-shot generalization capability. To address these challenges, a multi-strategy recognition framework is proposed, which integrates a lightweight backbone network, a pseudo-labeling guidance mechanism, and a contrastive boundary enhancement module. This approach is designed to improve deployment efficiency on low-power devices while ensuring high accuracy in identifying rare toxic weed categories. The proposed model achieves a real-time inference speed of 18.9 FPS on the Jetson Nano platform, with a compact model size of 18.6 MB and power consumption maintained below 5.1 W, demonstrating its efficiency for edge deployment. In standard classification tasks, the model attains 89.64%, 87.91%, 88.76%, and 88.43% in terms of precision, recall, F1-score, and accuracy, respectively, outperforming existing mainstream lightweight models such as ResNet18, MobileNetV2, and MobileViT across all evaluation metrics. In few-shot classification tasks targeting rare toxic weed species, the complete model achieves an accuracy of 80.32%, marking an average improvement of over 13 percentage points compared to ablation variants that exclude pseudo-labeling and self-supervised modules or adopt a CNN-only architecture. The experimental results indicate that the proposed model not only delivers strong overall classification performance but also exhibits superior adaptability for deployment and robustness in low-data regimes, offering an effective solution for the precise identification and ecological control of toxic weeds within intelligent agricultural perception systems.
Authors
- Yihan Qin
- Ruiheng Li (ORCID: https://orcid.org/0000-0002-8528-3809)
- Shuo Yan (ORCID: https://orcid.org/0000-0001-9685-9810)
- Hongtao Ma
- Boming Zhang (ORCID: https://orcid.org/0000-0003-4430-3997)
- Xinyang Lv
- Boda Yu
Institutions
- Peking University (CN)
- China Agricultural University (CN)
Publication Details
- Journal
- Horticulturae
- Published
- 2025-10-13
- DOI
- https://doi.org/10.3390/horticulturae11101236
- Citations
- 2
- Primary Topic
- Smart Agriculture and AI
- Type
- article
- Field-Weighted Citation Impact
- 3.50
Funders
- National Natural Science Foundation of China
- China Agricultural University
- National Key Research and Development Program of China