Related Experiment Video
Updated: May 5, 2026

Use of Principal Components for Scaling Up Topographic Models to Map Soil Redistribution and Soil Organic Carbon
Published on: October 16, 2018
GAF-ResNet-MHSA: A novel transfer learning method for soil nutrient prediction in small sample datasets
Hao Liang1, Kangyuan Zhong2, Yue Song3
1College of Mathematics and Computer Science, Zhejiang A&F University, Hangzhou, 311300, China; College of Engineering, China Agricultural University, Beijing, 100083, China; Institute of Modern Agriculture and Health Care Industry, Wencheng, 325300, China.
This study introduces a novel GAF-ResNet-MHSA transfer learning method to improve soil nutrient prediction using Near Infrared Spectroscopy (NIR) data. The approach significantly enhances accuracy, overcoming limitations of small sample sizes in regional soil analysis.
Area of Science:
- Agricultural Science
- Spectroscopy
- Machine Learning
Background:
- Near Infrared Spectroscopy (NIR) is vital for soil nutrient analysis but faces challenges with small sample sizes and regional variations.
- Existing models often exhibit low prediction accuracy and overfitting, limiting their practical application.
Purpose of the Study:
- To develop a novel transfer learning approach, GAF-ResNet-MHSA, for accurate soil nutrient prediction using NIR spectral data.
- To address the limitations of small sample sizes and improve model generalization across different soil regions.
Main Methods:
- Transformed NIR spectral data into Gramian Angular Field (GAF) images.
- Utilized a modified ResNet34 framework incorporating a multi-head attention mechanism (MHSA).
- Applied transfer learning by fine-tuning the GAF-ResNet-MHSA model with target domain samples.
Main Results:
- Initial models on small samples showed limited accuracy (e.g., R² for pH: 0.7575, SAP: 0.7393).
- The GAF-ResNet-MHSA transfer learning approach significantly improved prediction accuracy (e.g., R² for pH: 0.8962, SAP: 0.8110).
- Key performance metrics like RMSEp and RPD showed substantial improvements, indicating enhanced model reliability.
Conclusions:
- The GAF-ResNet-MHSA transfer learning method effectively overcomes accuracy issues in small-sample soil spectral modeling.
- This innovative approach demonstrates practical applicability and potential for efficient spectral transfer learning in soil analysis.

