Abstract:Uneven maturity of alfalfa seeds hinders to determination of the optimal harvesting time. There are several algorithms used to assess the maturity level of alfalfa seed;however, existing algorithms are inefficient under natural conditions due to low automation and poor generalization capabilities. An efficient alfalfa seed pod maturity identification model (VSC-DETR) that can accurately determine the optimal harvest time was proposed. The proposed real-time detection Transformer (RT-DETR) model enhanced computational efficiency and generalization ability by replacing the main network of RT-DETR with a VanillaNet network, improving the model’s ability to identify seed pods in complex natural environments. In addition, the SPDConv CSP-OmmiKernel (SPOM) module was designed to enhance the model’s detection capability for small alfalfa seed pod targets. By replacing the multi-head attention in the scale feature interaction module (Attention-based cross-scale feature interaction, AIFI) with the convolutional additive token mixer (CATM) module, the model’s understanding of global information was optimized. Additionally, the reparameterized cross-stage partial network with three convolutional layers (RepC3) was optimized by introducing the diversity branch block (DBB) module, and standard convolutions were replaced with linear deformable convolutions during down sampling to improve accuracy. The experimental results showed that the mAP@0.5 of VSC-DETR reached 94.23%, with average detection time of 88.3ms. Compared with RT-DETR, the precision, recall, and mAP@0.5 were improved by 7.65, 14.2, and 11.36 percentage points, respectively, while the average detection time was decreased by 20.4ms. This research achievement enabled the quick and accurate identification of alfalfa seed pods of different maturities, providing strong support for selecting high-quality seeds, thereby improving seed germination rates and production efficiency.