{"title":"A Novel 2D-CNN Model Integrating 2D-Transformed NIR Spectra and Attention Mechanism With Transfer Learning: A Case in SSC Prediction of Pears","authors":"Zhangwei Fan, Anyi Zhao, Jianyi Zhang, Xiaping Fu","doi":"10.1002/cem.70158","DOIUrl":null,"url":null,"abstract":"<div>\n \n <p>Near-infrared (NIR) spectroscopy technology has been widely used in agriculture, food, pharmaceuticals, petrochemical, and other fields due to its advantages of high efficiency and nondestructiveness. However, it still faces challenges such as data distribution shifts caused by factors like different spectrometers and spectral acquisition environments. In this study, we propose a GASp2DCNN model that integrates the Gramian Angular Summation Field (GASF) and the adaptive star block (ASB) to address the performance degradation of models when spectrometers or environments change. Firstly, the spectrum is transformed to two-dimensional data after piecewise aggregation approximation (PAA), polar coordinate transformation, and GASF to capture correlation features with 2D convolution. Then, an ASB module integrating star operation and channel attention mechanism is designed to enhance the model's ability to capture spectral local correlations. Finally, a feature-vector based transfer learning (FBTL) method is proposed, which dynamically weights the feature vectors of the source and target domains through an attention mechanism to enhance cross-domain adaptation. The results on a pear dataset indicate that the GASp2DCNN improves <i>R</i><sup>2</sup> by 5.2% to 24.4% compared to machine learning models (PLSR, SVR) and 1D-CNN models. In transfer learning experiments, the proposed FBTL method improved <i>R</i><sup>2</sup> by 4% to 12% compared to global fine-tuning and head-freezing fine-tuning methods and outperformed domain-adversarial neural networks (DANN) and maximum classifier discrepancy (MCD) by 4% to 9% across all transfer scenarios. Stable transfer effects are achieved when the target domain sample size reaches 40% of the total, reducing reliance on target samples. This also provides an interpretable and highly robust solution for fruit quality detection.</p>\n </div>","PeriodicalId":15274,"journal":{"name":"Journal of Chemometrics","volume":"40 7","pages":""},"PeriodicalIF":2.0000,"publicationDate":"2026-06-18","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Journal of Chemometrics","FirstCategoryId":"92","ListUrlMain":"https://onlinelibrary.wiley.com/doi/10.1002/cem.70158","RegionNum":4,"RegionCategory":"化学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q1","JCRName":"SOCIAL WORK","Score":null,"Total":0}
引用次数: 0
Abstract
Near-infrared (NIR) spectroscopy technology has been widely used in agriculture, food, pharmaceuticals, petrochemical, and other fields due to its advantages of high efficiency and nondestructiveness. However, it still faces challenges such as data distribution shifts caused by factors like different spectrometers and spectral acquisition environments. In this study, we propose a GASp2DCNN model that integrates the Gramian Angular Summation Field (GASF) and the adaptive star block (ASB) to address the performance degradation of models when spectrometers or environments change. Firstly, the spectrum is transformed to two-dimensional data after piecewise aggregation approximation (PAA), polar coordinate transformation, and GASF to capture correlation features with 2D convolution. Then, an ASB module integrating star operation and channel attention mechanism is designed to enhance the model's ability to capture spectral local correlations. Finally, a feature-vector based transfer learning (FBTL) method is proposed, which dynamically weights the feature vectors of the source and target domains through an attention mechanism to enhance cross-domain adaptation. The results on a pear dataset indicate that the GASp2DCNN improves R2 by 5.2% to 24.4% compared to machine learning models (PLSR, SVR) and 1D-CNN models. In transfer learning experiments, the proposed FBTL method improved R2 by 4% to 12% compared to global fine-tuning and head-freezing fine-tuning methods and outperformed domain-adversarial neural networks (DANN) and maximum classifier discrepancy (MCD) by 4% to 9% across all transfer scenarios. Stable transfer effects are achieved when the target domain sample size reaches 40% of the total, reducing reliance on target samples. This also provides an interpretable and highly robust solution for fruit quality detection.
期刊介绍:
The Journal of Chemometrics is devoted to the rapid publication of original scientific papers, reviews and short communications on fundamental and applied aspects of chemometrics. It also provides a forum for the exchange of information on meetings and other news relevant to the growing community of scientists who are interested in chemometrics and its applications. Short, critical review papers are a particularly important feature of the journal, in view of the multidisciplinary readership at which it is aimed.