Log in

Sunflower seeds classification based on self-attention Focusing algorithm

  • Original Paper
  • Published:
Journal of Food Measurement and Characterization Aims and scope Submit manuscript

Abstract

In order to effectively achieve the quality classification of sunflower seeds based on appearance identification in production scenarios, a multi-objective sunflower seed classification method based on a self-attention mechanism was proposed in this paper, which achieves the classification of sunflower seed object images with an accuracy of 94.71% by using a Multi-Head Self-attention mechanism to focus on the classification objects on the basis of effectively extracting context-dependent information from sunflower seed images. However, visualization experiments found that the model’s attention could not effectively focus on the class activated regions of the image, resulting in a model that was heavily influenced by background noise and suffered from such defects as high computational cost and large model size. To address the above problems, a self-attention Focusing algorithm was proposed in this paper by evaluating and reconstructing the connections in the attention weight matrix, pruning the less influential connections, and realizing the update of the attention score, which gradually focuses attention on the class activated regions in continuous iterations, effectively shielding the background noise. Experiments have shown that applying the Focusing algorithm improves the accuracy rate to 96.6% based on a 34.3% reduction in the number of model parameters. Model accuracy was successfully improved while achieving model lightweighting, and the model was made more resistant to background noise due to the focused attention region. The self-attention Focusing algorithm’s effectiveness in improving accuracy, focusing attention, and compressing model size is demonstrated. In practical production scenarios, it can be used as a popular application of key techniques for sunflower seed classification.

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

Access this article

Subscribe and save

Springer+ Basic
EUR 32.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

Price includes VAT (Brazil)

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10

Similar content being viewed by others

Abbreviations

SVM:

Support vector machines

KNN:

K-nearest-neighbors

ROSS:

Region-oriented seed segmentation

CNN:

Convolutional neural network

RNN:

Recurrent neural network

IMP:

Iterative magnitude pruning

MSA:

Multi-head self-attention block

MLP:

Multilayer perception block

LN:

Layer normalization

References

  1. S Guo, S Li, R Sun, et al. Analysis of the overall situation of sunflower industry development in the world and China[J]. (07), 10–13(2021)

  2. D Zhang, M Liu, H **e. Principle of agricultural products electronic color sorter and the domestic and foreign current situation and development[J]. 20(03), 233–237 (2020)

  3. T. Yuan, Y. Zhang, J. Cao et al., Process conditions of electro-optical sorter for peanut kernel[J]. China Oils Fats 044(002), 5–13 (2019)

    Google Scholar 

  4. M. Koklu, S. Sarigil, O. Ozbek, The use of machine learning methods in classification of pumpkin seeds (Cucurbita pepo L.)[J]. Genetic Resour Crop Evolution 68(7), 2713–2726 (2021)

    Article  Google Scholar 

  5. G.S. Larios, G. Nicolodelli, G.S. Senesi et al., Laser-induced breakdown spectroscopy as a powerful tool for distinguishing high- and low-vigor soybean seed lots[J]. Food Anal. Methods 13(9), 1691–1698 (2020)

    Article  Google Scholar 

  6. L Wan, A Ye. Classification of Adhesive Seeds Based on NMF and SVM[J]. 019(002), 153–156 (2020)

  7. J. Zhang, L. Dai, F. Cheng, Classification of frozen corn seeds using hyperspectral VIS/NIR reflectence imaging[J]. Molecules 24(1), 149 (2019)

    Article  CAS  Google Scholar 

  8. D Huang, J Li, J You, et al. Classification and Detection of Lint Cotton Varieties based on Hyperspectral Technology and Image Information Fusion[J]. v.38(07), 241–246 (2018)

  9. G. JayaBrindha, E.S.G. Subbu, Ant colony technique for optimizing the order of cascaded SVM classifier for sunflower seed classification[J]. IEEE Trans. Emerg. Topics Comput. Intell. 2(1), 78–88 (2017)

    Article  Google Scholar 

  10. R.A.R. Bantan, A. Ali, F. Jamal et al., Discrimination of sunflower seeds using multispectral and texture dataset in combination with region selection and supervised classification methods[J]. Chaos 30(11), 113–142 (2020)

    Article  Google Scholar 

  11. H Zhu, J Hou, E Yao. Classification of Castor Seed Damage Based on Convolutional Neural Network[J]. v.51(S1), 447–456 (2020)

  12. W Yang, Y Huai, F Zhang. Grape Seed Classification Based on Gabor and Deep Neural Network[J]. 49(1), 8 (2020)

  13. J He, Y Shi, B Liu, et al. External Quality Grading Method of Fuji Apple Based on Deep Learning[J]. 1–12.

  14. F. Kurtulmuş, Identification of sunflower seeds with deep convolutional neural networks[J]. J. Food Meas. Charact. 15(2), 1024–1033 (2021)

    Article  Google Scholar 

  15. A. Krizhevsky, I. Sutskever, G.E. Hinton, Imagenet classification with deep convolutional neural networks[J]. Adv. Neural. Inf. Process. Syst. 25, 1097–1105 (2012)

    Google Scholar 

  16. Szegedy C, Liu W, Jia Y, et al. Going deeper with convolutions[C]//Proceedings of the IEEE conference on computer vision and pattern recognition. 1–9, (2015)

  17. He K, Zhang X, Ren S, et al. Deep residual learning for image recognition[C]//Proceedings of the IEEE conference on computer vision and pattern recognition. 770–778 (2016)

  18. Vaswani A, Shazeer N, Parmar N, et al. Attention is all you need[J]. Advances in neural information processing systems. 30 (2017)

  19. Dosovitskiy A, Beyer L, Kolesnikov A, et al. An image is worth 16x16 words: Transformers for image recognition at scale[J]. ar**v preprint ar**v:2010.11929, (2020).

  20. M. Raghu, T. Unterthiner, S. Kornblith et al., Do vision transformers see like convolutional neural networks?[J]. Adv. Neural Inf. Proc. Syst. 34, 12116–12128 (2021)

    Google Scholar 

  21. Y. Bazi, L. Bashmal, M.M.A. Rahhal et al., Vision transformers for remote sensing image classification[J]. Remote Sensing 13(3), 516 (2021)

    Article  Google Scholar 

  22. Abnar S, Zuidema W. Quantifying attention flow in transformers[J]. ar**v preprint ar**v:2005.00928, (2020).

  23. Gildenblat J. Exploring Explainability for Vision Transformers[Z]. 2022: 2022.

  24. Frankle J, Carbin M. The Lottery Ticket Hypothesis: Finding Sparse, Trainable Neural Networks[J]. ar**v preprint ar**v:1803.03635, (2018).

  25. Y Liu, H Bian, Y He, et al. Multi-objective Cows Feeding Behavior Detection Method Based on Iterative Magnitude Pruning[J]. 53(2), 8 (2022)

  26. National Standardization Technical Committee Agri. Sunflower seed. GB/T 11764–2008[S]. Bei**g. Standardization Administration of China. (2008)

Download references

Acknowledgements

Many thanks to Haodong Bian, a PhD student at School of Computer Science and Engineering, Northeastern University, for his outstanding contribution to this paper, and to my family, for the support and love they have provided give me the motivation to complete this paper.

Funding

This work was supported by the National Natural Science Foundation of China (NSFC) under Grant (No. 62066036).

Author information

Authors and Affiliations

Authors

Contributions

Conceptualization, YZ., XJ. and HB.; methodology, XJ. and HB.; validation, XJ. and HB.; formal analysis, XJ. and HB.; investigation, XJ., HB. and CX.; resources, XJ. and HB.; data curation, XJ. and HB.; writing-original draft preparation, XJ. and HB.; supervision, YZ.; project administration, YZ., XJ. and HB.; funding acquisition, YZ. and JL; software, HB.; visualization, XJ. and HB.

Corresponding author

Correspondence to Yuhong Zhao.

Ethics declarations

Conflict of interest

We declare that this paper has no conflicts of interest. Furthermore, we do not have any commercial or associative interest that represents a conflict of interest in connection with the work submitted.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Springer Nature or its licensor holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

**, X., Zhao, Y., Bian, H. et al. Sunflower seeds classification based on self-attention Focusing algorithm. Food Measure 17, 143–154 (2023). https://doi.org/10.1007/s11694-022-01612-x

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11694-022-01612-x

Keywords

Navigation