Classification of Amanita Species Based on Bilinear Networks with Attention Mechanism
Abstract
:1. Introduction
- (1)
- A self-built Amanita dataset that is 3219 Amanita images obtained from the Internet and divided.
- (2)
- The Bilinear convolutional neural networks model was built and fine-tuned to make the model more suitable for the dataset.
- (3)
- The Bilinear convolutional neural networks model is combined with the attention mechanism to improve the model. This method can quickly obtain the most effective information.
2. Materials and Methods
2.1. Image Dataset
2.2. Data Augmentation
2.3. Method
2.3.1. The Efficient Net Model
2.3.2. Bilinear Convolutional Neural Networks
2.3.3. Visual Attention Mechanism
2.3.4. Our Model
- (1)
- Use the EfficientNet-B4 network architecture to extract the feature layer after data expansion of the input image.
- (2)
- Combining the output result of the convolutional layer with CBAM, it will first pass a channel attention module to obtain the weighted result, then pass through a spatial attention module, and finally obtain the extracted result by weighting.
- (3)
- Multiply the extraction results obtained by CBAM with the feature layer one by one.
- (4)
- Join the fully connected layer for classification to obtain the final classification result.
2.4. Parameters and Index
3. Experimental Results and Discussion
3.1. Model Training
- Data loading;
- Image preprocessing;
- Define the model structure and load the pre-training weights;
- Start training;
- Stop training;
3.2. Comparison of Modeling Methods
- (1)
- The EfficientNet-B4 is superior to VGG-16 and Resnet-50 in terms of accuracy, model parameters and model size.
- (2)
- On this basis, the bilinear structure was studied and used, and it was found that B-CNN(VGG-16, ResNet-50) has good accuracy. However, it has the largest number of parameters in the model used, and the size of the model is also very large. However, Bilinear EfficientNet-B4 has a good performance in accuracy, model size and number of parameters.
- (3)
- For EfficientNet-B4 (accuracy rate is 92.76%), after adding the attention mechanism, its accuracy rate is 93.53%, which improves the accuracy rate by 0.77%; after combining the bilinear structure and attention mechanism, its accuracy rate is 95.2%, an increase of 1.77%. In general, adding an attention mechanism to the model will increase the accuracy by about 1% and can reduce the time by 0.5 s.
3.3. Model Test Results
- (1)
- Amanita vaginata and pure white Amanita bisporigera are similar in shape and feature, except for the difference in color on the surface of the fungus cap. The shapes of Amanita vaginata, Amanita bisporigera and Amanita phalloides are very similar in their juvenile period.
- (2)
- Some pictures of Amanita vaginata are overexposed and the pictures are white. At this time, the characteristics are very similar to Amanita bisporigera, so part of Amanita vaginata is classified as Amanita bisporigera.
- (3)
- The base of this category in the test dataset is not large.
4. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Deng, W.; Xiao, Z.; Li, P.; Li, T. The in vitro anti-tumor effect of lethal Amanita peptide toxins. J. Edible Fungi 2012, 19, 71–78. [Google Scholar]
- Bas, C. Morphology and subdivision of Amanita and a monograph of its section Lepidella. Pers. Mol. Phylogeny Evol. Fungi 1969, 5, 285–573. [Google Scholar]
- Michelot, D.; Melendez-Howell, L.M. Amanita muscaria: Chemistry, biology, toxicology, and ethnomycology. Mycol. Res. 2003, 107, 131–146. [Google Scholar] [CrossRef]
- Dong, G.R.; Zhang, Z.G.; Chen, Z.H. Amanita toxic peptides and its theory. J. Biol. 2000, 17, 1–3. [Google Scholar]
- Chilton, W.S.; Ott, J. Toxic metabolites of Amanita pantherina, A. cothurnata, A. muscaria and other Amanita species. Lloydia 1976, 39, 150–157. [Google Scholar] [PubMed]
- Drewnowska, M.; Falandysz, J.; Chudzińska, M.; Hanć, A.; Saba, M.; Barałkiewicz, D. Leaching of arsenic and sixteen metallic elements from Amanita fulva mushrooms after food processing. LWT 2017, 84, 861–866. [Google Scholar] [CrossRef]
- Wu, F.; Zhou, L.-W.; Yang, Z.-L.; Bau, T.; Li, T.-H.; Dai, Y.-C. Resource diversity of Chinese macrofungi: Edible, medicinal and poisonous species. Fungal Divers. 2019, 98, 1–76. [Google Scholar] [CrossRef]
- Wang, Y.; Bao, H.; Xu, L.; Bau, T. Determination of main peptide toxins from Amanita pallidorosea with HPLC and their anti-fungal action on Blastomyces albicans. Acta Microbiol. Sin. 2011, 51, 1205–1211. [Google Scholar]
- Klein, A.S.; Hart, J.; Brems, J.J.; Goldstein, L.; Lewin, K.; Busuttil, R.W. Amanita poisoning: Treatment and the role of liver transplantation. Am. J. Med. 1989, 86, 187–193. [Google Scholar] [CrossRef]
- Faulstich, H. New aspects of Amanita poisoning. J. Mol. Med. 1979, 57, 1143–1152. [Google Scholar] [CrossRef]
- Wieland, T. Peptides of Poisonous Amanita Mushrooms; Springer: Berlin/Heidelberg, Germany, 2012. [Google Scholar]
- Garcia, J.C.; Costa, V.M.; Carvalho, A.; Baptista, P.; De Pinho, P.G.; Bastos, M.D.L.; Carvalho, F. Amanita phalloides poisoning: Mechanisms of toxicity and treatment. Food Chem. Toxicol. 2015, 86, 41–55. [Google Scholar] [CrossRef] [Green Version]
- Aji, D.Y.; Çalişkan, S.; Nayir, A.; Mat, A.; Can, B.; Yaşar, Z.; Ozşahin, H.; Cullu, F.; Sever, L. Haemoperfusion in Amanita phalloides poisoning. J. Trop. Pediatrics 1995, 41, 371–374. [Google Scholar] [CrossRef]
- Wang, Y. The Taxonomy of Amanita from Jilin and Shandong Provinces and Detection of Peptide Toxins. Jilin Agricultural University. 2011. Available online: https://kns.cnki.net/kcms/detail/detail.aspx?FileName=1011150549.nh&DbName=CMFD2011 (accessed on 24 September 2020).
- Wu, F. Research on the identification and prevention of poisoning mushroom poisoning. Sci. Technol. Innov. 2018, 107, 61–62. [Google Scholar]
- Ismail, S.; Zainal, A.R.; Mustapha, A. Behavioural features for mushroom classification. In Proceedings of the 2018 IEEE Symposium on Computer Applications & Industrial Electronics (ISCAIE), Penang, Malaysia, 28–29 April 2018; pp. 412–415. [Google Scholar]
- Maurya, P.; Singh, N.P. Mushroom Classification Using Feature-Based Machine Learning Approach. In Proceedings of the 3rd International Conference on Computer Vision and Image Processing, Jaipur, India, 27–29 September 2019; pp. 197–206. [Google Scholar]
- Xiao, J.; Zhao, C.; Li, X. Research on mushroom image classification based on deep learning. Softw. Eng. 2020, 23, 21–26. [Google Scholar]
- Chen, Q. Design of Mushroom Recognition APP Based on Deep Learning under Android Platform; South-Central University for Nationalities: Wuhan, China, 2019; Available online: https://kns.cnki.net/kcms/detail/detail.aspx?FileName=1019857927.nh&DbName=CMFD2020 (accessed on 24 September 2020).
- Preechasuk, J.; Chaowalit, O.; Pensiri, F.; Visutsak, P. Image Analysis of Mushroom Types Classification by Convolution Neural Net-works. In Proceedings of the 2019 2nd Artificial Intelligence and Cloud Computing Conference, New York, NY, USA, 21–23 December 2019; pp. 82–88. [Google Scholar]
- Dong, J.; Zheng, L. Quality classification of Enoki mushroom caps based on CNN. In Proceedings of the 2019 IEEE 4th International Conference on Image, Vision and Computing (ICIVC), Xiamen, China, 5–7 July 2019; pp. 450–454. [Google Scholar]
- Chikkerur, S.; Serre, T.; Tan, C.; Poggio, T. What and where: A Bayesian inference theory of attention. Vis. Res. 2010, 50, 2233–2247. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Xu, H.; Saenko, K. Ask, Attend and Answer: Exploring Question-Guided Spatial Attention for Visual Question Answering. In Proceedings of the European Conference on Computer Vision, Amsterdam, The Netherlands, 8–16 October 2016. [Google Scholar]
- Yang, X. An Overview of the Attention Mechanisms in Computer Vision. J. Phys. Conf. Ser. 2020, 1693, 012173. [Google Scholar] [CrossRef]
- Jaderberg, M.; Simonyan, K.; Zisserman, A.; Kavukcuoglu, K. Spatial transformer networks. arXiv 2015, arXiv:1506.02025. [Google Scholar]
- Sønderby, S.K.; Sønderby, C.K.; Maaløe, L.; Winther, O. Recurrent spatial transformer networks. arXiv 2015, arXiv:1509.05329. [Google Scholar]
- Humphreys, G.W.; Sui, J. Attentional control and the self: The Self-Attention Network (SAN). Cogn. Neurosci. 2016, 7, 5–17. [Google Scholar] [CrossRef]
- Shen, T.; Zhou, T.; Long, G.; Jiang, J.; Wang, S.; Zhang, C. Reinforced Self-Attention Network: A Hybrid of Hard and Soft Attention for Sequence Modeling. In Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence, Stockholm, Sweden, 13–19 July 2018; pp. 4345–4352. [Google Scholar]
- Yang, Z.L. Flora Fungorum Sinicorun—Amanitaceae; Science Press: Beijing, China, 2005; Volume 27, pp. 1–257. (In Chinese) [Google Scholar]
- Chollet, F. Building Powerful Image Classification Models Using Very Little Data. Keras Blog. 2016. Available online: https://blog.keras.io/building-powerful-image-classification-models-using-very-little-data.html (accessed on 24 September 2020).
- Kawakura, S.; Shibasaki, R. Distinction of Edible and Inedible Harvests Using a Fine-Tuning-Based Deep Learning System. J. Adv. Agric. Technol. 2019, 6, 236–240. [Google Scholar] [CrossRef]
- Tan, M.; Le, Q.V. Efficientnet: Rethinking model scaling for convolutional neural networks. arXiv 2019, arXiv:1905.11946. [Google Scholar]
- Duong, L.T.; Nguyen, P.; Di Sipio, C.; Di Ruscio, D. Automated fruit recognition using EfficientNet and MixNet. Comput. Electron. Agric. 2020, 171, 105326. [Google Scholar] [CrossRef]
- Zhang, P.; Yang, L.; Li, D. EfficientNet-B4-Ranger: A novel method for greenhouse cucumber disease recognition under natural complex environment. Comput. Electron. Agric. 2020, 176, 105652. [Google Scholar] [CrossRef]
- Lin, T.Y.; Roy, C.A.; Maji, S. Bilinear CNN models for fine-grained visual recognition. In Proceedings of the IEEE interna-Tional Conference on Computer Vision, Santiago, Chile, 7–13 December 2015; pp. 1449–1457. [Google Scholar]
- Chowdhury, A.R.; Lin, T.Y.; Maji, S.; Learned-Miller, E. One-to-many face recognition with bilinear CNNs. In Proceedings of the 2016 IEEE Winter Conference on Applications of Computer Vision (WACV), Lake Placid, NY, USA, 7–10 March 2016; pp. 1–9. [Google Scholar]
- Zhu, Y.; Sun, W.; Cao, X.; Wang, C.; Wu, D.; Yang, Y.; Ye, N. TA-CNN: Two-way attention models in deep convolutional neural network for plant recognition. Neurocomputing 2019, 365, 191–200. [Google Scholar] [CrossRef]
- Woo, S.; Park, J.; Lee, J.-Y.; Kweon, I.S. CBAM: Convolutional Block Attention Module. In Proceedings of the European Conference on Computer Vision (ECCV), Munich, Germany, 8–14 September 2018; pp. 3–19. [Google Scholar]
- Lee, H.; Park, J.; Hwang, J.Y. Channel Attention Module with Multi-scale Grid Average Pooling for Breast Cancer Segmentation in an Ultrasound Image. IEEE Trans. Ultrason. Ferroelectr. Freq. Control. 2020, 67, 1344–1353. [Google Scholar] [CrossRef] [PubMed]
- Fu, X.; Bi, L.; Kumar, A.; Fulham, M.; Kim, J. Multimodal Spatial Attention Module for Targeting Multimodal PET-CT Lung Tumor Segmentation. IEEE J. Biomed. Health Inf. 2021. [Google Scholar] [CrossRef]
- Zhang, J.; Karimireddy, S.P.; Veit, A.; Kim, S.; Reddi, S.J.; Kumar, S.; Sra, S. Why ADAM beats SGD for attention models. arXiv 2019, arXiv:1912.03194. [Google Scholar]
- Kingma, D.P.; Ba, J. Adam: A method for stochastic optimization. In Proceedings of the International Conference Learn, Represent (ICLR), San Diego, CA, USA, 5–8 May 2015. [Google Scholar]
- Sun, J.; He, X.; Ge, X.; Wu, X.; Shen, J.; Song, Y. Detection of Key Organs in Tomato Based on Deep Migration Learning in a Complex Background. Agriculture 2018, 8, 196. [Google Scholar] [CrossRef] [Green Version]
- Hong, S.J.; Kim, S.Y.; Kim, E.; Lee, C.-H.; Lee, J.-S.; Lee, D.-S.; Bang, J.; Kim, G. Moth detection from pheromone trap images using deep learning object detectors. Agriculture 2020, 10, 170. [Google Scholar] [CrossRef]
- Pan, S.J.; Yang, Q. A Survey on Transfer Learning. IEEE Trans. Knowl. Data Eng. 2009, 22, 1345–1359. [Google Scholar] [CrossRef]
- Wang, L.; Wang, P.; Wu, L.; Xu, L.; Huang, P.; Kang, Z. Computer Vision Based Automatic Recognition of Pointer Instruments: Data Set Optimization and Reading. Entropy 2021, 23, 272. [Google Scholar] [CrossRef] [PubMed]
- He, K.; Zhang, X.; Ren, S.; Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, HI, USA, 21–26 July 2017; pp. 770–778. [Google Scholar]
Varieties | Amanitabisporigera | Amanitavaginata | Amanita caesarea | Amanita echinocephala | Amanita muscaria | Amanita phalloides | Amanita pantherina |
---|---|---|---|---|---|---|---|
Sample | |||||||
Quantity (pieces) | 725 | 303 | 289 | 463 | 731 | 400 | 299 |
Item | Optimization Method | Initial Learning Rate | Loss | Batch Size | Training Epochs | Metrics |
---|---|---|---|---|---|---|
Value | Adam | 0.0001 | Categorical-Crossentropy | 32 | 20 | Accuracy |
Model | Classification Layer | Number of Parameters, M | Size, MB | |
---|---|---|---|---|
Total | Trainable | |||
VGG-16 | 2 *(Fc 2048) | 70.3 | 68.6 | 268 |
ResNet-50 | Fc 2048 | 229.1 | 228.9 | 874 |
ENB4 * | Fc 2048 | 21.4 | 21.1 | 82 |
VGG-16 + VGG-16 | Fc 1024 | 283.2 | 275.6 | 1080 |
VGG-16 + ResNet-50 | Fc 1024 | 305.7 | 277.8 | 1167 |
ENB4 + ENB4 | Fc 1024 | 19.6 | 19.4 | 130 |
ENB4 + CBAM | Fc 1024 | 19.6 | 19.4 | 75 |
ENB4 + ENB4 + CBAM | Fc 1024 | 19.7 | 19.4 | 130 |
Model | Accuracy (%) | Precision (%) | Recall (%) | Time, s/Frame | ||
---|---|---|---|---|---|---|
Train | Test | |||||
VGG-16 | 93.89 | 89.66 | 90.03 | 88.01 | 89.01 | 2.41 |
ResNet-50 | 94.19 | 89.98 | 90.1 | 90.24 | 90.17 | 2.63 |
ENB4 * | 95.7 | 92.76 | 92.01 | 92.13 | 92.07 | 5.06 |
VGG-16 + VGG-16 | 94.77 | 92.94 | 91.09 | 91.76 | 91.42 | 6.89 |
VGG-16 + ResNet-50 | 96.94 | 93.27 | 92.19 | 93.6 | 92.89 | 7.21 |
ENB4 + ENB4 | 97.57 | 94.35 | 93.61 | 93.9 | 93.76 | 5.14 |
ENB4 + CBAM | 97.13 | 93.53 | 92.83 | 93.67 | 93.25 | 4.47 |
ENB4 + ENB4 + CBAM | 99.4 | 95.2 | 94.5 | 94.6 | 94.6 | 4.56 |
Varieties | |||||||
---|---|---|---|---|---|---|---|
Result | A.bisporigera | A.caesarea | A.vaginata | A.muscaria | A.echinocephala | A.bisporigera | A.muscaria |
Probability | 0.53 | 0.513 | 0.466 | 0.42 | 0.469 | 0.457 | 0.395 |
Varieties | |||||||
---|---|---|---|---|---|---|---|
Result | A. pantherina | A.vaginata | A. vaginata | A. bisporigera | A.bisporigera | A.phalloides | A.caesarea |
Probability | 0.826 | 0.812 | 0.786 | 0.702089 | 0.417 | 0.663 | 0.857 |
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Wang, P.; Liu, J.; Xu, L.; Huang, P.; Luo, X.; Hu, Y.; Kang, Z. Classification of Amanita Species Based on Bilinear Networks with Attention Mechanism. Agriculture 2021, 11, 393. https://doi.org/10.3390/agriculture11050393
Wang P, Liu J, Xu L, Huang P, Luo X, Hu Y, Kang Z. Classification of Amanita Species Based on Bilinear Networks with Attention Mechanism. Agriculture. 2021; 11(5):393. https://doi.org/10.3390/agriculture11050393
Chicago/Turabian StyleWang, Peng, Jiang Liu, Lijia Xu, Peng Huang, Xiong Luo, Yan Hu, and Zhiliang Kang. 2021. "Classification of Amanita Species Based on Bilinear Networks with Attention Mechanism" Agriculture 11, no. 5: 393. https://doi.org/10.3390/agriculture11050393
APA StyleWang, P., Liu, J., Xu, L., Huang, P., Luo, X., Hu, Y., & Kang, Z. (2021). Classification of Amanita Species Based on Bilinear Networks with Attention Mechanism. Agriculture, 11(5), 393. https://doi.org/10.3390/agriculture11050393