基于分段注意力机制对大麦数据分类
Classification of Barley Data Based on a Segmented Attention Mechanism
摘要: 近红外光谱技术因其快速、无损等优势,在农产品品质分析中具有广泛应用,但高维、非线性光谱数据给多品种精细分类带来挑战。文章提出一种基于分段独立卷积注意力模块(SI-CBAM)的近红外光谱分类方法,用于埃塞俄比亚24个大麦品种的鉴别。针对大麦光谱在740~1070 nm范围内变化平缓、无明显吸收峰的特点,设计基于光谱导数分析的物理意义分段策略,将连续光谱划分为四个具有不同变化特征的子区间。每个子区间独立嵌入CBAM模块,通过通道注意力和空间注意力自适应强化局部判别特征,提升模型对细微光谱差异的感知能力。实验结果表明,SI-CBAM在测试集上分类准确率达0.8333,交叉验证准确率为0.8452,显著优于随机森林(0.3194)、支持向量机(0.7194)及全局CBAM模型(0.8000)。研究表明,结合光谱物理分段与注意力机制的策略,能有效提升近红外光谱在复杂分类任务中的判别性能与模型可解释性。
Abstract: Near-infrared spectroscopy, owing to its rapid and non-destructive advantages, finds extensive application in agricultural product quality analysis. However, high-dimensional, non-linear spectral data poses challenges for precise classification across multiple varieties. This paper proposes a near-infrared spectral classification method based on the Segmented Independent Convolutional Attention Module (SI-CBAM) for the identification of 24 barley varieties in Ethiopia. Addressing barley spectra’s characteristic gradual variation without distinct absorption peaks across 740~1070 nm, a physically meaningful segmentation strategy based on spectral derivative analysis was devised. This divides the continuous spectrum into four sub-intervals exhibiting distinct variation patterns. Each sub-interval is independently embedded within the CBAM module, where adaptive reinforcement of local discriminative features through channel attention and spatial attention enhances the model’s sensitivity to subtle spectral differences. Experimental results demonstrate that SI-CBAM achieves a classification accuracy of 0.8333 on the test set and a cross-validation accuracy of 0.8452, significantly outperforming Random Forest (0.3194), Support Vector Machine (0.7194), and the global CBAM model (0.8000). This research demonstrates that integrating spectral physical segmentation with attention mechanisms effectively enhances the discriminative performance and model interpretability of near-infrared spectroscopy in complex classification tasks.
文章引用:陈南阳. 基于分段注意力机制对大麦数据分类[J]. 光电子, 2026, 16(2): 56-66. https://doi.org/10.12677/oe.2026.162006

参考文献

[1] Courand, A., Metz, M., Héran, D., Feilhes, C., Prezman, F., Serrano, E., et al. (2022) Evaluation of a Robust Regression Method (RoBoost-PLSR) to Predict Biochemical Variables for Agronomic Applications: Case Study of Grape Berry Maturity Monitoring. Chemometrics and Intelligent Laboratory Systems, 221, Article ID: 104485. [Google Scholar] [CrossRef
[2] Huang, Y., Dong, W., Chen, Y., Wang, X., Luo, W., Zhan, B., et al. (2021) Online Detection of Soluble Solids Content and Maturity of Tomatoes Using Vis/NIR Full Transmittance Spectra. Chemometrics and Intelligent Laboratory Systems, 210, Article ID: 104243. [Google Scholar] [CrossRef
[3] Gomez, J., Barquero-Pérez, O., Gonzalo, J., Salgüero, S., Riado, D., Luisa Casas, M., et al. (2024) Near Infrared Spectroscopy (NIRS) and Machine Learning as a Promising Tandem for Fast Viral Detection in Serum Microsamples: A Preclinical Proof of Concept. Spectrochimica Acta Part A: Molecular and Biomolecular Spectroscopy, 322, Article ID: 124819. [Google Scholar] [CrossRef] [PubMed]
[4] 花锦, 赵悠悠, 高媛惠, 等. 基于近红外技术快速测定不同鲜肉中脂肪含量[J]. 光谱学与光谱分析, 2017, 37(11): 3424-3429.
[5] 杨逍, 陈世国, 许鑫. 基于支持向量机混合遗传算法的分类模型[J]. 电脑编程技巧与维护, 2025(8): 41-43.
[6] 宋小东, 戴希红, 宗成明, 等. 基于支持向量机技术识别降雨图像[J]. 航海技术, 2025(6): 13-17.
[7] Nikitin, N.Y. and Stepashkin, A.А. (2025) Classification of Tensile Test Results of Unidirectional Carbon Fiber-Polysulfone Composite Material Based on Random Forest, KNN and CNN Methods. Results in Materials, 28, Article ID: 100788. [Google Scholar] [CrossRef
[8] Mohamed Sabri, A.A., Tomy, S. and Za’in, C. (2025) Comparative Machine Learning Analysis for Gold Mineral Prediction Using Random Forest and XGBoost: A Data-Driven Study of the Greater Bendigo Region, Victoria. Geomatica, 77, Article ID: 100066. [Google Scholar] [CrossRef
[9] 张宸嘉, 朱磊, 俞璐. 卷积神经网络中的注意力机制综述[J]. 计算机工程与应用, 2021, 57(20): 64-72.
[10] 任欢, 王旭光. 注意力机制综述[J]. 计算机应用, 2021, 41(S1): 1-6.
[11] 杜俊, 吕浩音, 姚云霞. 基于YOLOv5n和CBAM注意力机制的农作物病虫害检测方法研究[J]. 电脑知识与技术, 2025, 21(29): 1-6.
[12] 王美华, 吴振鑫, 周祖光. 基于注意力改进CBAM的农作物病虫害细粒度识别研究[J]. 农业机械学报, 2021, 52(4): 239-247.
[13] 付国栋, 黄进, 杨涛, 等. 改进CBAM的轻量级注意力模型[J]. 计算机工程与应用, 2021, 57(20): 150-156.
[14] Zhang, J., Bai, X., Wu, J. and Zhou, B. (2025) Nondestructive Detection Method for Soluble Solids Content and Titratable Acidity Content in Pepino Melons Based on Vis/NIR Spectroscopy and Dual-Attention Enhanced 1D-CNN. Journal of Food Composition and Analysis, 148, Article ID: 108232. [Google Scholar] [CrossRef
[15] Kosmowski, F. and Worku, T. (2018) Evaluation of a Miniaturized NIR Spectrometer for Cultivar Identification: The Case of Barley, Chickpea and Sorghum in Ethiopia. PLOS ONE, 13, e0193620. [Google Scholar] [CrossRef] [PubMed]
[16] 陈嘉, 高丽, 叶发银, 等. 基于近红外光谱与支持向量机的甘薯粉丝掺假快速检测[J]. 食品与发酵工业, 2019, 45(11): 211-218.
[17] Breiman, L. (2001) Random Forests. Machine Learning, 45, 5-32. [Google Scholar] [CrossRef
[18] Cortes, C. and Vapnik, V. (1995) Support-Vector Networks. Machine Learning, 20, 273-297. [Google Scholar] [CrossRef
[19] Wu, H., Wang, D., Huang, Q. and Gao, L. (2018) Real-Time Continuous Recognition of Knee Motion Using Multi-Channel Mechanomyography Signals Detected on Clothes. Journal of Electromyography and Kinesiology, 38, 94-102. [Google Scholar] [CrossRef] [PubMed]
[20] Liu, Z., Wang, L., Zhang, Y. and Chen, C.L.P. (2016) A SVM Controller for the Stable Walking of Biped Robots Based on Small Sample Sizes. Applied Soft Computing, 38, 738-753. [Google Scholar] [CrossRef
[21] Yin, H.-P. and Ren, H.-P. (2021) Direct Symbol Decoding Using GA-SVM in Chaotic Baseband Wireless Communication System. Journal of the Franklin Institute, 358, 6348-6367. [Google Scholar] [CrossRef
[22] Woo, S., Park, J., Lee, J. and Kweon, I.S. (2018) CBAM: Convolutional Block Attention Module. In: Ferrari, V., et al., Eds., Computer VisionECCV 2018, Springer International Publishing, 3-19. [Google Scholar] [CrossRef