A quantitative detection method for maize kernel broken rate based on the optimisation of the MSA transformer algorithm.
Journal:
Food research international (Ottawa, Ont.)
Published Date:
Dec 4, 2025
Abstract
The broken rate of maize kernels during mechanised harvesting directly affects food quality and economic returns. However, the current qualitative detection methods cannot accurately assess the corn kernel breakage rate. The study proposed a maize kernel broken rate quantitative detection model based on machine vision and deep learning algorithms. A total of 27 features was extracted from kernel images, including geometric, shape, colour, and texture characteristics. Furthermore, an improved Transformer-based deep learning model, MSA Transformer, was developed by integrating multi-scale feature fusion and attention mechanisms. The model uses parallel branches for multi-granularity feature extraction, enhances salient information via global and local attention, and applies global average pooling for efficiency. Compared with other models, the MSA Transformer achieved a classification accuracy of 98.03 % in the classification experiments, outperforming the standard Transformer by 2 %. The average precision, recall, and F1-score reached 99.13 %, 98.03 %, and 97.87 %, respectively. In the mass regression task, the correlation coefficients (r) for unbroken and broken kernel predictions reached 0.9507 and 0.9653, respectively; the coefficients of determination (R2) reached 0.9038 and 0.9318, and the root mean square errors (RMSE) were all below 0.0141. The breakage rate predicted by the quantitative detection model closely matched actual measurements, with an R2 of 0.9887 and a relative error of approximately 6 %. Feature importance analysis highlighted the dominant role of colour and texture in classification, and geometric features in mass prediction. This research provides a theoretical basis for the online quantitative assessment of food quality.
Authors
Keywords
No keywords available for this article.