Lightweight Maize Seed Variety Recognition Model Based on MobileNetV2 and Convolution Attention Mechanism
Rapid and accurate identification of crop variety is of great significance to food security and development of agriculture in China.In order to achieve fast identification and protection of maize seeds,this study proposed a maize seed variety recognition algorithm based on MobileNetV2 and convolution attention mechanism.Firstly,the seeds of nine popular maize varieties were bought from the market,and their images were captured using a Canon 80D camera to create a dataset of 3 408 maize seed images.The dataset was di-vided into training,validation and testing sets at a ratio of 7∶2∶1,and the images in training set were subjec-ted to data augmentation treatment.Then,an attention module called ISPAM(Improved Spatial Attention Module)was designed:based on the convolutional block attention module(CBAM),a new channel attention module ICAM was proposed to improve the channel attention mechanism of CBAM,and the spatial pyramid pooling(SPP)module was introduced to replace the average pooling module and the maximum pooling module in the CBAM spatial attention module.Finally,a maize seed variety recognition model called MobileNetV2_IS-PAM was constructed.Compared with the models incorporating with other attention modules,MobileNetV2_IS-PAM achieved an accuracy of 99.11%on the test set,which was obviously higher than that in MobileNetV2 and the models with SE(Squeeze-and-Excitation)and CBAM attention mechanisms.The visualization of the gradient-weighted class activation mapping network demonstrated that MobileNetV2_ISPAM paid more atten-tion to salient features of maize seed images,thus improved the accuracy.Moreover,the model had a parame-ter size of only 7.15 M,making it suitable for deployment on mobile devices.This study enhanced the ability of model to resist overfitting and improved the classification performance,meanwhile,ensured its lightweight and high efficiency,which provided insights for future researches on deep learning-based maize seed image recog-nition models for mobile platforms.