In response to the current lack of annotations for flower images and insufficient focus on key image features in traditional fine-grained flower image classification based on deep learning, this study proposes the SA-ConvNeXt flower image classification model. Initially, in the image preprocessing stage, a padding algorithm was used to prevent image deformation and loss of detail caused by scaling. Subsequently, the model was integrated using multi-level feature extraction within the Efficient Channel Attention (ECA) mechanism, forming an M-ECA structure to capture channel features at different levels; a pixel attention mechanism was also introduced to filter out irrelevant or noisy information in the images. Following this, a parameter-free attention module (SimAM) was introduced after deep convolution in the ConvNeXt Block to reweight the input features. SANet, which combines M-ECA and pixel attention mechanisms, was employed at the end of the module to further enhance the model’s dynamic extraction capability of channel and pixel features. Considering the model’s generalization capability, transfer learning was utilized to migrate the pretrained weights of ConvNeXt on the ImageNet dataset to the SA-ConvNeXt model. During training, the Focal Loss function and the Adam optimizer were used to address sample imbalance and reduce gradient fluctuations, thereby enhancing training stability. Finally, the Grad-CAM++ technique was used to generate heatmaps of classification predictions, facilitating the visualization of effective features and deepening the understanding of the model’s focus areas. Comparative experiments were conducted on the Oxford Flowers102 flower image dataset. Compared to existing flower image classification technologies, SA-ConvNeXt performed excellently, achieving a high accuracy of 96.7% and a recall rate of 98.2%, with improvements of 4.0% and 3.7%, respectively, compared to the original ConvNeXt. The results demonstrate that SA-ConvNeXt can effectively capture more accurate key features of flower images, providing an effective technical means for flower recognition and classification.
Read full abstract