More efficient resource utilization and increased crop utilization rate are needed to address the growing demand for food. The efficient quality testing of key agricultural products such as potatoes, especially the rapid testing of key nutritional indicators, has become an important strategy for ensuring their quality and safety. In this study, visible and near infrared (Vis/NIR) transmittance spectroscopy (600–900 nm) was used for the online analysis of multiple quality parameters in potatoes. The study concentrated on comparing three one-dimensional convolutional neural network (1D-CNN) models, specifically, the fine-tuned DeepSpectra, the fine-tuned 1D-AlexNet, and classic CNN, with UVE-PLS (uninformative variable elimination–partial least squares) models. These models utilized spectral data for the real-time detection of dry matter (DM) content in potatoes. To address the challenges posed by limited data from Vis/NIR, this study strategically implemented data augmentation techniques. This approach significantly enhanced the robustness and generalization capabilities of the models. The 1D-AlexNet and DeepSpectra models achieved 0.934 and 0.913 R2P and 0.0603 and 0.0695 g/100 g RMSEP for DM, respectively. Compared to UVE-PLS, the R2P value improved by 21.31% (0.770 to 0.934) for the 1D-AlexNet model and 18.64% (0.770 to 0.913) for the DeepSpectra model. The RMSEP value was reduced by 47.31% (0.114 to 0.0603) for 1D-AlexNet, and 39.30% (0.114 to 0.0695) for the DeepSpectra model. As a result, this study would be helpful for researching the online Vis/NIR transmission determination of potato DM using deep learning. These results highlighted the immense potential of employing specific spectral features in deep-learning models for a more precise and efficient online assessment of agricultural quality. This advancement provided some insight and reference for further contributing to the evolution of more targeted and efficient quality assessment methods in agricultural products.
Introduction: Blackheart is one of the most common physiological diseases in potatoes during storage. In the initial stage, black spots only occur in tissues near the potato core and cannot be detected from an outward appearance. If not identified and removed in time, the disease will seriously undermine the quality and sale of theentire batch of potatoes. There is an urgent need to develop a method for early detection of blackheart in potatoes.Methods: This paper used visible-near infrared (Vis/NIR) spectroscopy to conduct online discriminant analysis on potatoes with varying degrees of blackheart and healthy potatoes to achieve real-time detection. An efficient and lightweight detection model was developed for detecting different degrees of blackheart in potatoes by introducing the depthwise convolution, pointwise convolution, and efficient channel attention modules into the ResNet model. Two discriminative models, the support vector machine (SVM) and the ResNet model were compared with the modified ResNet model. Results and discussion: The prediction accuracy for blackheart and healthy potatoes test sets reached 0.971 using the original spectrum combined with a modified ResNet model. Moreover, the modified ResNet model significantly reduced the number of parameters to 1434052, achieving a substantial 62.71% reduction in model complexity. Meanwhile, its performance was evidenced by a 4.18% improvement in accuracy. The Grad-CAM++ visualizations provided a qualitative assessment of the model’s focus across different severity grades of blackheart condition, highlighting the importance of different wavelengths in the analysis. In these visualizations, the most significant features were predominantly found in the 650–750 nm range, with a notable peak near 700 nm. This peak was speculated to be associated with the vibrational activities of the C-H bond, specifically the fourth overtone of the C-H functional group, within the molecular structure of the potato components. This research demonstrated that the modified ResNet model combined with Vis/NIR could assist in the detection of different degrees of black in potatoes.
Ensuring the surface quality of fresh soybeans is critical for maintaining their commercial value and consumer confidence. However, traditional manual inspection remains labor-intensive, subjective, and inadequate for real-time, high-throughput sorting. In this study, we present a multi-scale attention-augmented You Only Look Once version 8 (YOLOv8) framework tailored for real-time surface defect detection in fresh soybeans. The proposed model integrates two complementary attention mechanisms—Squeeze-and-Excitation (SE) and Multi-Scale Dilated Attention (MSDA)—to enhance the detection of small, irregular, and low-contrast defects under complex backgrounds. Rather than relying on cross-model comparisons, we perform systematic ablation studies to evaluate the individual and combined contributions of SE and MSDA across diverse defect categories. Experimental results from a custom-labeled soybean dataset demonstrate that the integrated SE+MSDA model achieves superior performance in terms of precision, recall, and Mean Average Precision (mAP), particularly for challenging categories such as wormholes and speckles. The proposed framework provides a lightweight, interpretable, and deployment-ready solution for intelligent agricultural inspection, with potential applicability to broader food quality control tasks.