Classification of mushrooms based on AWPF-ResNet18 - Xinhai Zhao; Hanchen Lin; Yongmin Guo; Ning Sun (PLoS ONE, 2026)
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.