Classification of mushrooms based on AWPF-ResNet18

X Xinhai Zhao H Hanchen Lin Y Yongmin Guo N Ning Sun (Frontiers Science Center for Transformative Molecules, School of Chemistry and Chemical Engineering, Zhangjiang Institute for Advanced Study)

Abstract

Edible mushrooms are widely enjoyed around the world for their unique flavor and rich nutrients. However, harvesting them carries the risk of accidentally picking poisonous varieties, leading to poisoning upon consumption. Edible mushrooms require classification during cultivation as well. This study presents AWPF-ResNet18, a ResNet18-based classification model that incorporates an Adaptive Window Pyramid Fusion (AWPF) module. AWPF performs dynamic multi-scale feature fusion and uses a Dynamic Swin Window module (DSW) with variable window sizes to refine downsampled features, thereby mitigating semantic information loss during downsampling. The model adaptively focused on targets of varying sizes within images, and achieved significant performance in the classification tasks with differentiate sizes. Experimental results show that incorporating the AWPF module improves the performance of the model over the original Residual Network 18 (ResNet18), with accuracy (Acc), macro precision (MP), macro F1-score (MF), and macro recall (MR) increasing by 2.5%, 7.5%, 5%, and 2%, respectively. Moreover, compared with current state-of-the-art classification models, the proposed design achieves varying degrees of improvement across relevant performance metrics. Multiple comparative experiments were conducted to validate its effectiveness. In summary, the AWPF-ResNet18 model demonstrates outstanding performance in edible mushroom classification tasks, offering an effective technical approach for the safe identification and categorization of mushrooms, and thus holds significant practical value.

Article Details

Journal PLoS ONE
Volume / Issue Vol. 21, Issue 4
Published April 16, 2026
Pages e0346589
ISSN 1932-6203
Publisher Public Library of Science

Journal Info

PLoS ONE

Public Library of Science

ISSN: 1932-6203 Open Access Health Sciences

Authors (4)

X

Xinhai Zhao

H

Hanchen Lin

Y

Yongmin Guo

N

Ning Sun

Frontiers Science Center for Transformative Molecules, School of Chemistry and Chemical Engineering, Zhangjiang Institute for Advanced Study