LWheatNet: a lightweight convolutional neural network with mixed attention mechanism for wheat seed classification

Front Plant Sci. 2025 Jan 10:15:1509656. doi: 10.3389/fpls.2024.1509656. eCollection 2024.

Abstract

Introduction: With the advent of technologies such as deep learning in agriculture, a novel approach to classifying wheat seed varieties has emerged. However, some existing deep learning models encounter challenges, including long processing times, high computational demands, and low classification accuracy when analyzing wheat seed images, which can hinder their ability to meet real-time requirements.

Methods: To address these challenges, we propose a lightweight wheat seed classification model called LWheatNet. This model integrates a mixed attention module with multiple stacked inverted residual convolutional networks. First, we introduce a mixed attention mechanism that combines channel attention and spatial attention in parallel. This approach enhances the feature representation of wheat seed images. Secondly, we design stacked inverted residual networks to extract features from wheat seed images. Each network consists of three core layers, with each core layer is comprising one downsampling unit and multiple basic units. To minimize model parameters and computational load without sacrificing performance, each unit utilizes depthwise separable convolutions, channel shuffle, and channel split techniques.

Results: To validate the effectiveness of the proposed model, we conducted comparative experiments with five classic network models: AlexNet, VGG16, MobileNet V2, MobileNet V3, and ShuffleNet V2. The results demonstrate that LWheatNet achieves the highest performance, with an accuracy of 98.59% on the test set and a model size of just 1.33 M. This model not only surpasses traditional CNN networks but also offers significant advantages for lightweight networks.

Discussion: The LWheatNet model proposed in this paper maintains high recognition accuracy while occupying minimal storage space. This makes it well-suited for real-time classification and recognition of wheat seed images on low-performance devices in the future.

Keywords: lightweight CNN; machine vision; mixed attention mechanism; wheat seed classification; wheat seed image.

Grants and funding

The author(s) declare financial support was received for the research, authorship, and/or publication of this article. This research was supported by the Key R&D projects in Henan Province, grant number 241111211800, the Key Scientific and Technological Project of Henan Province, grant number 232102111128,232102210079, 222102210098, 222102320181, 212102210431, 212102310087, Ministry of Education Supply and Demand Matching Employment Nurturing Project, grant number 2023122984581,Ministry of Education Industry-University Cooperation Collaborative Education Project,grant number 220503372133344, Humanities and Social Science Fund of Ministry of Education, grant number 22YJCZH091,the Major Special Project of Xinxiang City, grant number 21ZD003, the Key Scientific Research Projects of Colleges and Universities in Henan Province, grant number 23B520003, 21A520001,20A520013, the Henan Province Postdoctoral Support Program, grant number HN2022165.