Skip to main content

Weeds Classification with Deep Learning: An Investigation Using CNN, Vision Transformers, Pyramid Vision Transformers, and Ensemble Strategy

  • Conference paper
  • First Online:
Progress in Pattern Recognition, Image Analysis, Computer Vision, and Applications (CIARP 2023)

Abstract

Weeds are a significant threat to agricultural production. Weed classification systems based on image analysis have offered innovative solutions to agricultural problems, with convolutional neural networks (CNNs) playing a pivotal role in this task. However, CNNs are limited in their ability to capture global relationships in images due to their localized convolutional operation. Vision Transformers (ViT) and Pyramid Vision Transformers (PVT) have emerged as viable solutions to overcome this limitation. Our study aims to determine the effectiveness of CNN, PVT, and ViT in classifying weeds in image datasets. We also examine if combining these methods in an ensemble can enhance classification performance. Our tests were conducted on significant agricultural datasets, including DeepWeeds and CottonWeedID15. The results indicate that a maximum of 3 methods in an ensemble, with only 15 epochs in training, can achieve high accuracy rates of up to 99.17%. This study demonstrates that high accuracies can be achieved with ease of implementation and only a few epochs.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Similar content being viewed by others

Notes

  1. 1.

    https://pytorch.org/vision/main/models/generated/torchvision.models.densenet121

  2. 2.

    https://github.com/whai362/PVT/tree/v2/classification

  3. 3.

    https://github.com/fastai/timmdocs/tree/master/

References

  1. Chen, D., Lu, Y., Li, Z., Young, S.: Performance evaluation of deep transfer learning on multi-class identification of common weed species in cotton production systems. Comput. Electron. Agric. 198, 107091 (2022)

    Article  Google Scholar 

  2. Deng, J., Dong, W., Socher, R., Li, L.J., Li, K., Fei-Fei, L.: ImageNet: a large-scale hierarchical image database. In: 2009 IEEE Conference on Computer Vision and Pattern Recognition, pp. 248–255. IEEE (2009)

    Google Scholar 

  3. Dosovitskiy, A., et al.: An image is worth 16x16 words: transformers for image recognition at scale. arXiv preprint arXiv:2010.11929 (2020)

  4. Hasan, A.M., Sohel, F., Diepeveen, D., Laga, H., Jones, M.G.: A survey of deep learning techniques for weed detection from images. Comput. Electron. Agric. 184, 106067 (2021)

    Article  Google Scholar 

  5. Hu, K., Coleman, G., Zeng, S., Wang, Z., Walsh, M.: Graph weeds net: a graph-based deep learning method for weed recognition. Comput. Electron. Agric. 174, 105520 (2020)

    Article  Google Scholar 

  6. Huang, G., Liu, Z., Van Der Maaten, L., Weinberger, K.Q.: Densely connected convolutional networks. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4700–4708 (2017)

    Google Scholar 

  7. Huertas-Tato, J., Martín, A., Fierrez, J., Camacho, D.: Fusing CNNs and statistical indicators to improve image classification. Inf. Fusion 79, 174–187 (2022)

    Article  Google Scholar 

  8. Mohammed, A., Kora, R.: A comprehensive review on ensemble deep learning: opportunities and challenges. J. King Saud Univ.-Comput. Inf. Sci. 35, 757–774 (2023)

    Google Scholar 

  9. Olsen, A., et al.: DeepWeeds: a multiclass weed species image dataset for deep learning. Sci. Rep. 9(1), 2058 (2019)

    Article  Google Scholar 

  10. Rai, N., et al.: Applications of deep learning in precision weed management: a review. Comput. Electron. Agric. 206, 107698 (2023)

    Article  Google Scholar 

  11. Saleem, M.H., Potgieter, J., Arif, K.M.: Weed detection by faster RCNN model: an enhanced anchor box approach. Agronomy 12(7), 1580 (2022)

    Article  Google Scholar 

  12. Sharma, S., Vardhan, M.: Self-attention vision transformer with transfer learning for efficient crops and weeds classification. In: 2023 6th International Conference on Information Systems and Computer Networks (ISCON), pp. 1–6. IEEE (2023)

    Google Scholar 

  13. Wang, W., et al.: Pyramid vision transformer: a versatile backbone for dense prediction without convolutions. In: Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 568–578 (2021)

    Google Scholar 

  14. Wang, W., et al.: PVT v2: improved baselines with pyramid vision transformer. Comput. Vis. Media 8(3), 415–424 (2022)

    Article  Google Scholar 

Download references

Acknowledgement

This study was carried out within the Agritech National Research Center and received funding from the European Union Next-GenerationEU (PIANO NAZIONALE DI RIPRESA E RESILIENZA (PNRR) - MISSIONE 4 COMPONENTE 2, INVESTIMENTO 1.4-D.D. 1032 17/06/2022, CN00000022). This manuscript reflects only the authors’ views and opinions, neither the European Union nor the European Commission can be considered responsible for them. This work was also partially funded by the Coordenação de Aperfeiçoamento de Pessoal de Nível Superior - Brasil (CAPES) - Finance Code 001, and project NextGenAI - Center for Responsible AI (2022-C05i0102-02), supported by IAPMEI, and also by FCT plurianual funding for 2020-2023 of LIACC (UIDB/00027/2020 UIDP/00027/2020). The authors gratefully acknowledge the financial support of National Council for Scientific and Technological Development - CNPq (Grants 311404/2021-9 and 313643/2021-0).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Guilherme Botazzo Rozendo .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2024 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Rozendo, G.B., Roberto, G.F., do Nascimento, M.Z., Alves Neves, L., Lumini, A. (2024). Weeds Classification with Deep Learning: An Investigation Using CNN, Vision Transformers, Pyramid Vision Transformers, and Ensemble Strategy. In: Vasconcelos, V., Domingues, I., Paredes, S. (eds) Progress in Pattern Recognition, Image Analysis, Computer Vision, and Applications. CIARP 2023. Lecture Notes in Computer Science, vol 14469. Springer, Cham. https://doi.org/10.1007/978-3-031-49018-7_17

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-49018-7_17

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-49017-0

  • Online ISBN: 978-3-031-49018-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics