A lightweight method for maize seed defects identification based on Convolutional Block Attention Module

Chao Li, Zhen‐Yu Chen, Weipeng Jing, Xiaoqiang Wu, Yonghui ZhaoFrontiers in Plant Science 2023 · DOI

TL;DR

Researchers have developed a lightweight deep learning model that combines the efficiency of MobileNetv3 with the precision of the Convolutional Block Attention Module (CBAM) to identify maize seed defects. The resulting system achieves a 97.95% accuracy rate across seven defect categories while maintaining a low enough computational footprint for deployment on mobile and edge devices in agricultural settings.

What Problem Does This Paper Address?

Maize is a cornerstone of global food security and animal husbandry. However, the quality of a harvest depends heavily on the integrity of the seeds. Traditionally, identifying defects like mold, pest damage, or sprouting required manual inspection—a process that is slow, subjective, and prone to error.

While deep learning has revolutionized image recognition, most state-of-the-art models (like ResNet or VGG) are "heavyweight," requiring significant computational power and memory. This makes them difficult to use in real-time sorting systems or on handheld devices used by farmers in the field. The authors sought to bridge this gap by creating a model that is both highly accurate and "lightweight" enough for practical, real-world agricultural deployment.

Methods

The authors built their solution using a three-pronged approach:

  1. Base Architecture (MobileNetv3-Large): They chose MobileNetv3 as the backbone because it uses depthwise separable convolutions. Unlike standard convolutions, these split the process into two steps (filtering and combining), which reduces the number of parameters and computational cost by about two-thirds without a significant loss in performance.
  2. Attention Mechanism (CBAM): To improve the model's ability to distinguish between very similar-looking seeds, the researchers integrated the Convolutional Block Attention Module. CBAM tells the network where to look (spatial attention) and what features are important (channel attention). This helps the model focus on subtle textures or discolorations that signal a defect.
  3. Transfer Learning: Rather than training from scratch, the authors used a model pre-trained on the massive ImageNet dataset. They then "fine-tuned" it on their specific maize dataset. This allowed the model to converge much faster and achieve higher accuracy even with a relatively specialized dataset.

Datasets

The study utilized the GrainSpace dataset, a large-scale benchmark for cereal grain recognition.

  • Scope: 12,784 images of maize seeds.
  • Categories: 7 distinct types, including Normal (NOR), Attacked by Pests (AP), Broken (BN), Fusarium (FM), Heated (HD), Mouldy (MY), and Sprouted (SD).
  • Innovation: The authors specifically compared double-sided images (viewing the seed from both sides) against single-sided images to determine if the extra data improved identification.

Key Insights and Ideas

  • The "Double-Sided" Advantage: One of the most practical findings was that using double-sided images improved overall classification accuracy by approximately 15% compared to single-sided views. This suggests that for industrial sorting, a two-camera setup is essential.
  • Attention is All You Need (for Convergence): Integrating CBAM didn't just increase accuracy; it made the model "smarter" faster. The proposed model converged with fewer iterations than standard versions, saving training time and energy.
  • The "Heated" Seed Challenge: The model struggled most with "Heated" (HD) seeds. The authors realized this was due to two factors: HD seeds look remarkably similar to other defects, and the dataset for this specific category was smaller. This highlights that even with advanced attention modules, data balance remains a critical hurdle in agricultural AI.

Key Results

The proposed MobileNetv3-Large + CBAM model outperformed several heavy-duty competitors:

  • Accuracy: Achieved a top-tier 97.95% accuracy.
  • Precision/Recall: Maintained a True Positive Rate (TPR) of 93.14% and a remarkably low False Positive Rate (FPR) of 1.14%.
  • Efficiency: The model clocked a test time of just 35.25 ms per image, significantly faster than ResNet101 (129.45 ms) or VGG16 (195.41 ms).
  • Training Speed: It reached a training speed of 8.23 bit/s, the highest among all tested architectures.

Limitations and Future Work

While the results are promising, the authors noted a few areas for improvement:

  • Multi-Defect Seeds: The current model is designed to pick the most likely defect. In reality, a single seed might be both broken and moldy. Future iterations will need to handle multi-label classification.
  • Category Imbalance: As noted with the "Heated" seeds, more diverse data is needed to help the model distinguish between subtle, overlapping visual features.
  • Expansion: The researchers plan to expand this lightweight approach to other grains, such as rice and wheat, to create a more universal tool for grain quality assurance.

Summary updated

Abstract

Maize is widely cultivated and planted all over the world, which is one of the main food resources. Accurately identifying the defect of maize seeds is of great significance in both food safety and agricultural production. In recent years, methods based on deep learning have performed well in image processing, but their potential in the identification of maize seed defects has not been fully realized. Therefore, in this paper, a lightweight and effective network for maize seed defect identification is proposed. In the proposed network, the Convolutional Block Attention Module (CBAM) was integrated into the pretrained MobileNetv3 network for extracting important features in the channel and spatial domain. In this way, the network can be focused on useful feature information, and making it easier to converge. To verify the effectiveness of the proposed network, a total of 12784 images was collected, and 7 defect types were defined. Compared with other popular pretrained models, the proposed network converges with the least number of iterations and achieves the true positive rate is 93.14% and the false positive rate is 1.14%.
BibTeX
@inproceedings{li2023lightweight,
  author = {Chao Li and Zhen‐Yu Chen and Weipeng Jing and Xiaoqiang Wu and Yonghui Zhao},
  title = {{A lightweight method for maize seed defects identification based on Convolutional Block Attention Module}},
  booktitle = {Frontiers in Plant Science},
  year = {2023},
  doi = {10.3389/fpls.2023.1153226},
}
Figure