Soybean Seed Classification and Identification Based on Corner Point Multi-Feature Segmentation and Improved MobileViT
Abstract
1. Introduction
2. Materials and Methods
2.1. Image Acquisition Platform
2.2. Image Acquisition and Preprocessing
2.2.1. Image Acquisition
2.2.2. Image Preprocessing
2.3. Soybean Seed Segmentation Algorithm Based on Multiple Corner Features
2.3.1. ORB Corner Detection Algorithm
2.3.2. Soybean Seed Segmentation Algorithm Based on LightGBM
2.4. Partitioning Algorithm Verification
2.5. Soybean Seed Dataset
3. Design of a Soybean Seed Detection Model Based on MobileViT
3.1. MobileViT-L Module
3.1.1. Using Depthwise Separable Convolution Modules to Reduce Model Parameter Count
3.1.2. Simplifying Global Association Modeling Using Dimension Reconstruction
3.1.3. Enhancing the Extraction of Local and Global Features Through Dynamic Channel Recalibration
3.2. MV2-CBAM Module
3.3. Evaluation Indicators
3.4. Design Principles and Theoretical Basis
3.4.1. Challenges in Model Design
3.4.2. Module Collaboration Mechanism
4. Results and Analysis
4.1. Experimental Setup
4.2. Selection of Concavity Detection Classifiers
4.3. Uncertainty Analysis of Reflected Light
4.4. MobileViT-SD Model Detection Results and Analysis
4.5. The Impact of Attention Mechanisms on Model Performance
4.5.1. Impact of CBAM Module Embedding at MV2 Position on Model Performance
4.5.2. The Impact of Different Attention Modules Embedded in MV2 on Model Performance
4.5.3. Comparison of DCR Modules and Channel Attention Mechanisms
4.6. Error Analysis
4.7. Ablation Experiment
4.8. Comparative Analysis with Existing Classical Models
5. Conclusions
- (1)
- The proposed adhesion segmentation algorithm based on multiple corner features can rapidly and accurately segment adhered soybean.
- (2)
- The optimization and improvement methods adopted, including replacing ordinary convolutions with separable convolutions, introducing dimension reconstruction and dynamic channel recalibration modules, and integrating the CBAM attention mechanism to the MV2 module, can all effectively enhance the performance of the MobileViT model.
- (3)
- The proposed MobileViT-SD model, built upon the MobileViT architecture, achieves high-precision soybean quality detection. Its detection accuracy and efficiency surpass those of typical lightweight models and several mainstream heavyweight models currently in use.
- (4)
- The MobileViT-SD model features a highly optimized lightweight architecture, efficient inference capability, and low resource consumption, making it well suited for deployment on edge computing devices and other resource-constrained platforms.
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Sui, Y.; Zhao, X.; Ding, J.; Sun, S.; Tong, Y.; Ma, W.; Zhao, Y. A Nondestructive and Rapid Method for in Situ Measurement of Crude Fat Content in Soybean Grains. Food Chem. 2025, 491, 144862. [Google Scholar] [CrossRef] [PubMed]
- Sreechithra, T.V.; Sakhare, S.D. Impact of Processing Techniques on the Nutritional Quality, Antinutrients, and in Vitro Protein Digestibility of Milled Soybean Fractions. Food Chem. 2025, 485, 144565. [Google Scholar] [CrossRef]
- Montanha, G.S.; Perez, L.C.; Brandão, J.R.; De Camargo, R.F.; Tavares, T.R.; De Almeida, E.; Pereira De Carvalho, H.W. Profile of Mineral Nutrients and Proteins in Soybean Seeds (Glycine Max (L.) Merrill): Insights from 95 Varieties Cultivated in Brazil. J. Food Compos. Anal. 2024, 134, 106536. [Google Scholar] [CrossRef]
- Xu, L.; Xie, G.; Zhou, X.; Liu, Y.; Fang, Z. Catalytic Pyrolysis of Soybean Oil with CaO/Bio-Char Based Catalyst to Produce High Quality Biofuel. J. Renew. Mater. 2022, 10, 3107–3118. [Google Scholar] [CrossRef]
- Madayag, J.V.M.; Domalanta, M.R.B.; Maalihan, R.D.; Caldona, E.B. Valorization of Extractible Soybean By-Products for Polymer Composite and Industrial Applications. J. Environ. Chem. Eng. 2025, 13, 115703. [Google Scholar] [CrossRef]
- Nguyen, K.Q.; Hussain, A.S.; Araujo, A.N.; Strebel, L.M.; Corby, T.L.; Rhodes, M.A.; Bruce, T.J.; Cuéllar-Anjel, J.; Davis, D.A. Effects of Different Soybean Protein Sources on Growth Performance, Feed Utilization Efficiency, Intestinal Histology, and Physiological Gene Expression of Pacific White Shrimp (Litopenaeus vannamei) in Green Water and Indoor Biofloc System. Aquaculture 2025, 611, 743021. [Google Scholar] [CrossRef]
- Cai, L.; Gong, X.; Ding, H.; Li, S.; Hao, D.; Yu, K.; Ma, Q.; Sun, X.; Muneer, M.A. Vermicomposting with Food Processing Waste Mixtures of Soybean Meal and Sugarcane Bagasse. Environ. Technol. Innov. 2022, 28, 102699. [Google Scholar] [CrossRef]
- Zheng, Y.; Ma, X.; Li, L.; Yang, L.; Yu, H.; Zhao, Y.; Liu, H. Purine Content of Different Soybean Products and Dynamic Transfer in Food Processing Techniques. Food Chem. 2025, 28, 102499. [Google Scholar] [CrossRef]
- Hammond, B.G.; Jez, J.M. Impact of Food Processing on the Safety Assessment for Proteins Introduced into Biotechnology-Derived Soybean and Corn Crops. Food Chem. Toxicol. 2011, 49, 711–721. [Google Scholar] [CrossRef] [PubMed]
- Zhang, D.; Sun, X.; Hu, B.; Li, W.-X.; Ning, H. QTN Mapping, Gene Prediction and Molecular Design Breeding of Seed Protein Content in Soybean. Crop J. 2025, 13, 1116–1126. [Google Scholar] [CrossRef]
- Duan, Z.; Xu, L.; Zhou, G.; Zhu, Z.; Wang, X.; Shen, Y.; Ma, X.; Tian, Z.; Fang, C. Unlocking Soybean Potential: Genetic Resources and Omics for Breeding. J. Genet. Genom. 2025; in press. [Google Scholar] [CrossRef] [PubMed]
- Kovalskyi, S.; Koval, V. Comparison of Image Processing Techniques for Defect Detection. In Proceedings of the 2014 International Conference on Electronics and Communication Systems (ICECS), Coimbatore, India, 13–14 February 2014; pp. 158–167. [Google Scholar]
- Dang, C.; Wang, Z.; He, Y.; Wang, L.; Cai, Y.; Shi, H.; Jiang, J. The Accelerated Inference of a Novel Optimized YOLOv5-LITE on Low-Power Devices for Railway Track Damage Detection. IEEE Access 2023, 11, 134846–134865. [Google Scholar] [CrossRef]
- Subramanian, M.; Lingamuthu, V.; Venkatesan, C.; Perumal, S. Content-Based Image Retrieval Using Colour, Gray, Advanced Texture, Shape Features, and Random Forest Classifier with Optimized Particle Swarm Optimization. Int. J. Biomed. Imaging 2022, 2022, 3211793. [Google Scholar] [CrossRef]
- Liu, D.; Ning, X.; Li, Z.; Yang, D.; Li, H.; Gao, L. Discriminating and Elimination of Damaged Soybean Seeds Based on Image Characteristics. J. Stored Prod. Res. 2015, 60, 67–74. [Google Scholar] [CrossRef]
- de Medeiros, A.D.; Capobiango, N.P.; da Silva, J.M.; da Silva, L.J.; da Silva, C.B.; dos Santos Dias, D.C.F. Interactive Machine Learning for Soybean Seed and Seedling Quality Classification. Sci. Rep. 2020, 10, 11267. [Google Scholar] [CrossRef]
- Wei, Y.; Li, X.; Pan, X.; Li, L. Nondestructive Classification of Soybean Seed Varieties by Hyperspectral Imaging and Ensemble Machine Learning Algorithms. Sensors 2020, 20, 6980. [Google Scholar] [CrossRef]
- Waqas, M.; Naseem, A.; Humphries, U.W.; Hlaing, P.T.; Dechpichai, P.; Wangwongchai, A. Applications of Machine Learning and Deep Learning in Agriculture: A Comprehensive Review. Green Technol. Sustain. 2025, 3, 100199. [Google Scholar] [CrossRef]
- Huang, Z.; Wang, R.; Cao, Y.; Zheng, S.; Teng, Y.; Wang, F.; Wang, L.; Du, J. Deep Learning Based Soybean Seed Classification. Comput. Electron. Agric. 2022, 202, 107393. [Google Scholar] [CrossRef]
- Kaler, N.; Bhatia, V.; Mishra, A.K. Deep Learning-Based Robust Analysis of Laser Bio-Speckle Data for Detection of Fungal-Infected Soybean Seeds. IEEE Access 2023, 11, 89331–89348. [Google Scholar] [CrossRef]
- Sable, A.; Singh, P.; Kaur, A.; Driss, M.; Boulila, W. Quantifying Soybean Defects: A Computational Approach to Seed Classification Using Deep Learning Techniques. Agronomy 2024, 14, 1098. [Google Scholar] [CrossRef]
- Zhao, G.; Quan, L.; Li, H.; Feng, H.; Li, S.; Zhang, S.; Liu, R. Real-Time Recognition System of Soybean Seed Full-Surface Defects Based on Deep Learning. Comput. Electron. Agric. 2021, 187, 106230. [Google Scholar] [CrossRef]
- Chen, S.; Zhu, H.; Wang, J.; Yu, T.; Wang, Z.; Liu, C. Abnormal Soybean Grains Recognition Based on Opt-MobileNetV3. Trans. Chin. Soc. Agric. Mach. 2023, 54, 359–365. [Google Scholar]
- Mehta, S.; Rastegari, M. MobileViT: Light-Weight, General-Purpose, and Mobile-Friendly Vision Transformer. arXiv 2022, arXiv:2110.02178. [Google Scholar] [CrossRef]
- Jiang, P.; Xu, Y.; Wang, C.; Zhang, W.; Lu, N. CSMViT: A Lightweight Transformer and CNN Fusion Network for Lymph Node Pathological Images Diagnosis. IEEE Access 2024, 12, 155365–155378. [Google Scholar] [CrossRef]
- Zhang, M.; Lin, Z.; Tang, S.; Lin, C.; Zhang, L.; Dong, W.; Zhong, N. Dual-Attention-Enhanced MobileViT Network: A Lightweight Model for Rice Disease Identification in Field-Captured Images. Agriculture 2025, 15, 571. [Google Scholar] [CrossRef]
- Wang, Y.; Zhang, W.; Chen, D.; Zhang, G.; Gong, T.; Liang, Z.; Yin, A.; Zhang, Y.; Ding, W. Defects Detection in Metallic Additive Manufactured Structures Utilizing Multi-Modal Laser Ultrasonic Imaging Integrated with an Improved MobileViT Network. Opt. Laser Technol. 2025, 187, 112802. [Google Scholar] [CrossRef]
- Rublee, E.; Rabaud, V.; Konolige, K.; Bradski, G. ORB: An Efficient Alternative to SIFT or SURF. In Proceedings of the 2011 International Conference on Computer Vision, Barcelona, Spain, 6–13 November 2011; pp. 2564–2571. [Google Scholar]
- Ke, G.; Meng, Q.; Finley, T.; Wang, T.; Chen, W.; Ma, W.; Ye, Q.; Liu, T.-Y. LightGBM: A Highly Efficient Gradient Boosting Decision Tree. In Proceedings of the Advances in Neural Information Processing Systems 30: Annual Conference on Neural Information Processing Systems 2017, Long Beach, CA, USA, 4–9 December 2017; Neural Information Processing Systems Foundation, Inc. (NeurIPS): San Diego, CA, USA, 2017. [Google Scholar]
- Liu, X.; Sui, Q.; Chen, Z. Real Time Weed Identification with Enhanced Mobilevit Model for Mobile Devices. Sci. Rep. 2025, 15, 27323. [Google Scholar] [CrossRef] [PubMed]
- Jin, K.; Zhang, J.; Liu, N.; Li, M.; Ma, Z.; Wang, Z.; Zhang, J.; Yin, F. Improved MobileVit Deep Learning Algorithm Based on Thermal Images to Identify the Water State in Cotton. Agric. Water Manag. 2025, 310, 109365. [Google Scholar] [CrossRef]
- Chollet, F. Xception: Deep Learning with Depthwise Separable Convolutions. arXiv 2017, arXiv:1610.02357. [Google Scholar] [CrossRef]
- Feng, Y.; Liu, C.; Han, J.; Lu, Q.; Xing, X. Identification of Wheat Seedling Varieties Based on MssiapNet. Front. Plant Sci. 2024, 14, 1335194. [Google Scholar] [CrossRef]
- Dubey, S.R.; Singh, S.K.; Chaudhuri, B.B. Activation Functions in Deep Learning: A Comprehensive Survey and Benchmark. arXiv 2022, arXiv:2109.14545. [Google Scholar] [CrossRef]
- Woo, S.; Park, J.; Lee, J.-Y.; Kweon, I.S. CBAM: Convolutional Block Attention Module. arXiv 2018, arXiv:1807.06521. [Google Scholar] [CrossRef]
- Ma, B.; Hua, Z.; Wen, Y.; Deng, H.; Zhao, Y.; Pu, L.; Song, H. Using an Improved Lightweight YOLOv8 Model for Real-Time Detection of Multi-Stage Apple Fruit in Complex Orchard Environments. Artif. Intell. Agric. 2024, 11, 70–82. [Google Scholar] [CrossRef]
- Mu, J.; Sun, L.; Ma, B.; Liu, R.; Liu, S.; Hu, X.; Zhang, H.; Wang, J. TFEMRNet: A Two-Stage Multi-Feature Fusion Model for Efficient Small Pest Detection on Edge Platforms. AgriEngineering 2024, 6, 4688–4703. [Google Scholar] [CrossRef]
- Anul Haq, M. CNN Based Automated Weed Detection System Using UAV Imagery. Comput. Syst. Sci. Eng. 2022, 42, 837–849. [Google Scholar] [CrossRef]
- De Souza, F.L.P.; Shiratsuchi, L.S.; Dias, M.A.; Barbosa Júnior, M.R.; Setiyono, T.D.; Campos, S.; Tao, H. A Neural Network Approach Employed to Classify Soybean Plants Using Multi-Sensor Images. Precis. Agric. 2025, 26, 32. [Google Scholar] [CrossRef]
Test Environment | Attributes |
---|---|
Operating System | Windows10 |
Graphics card | RTX3090 |
Processor | Intel-i9-12900k |
Programming languages | Python 3.8.19 |
Deep learning frameworks | Pytorch |
CUDA | 11.2 |
CUDNN | 8.1.1 |
Hyper-Parameter | Description |
---|---|
Optimizer | AdamW |
Initial Learning Rate | 1 × 10−3 |
Learning Rate Schedule | Cosine Annealing |
Weight Decay | 1 × 10−4 |
Input shape | (224, 244) |
Batch Size | 32 |
Epochs | 200 |
Label smoothing | 0.1 |
Data Augmentation | Random Horizontal Flip (p = 0.5) Random Rotation (±10°) Color Jitter (±0.2) |
Classifier | Accuracy/% | Training Time/s | Model Size /MB | Recall/% | F1 Score/% |
---|---|---|---|---|---|
LightGBM | 99.57 | 3.2 | 12.5 | 99.73 | 99.61 |
XGBoost | 98.83 | 9.7 | 28.3 | 99.12 | 99.43 |
Random Forest | 96.21 | 16.3 | 34.2 | 95.33 | 95.73 |
SVM | 94.12 | 23.4 | 50.8 | 92.62 | 93.17 |
Illumination Condition | IoU | Dice | Split Error/% | Merge Error/% | Precision/% | Recall/% |
---|---|---|---|---|---|---|
Low refletion | 0.941 | 0.962 | 3.5 | 2.1 | 98.54 | 98.42 |
Normal | 0.913 | 0.940 | 6.7 | 3.8 | 97.81 | 97.75 |
High reflection | 0.876 | 0.902 | 11.2 | 6.5 | 95.17 | 94.91 |
Category | Precision/% | Recall/% | F1-Score/% |
---|---|---|---|
Broken soybeans | 95.69 | 98.23 | 96.94 |
Immature soybeans | 100.00 | 100.00 | 100.00 |
Intact soybeans | 99.18 | 100.00 | 99.59 |
Skin-damaged soybeans | 99.08 | 94.74 | 96.86 |
Spotted soybeans | 98.04 | 99.01 | 98.52 |
Average | 98.40 | 98.40 | 98.38 |
Embedding Method | Accuracy/% | Precision/% | Recall/% | F1-Score/% |
---|---|---|---|---|
None | 95.53 | 95.52 | 95.57 | 95.50 |
Pre-expansion embedding | 97.13 | 97.07 | 97.14 | 97.08 |
Post-expansion embedding | 98.03 | 97.99 | 98.03 | 98.00 |
Dual embedding | 97.49 | 97.43 | 97.50 | 97.45 |
Method | Accuracy/% | Precision/% | Recall/% | F1-Score/% |
---|---|---|---|---|
None | 95.53 | 95.52 | 95.57 | 95.50 |
SE | 97.13 | 97.10 | 97.18 | 97.10 |
ECA | 97.49 | 97.45 | 97.53 | 97.47 |
SimAM | 97.67 | 97.63 | 97.69 | 97.65 |
CBAM | 98.03 | 97.99 | 98.03 | 98.00 |
Method | Accuracy/% | Precision/% | Recall/% | F1-Score/% |
---|---|---|---|---|
None | 93.13 | 93.21 | 93.17 | 93.15 |
SE | 95.18 | 95.09 | 95.16 | 95.14 |
ECA | 96.91 | 96.95 | 97.03 | 97.01 |
DCR | 98.03 | 97.99 | 98.03 | 98.00 |
Model | Factors | Accuracy /% | F1-Score /% | Model Size/M | Inference Time/ms | ||||
---|---|---|---|---|---|---|---|---|---|
DSC | THD | DCR | CBAM | Mish | |||||
MobileViT | × | × | × | × | × | 95.53 | 95.50 | 3.77 | 20.6 |
√ | × | × | × | × | 96.78 | 96.76 | 2.82 | 17.6 | |
√ | √ | × | × | × | 96.42 | 96.39 | 1.77 | 14.5 | |
√ | × | √ | × | × | 96.60 | 96.42 | 2.93 | 18.4 | |
√ | √ | √ | × | × | 97.13 | 97.08 | 1.86 | 15.2 | |
√ | √ | √ | √ | × | 98.03 | 98.03 | 2.08 | 15.9 | |
√ | √ | × | √ | × | 97.50 | 97.48 | 1.99 | 14.7 | |
√ | √ | √ | √ | √ | 98.39 | 98.38 | 2.09 | 16.4 |
Model | Accuracy/% | Precision/% | Recall/% | F1-Score/% | Parameters /% | Inference Time/ms | Model Size/M |
---|---|---|---|---|---|---|---|
Vgg16 | 95.35 | 95.36 | 95.39 | 95.32 | 137.12 | 83.6 | 528.80 |
ConvNeXt | 98.57 | 98.59 | 98.57 | 98.56 | 27.12 | 52.7 | 106.20 |
ResNet50 | 98.03 | 98.01 | 98.04 | 97.91 | 25.63 | 65.3 | 96.58 |
EfficientNetB0 | 96.42 | 96.39 | 96.45 | 96.40 | 6.94 | 32.8 | 18.46 |
MobileNetV2 | 97.32 | 97.26 | 97.35 | 97.28 | 4.15 | 24.7 | 12.60 |
MobileNetV3 | 95.17 | 95.20 | 95.21 | 95.15 | 2.97 | 19.5 | 8.51 |
ShuffleNetV2 | 95.71 | 96.69 | 95.73 | 95.66 | 2.28 | 17.6 | 5.35 |
MobileViT-XXS | 95.53 | 95.52 | 95.57 | 95.50 | 1.38 | 20.6 | 3.77 |
MobileViT-SD | 98.39 | 98.40 | 98.40 | 98.38 | 0.89 | 16.4 | 2.09 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Xia, Y.; Zhu, R.; Ji, F.; Zhang, J.; Chen, K.; Huang, J. Soybean Seed Classification and Identification Based on Corner Point Multi-Feature Segmentation and Improved MobileViT. AgriEngineering 2025, 7, 354. https://doi.org/10.3390/agriengineering7100354
Xia Y, Zhu R, Ji F, Zhang J, Chen K, Huang J. Soybean Seed Classification and Identification Based on Corner Point Multi-Feature Segmentation and Improved MobileViT. AgriEngineering. 2025; 7(10):354. https://doi.org/10.3390/agriengineering7100354
Chicago/Turabian StyleXia, Yu, Rui Zhu, Fan Ji, Junlan Zhang, Kunjie Chen, and Jichao Huang. 2025. "Soybean Seed Classification and Identification Based on Corner Point Multi-Feature Segmentation and Improved MobileViT" AgriEngineering 7, no. 10: 354. https://doi.org/10.3390/agriengineering7100354
APA StyleXia, Y., Zhu, R., Ji, F., Zhang, J., Chen, K., & Huang, J. (2025). Soybean Seed Classification and Identification Based on Corner Point Multi-Feature Segmentation and Improved MobileViT. AgriEngineering, 7(10), 354. https://doi.org/10.3390/agriengineering7100354