Optimizing Data Preprocessing and Hyperparameter Tuning for Soil Organic Carbon Content Prediction Using Large Language Models: A Case Study of the Black Soil and Windblown Sandy Soil Regions in Northeast China
Abstract
1. Introduction
2. Research Roadmap
3. Materials and Methods
3.1. Study Area and Data Sources
3.1.1. Study Area
3.1.2. Data Sources
3.2. Data Preprocessing Methods
3.2.1. Traditional Hard-Coding
3.2.2. Isolation Forest
3.2.3. LLM Preprocessing Methods
3.3. Model and Hyperparameter Optimization
3.3.1. Random Forest
3.3.2. Hyperparameter Optimization
3.4. Model Evaluation Metrics
4. Results and Analysis
4.1. Data Preprocessing Performance Comparison
| As a soil data specialist, generate data preprocessing rules for the [Region Name] area. [Data Context] Region: [Region Name], [Climate Type] Sample size: [Sample Size] samples SOC statistics: Mean [SOC Mean] ± [SOC Standard Deviation] g/kg Sand statistics: Mean [Sand Mean] ± [Sand Standard Deviation]% [Rule Requirements] 1. SOC outlier range: Set reasonable upper/lower limits based on statistical distribution 2. Sand outlier upper limit: Establish the maximum value considering soil characteristics 3. Missing value imputation strategy: Fill based on soil_type_lat [Northeast Black Soil Region Rules] Soil organic carbon content distribution in the black soil region is relatively concentrated, thus employing a small-scale range for Soil organic carbon content anomalies. Under humid climatic conditions, sand content is relatively low. Median values are estimated by grouping soil types and latitudes to fully preserve the high-carbon characteristics of black soil. [Northeast Windblown Sandy Soil Region Rules] Soil organic carbon content exhibits significant variability in the Windblown Sandy Soil Region, necessitating an expanded range for Soil organic carbon content anomalies to preserve genuinely low values. Arid areas feature higher sand content. Latitude-based binning and median interpolation by soil type are employed to avoid introducing external biases. |
4.2. Hyperparameter Optimization Performance Comparison
| As a soil science expert, I recommend optimal hyperparameters for the random forest model in the [Region Name] area. [Data Information] Number of training samples: [Number of Training Samples] Number of features: [Number of Features] Mean of target variable (SOC): [Mean SOC Value] g/kg [Parameter Constraints] - n_estimators: Integer between 100 and 400 - max_depth: Integer between 8 and 20 - max_features: Decimal between 0.6 and 0.8 [Northeast Black Soil Region Rules] Regional Characteristics: Moderate sample size with relatively concentrated SOC distribution. A moderate number of trees balances model capacity and computational efficiency; limiting tree depth prevents overfitting while capturing key patterns; setting max_features to an appropriate value ensures sufficient feature interaction without excessive randomness, guaranteeing robust generalization. [Northeast Windblown Sandy Soil Region Rules] Regional Characteristics: Given the high variability of SOC in the Windblown Sandy Soil Region, using slightly more trees helps stabilize prediction results and capture complex patterns. Moderate depth prevents overfitting to noise, while the feature sampling ratio ensures sufficient feature diversity at each split. This configuration effectively balances bias and variance under conditions of limited sample size and high data variability. |
4.3. Performance Comparison of Random Forest Models Based on LLM Hyperparameter Optimization
4.4. Variable Importance Analysis
5. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Zhang, P.; He, M.Z.; Wang, J.; Huang, L.; Yang, H.T.; Song, G.; Zhao, J.C.; Li, X.R. Desertification Reduces Organic Carbon Content and Nutrient Availability in Dryland Soils: Evidence from a Survey in the Amu Darya River Basin. Land Degrad. Dev. 2025, 36, 1181–1194. [Google Scholar] [CrossRef]
- Chen, H.; Zhu, D.; Chen, H. Effects of land-use patterns on soil aggregate stability and organic carbon in rocky desertification areas. Carsol. Sin. 2021, 40, 346–354. [Google Scholar] [CrossRef]
- Tang, X.; Wu, H.; Dong, J.; Liu, X.; Li, W.; Cui, Y. Effects of desertification and degradation on carbon sequestration of grassland ecosystem in Gannan. Chin. J. Ecol. 2022, 41, 278–286. [Google Scholar] [CrossRef]
- Mansur, N.; Abbod, M. Machine learning-based estimation of soil organic matter using RGB values. DYSONA Appl. Sci. 2026, 7, 73–81. [Google Scholar] [CrossRef]
- Beisekenov, N.; Banakinaou, W.; Ajayi, A.D.; Hasegawa, H.; Tadao, A. Remote sensing-based soil organic carbon monitoring using advanced machine learning techniques under conservation agriculture systems. Smart Agric. Technol. 2025, 11, 101036. [Google Scholar] [CrossRef]
- Sharma, R.; Levi, M.R.; Ricker, M.C.; Thompson, A.; King, E.G.; Robertson, K. Scaling of soil organic carbon in space and time in the Southern Coastal Plain, USA. Sci. Total Environ. 2024, 933, 14. [Google Scholar] [CrossRef] [PubMed]
- Tziolas, N.; Tsakiridis, N.; Heiden, U.; van Wesemael, B. Soil organic carbon mapping utilizing convolutional neural networks and Earth observation data, a case study in Bavaria state Germany. Geoderma 2024, 444, 15. [Google Scholar] [CrossRef]
- Ding, Z.J.; Liu, K.; Grunwald, S.; Smith, P.; Ciais, P.; Wang, B.; Wadoux, A.; Ferreira, C.; Karunaratne, S.; Shurpali, N.; et al. Advancing Soil Organic Carbon Prediction: A Comprehensive Review of Technologies, AI, Process-Based and Hybrid Modelling Approaches. Adv. Sci. 2025, 12, 28. [Google Scholar] [CrossRef]
- Song, Y.Q.; Wang, F.; Yang, W.H.; Liang, R.L.; Zhan, D.X.; Xiang, M.Y.; Yang, X.H.; Xu, R.; Lu, M. High-performance prediction of soil organic carbon using automatic hyperparameter optimization method in the yellow river delta of China☆. Comput. Electron. Agric. 2025, 236, 16. [Google Scholar] [CrossRef]
- Ben Ghorbal, A.; Grine, A.; Eid, M.M.; El-kenawy, E.M. Sustainable soil organic carbon prediction using machine learning and the ninja optimization algorithm. Front. Environ. Sci. 2025, 13, 23. [Google Scholar] [CrossRef]
- Liang, W.; Ma, Z.X.; Li, Z.Q.; Li, W.D.; Zhang, X.S.; Cai, L. A bi-level optimization framework for household distributed energy systems: Integrating multiple flexible loads. Energy Sources Part A-Recovery Util. Environ. Eff. 2025, 47, 12202–12226. [Google Scholar] [CrossRef]
- Zhang, E.; Wu, D.; Boman, J. Carbon-Aware Workload Shifting for Mitigating Environmental Impact of Generative AI Models. In Proceedings of the 2024 Congress on Cybermatics-Cybermatics, Copenhagen, Denmark, 19–22 August 2024; IEEE: New York, NY, USA, 2024; pp. 446–453. [Google Scholar] [CrossRef]
- Usman, Y.; Ihejirika, C.J.; Offor, S.N.; Akl, R.; Chataut, R. Green Cybersecurity: Leveraging AI, ML, and LLMs to Optimize Energy, Threat Detection, and Sustainability Frameworks. IEEE Access 2025, 13, 159345–159379. [Google Scholar] [CrossRef]
- Jami, H.C.; Singh, P.R.; Kumar, A.; Bakshi, B.R.; Ramteke, M.; Kodamana, H. CCU-Llama: A Knowledge Extraction LLM for Carbon Capture and Utilization by Mining Scientific Literature Data. Ind. Eng. Chem. Res. 2024, 63, 17585–17598. [Google Scholar] [CrossRef]
- Hu, L.; Zhou, Z.R.; Jia, G.Z. A one-shot automated framework based on large language model and AutoML: Accelerating the design of porous carbon materials and carbon capture optimization. Sep. Purif. Technol. 2025, 376, 15. [Google Scholar] [CrossRef]
- Zhang, X.J.; Guo, X.; Zhao, J.H.; Xiong, J.; Tian, Y.J. Intelligent application of large language model to life cycle assessment methodology. J. Clean. Prod. 2025, 529, 19. [Google Scholar] [CrossRef]
- Jiang, P.; Sonne, C.; Li, W.L.; You, F.Q.; You, S.M. Preventing the Immense Increase in the Life-Cycle Energy and Carbon Footprints of LLM-Powered Intelligent Chatbots. Engineering 2024, 40, 202–210. [Google Scholar] [CrossRef]
- Geng, J.; Lv, J.W.; Pei, J.; Liao, C.H.; Tan, Q.Y.; Wang, T.X.; Fang, H.J.; Wang, L. Prediction of soil organic carbon in black soil based on a synergistic scheme from hyperspectral data: Combining fractional-order derivatives and three-dimensional spectral indices. Comput. Electron. Agric. 2024, 220, 12. [Google Scholar] [CrossRef]
- Chen, Y.L.; Guo, L.C.; Cui, J.Y.; Xiong, S.F. Spatiotemporal variation of well-dated soil organic carbon pool in Northeast China during the Holocene. Quat. Sci. 2022, 42, 1311–1327. [Google Scholar] [CrossRef]
- Sun, X.D.; Ning, Z.Y.; Yang, H.L.; Zhang, Z.Q.; Li, Y.L. The Stoichiometry of carbon, nitrogen and phosphorus in soil in typical desertified regions, North China. J. Desert Res. 2018, 38, 1209–1218. [Google Scholar] [CrossRef]
- Dong, C.; Meng, X.T.; Ruan, W.M.; Cui, J.; Zhang, X.L.; Liu, H.J. An innoval hyperspectral prediction model for soil organic matter in croplands of the Northeast China Mollisols Region. Soil Tillage Res. 2025, 253, 16. [Google Scholar] [CrossRef]
- Wang, L.P.; Wang, X.; Kooch, Y.; Song, K.S.; Zheng, S.F.; Wu, D.H. Remote estimation of soil organic carbon under different land use types in agroecosystems of Eastern China. Catena 2023, 231, 13. [Google Scholar] [CrossRef]
- Chen, Z.X.; Chen, L.K.; Lu, R.; Lou, Z.H.; Zhou, F.R.; Jin, Y.C.; Xue, J.; Guo, H.C.; Wang, Z.; Wang, Y.Y.; et al. A national soil organic carbon density dataset (2010–2024) in China. Sci. Data 2025, 12, 9. [Google Scholar] [CrossRef] [PubMed]
- Zhang, Y.H.; Wang, Y.Q.; Bai, Y.R.; Zhang, R.Y.; Liu, X.; Ma, X. Prediction of Spatial Distribution of Soil Organic Carbon in Helan Farmland Based on Different Prediction Models. Land 2023, 12, 15. [Google Scholar] [CrossRef]
- Bao, Y.L.; Meng, X.T.; Liu, H.J.; Xu, M.Y.; Wang, M.C. A novel method for soil organic carbon prediction using integrated ‘ground-air-space’ multimodal remote sensing data. Geoderma 2025, 460, 14. [Google Scholar] [CrossRef]
- Adeniyi, O.D.; Brenning, A.; Maerker, M. Spatial prediction of soil organic carbon: Combining machine learning with residual kriging in an agricultural lowland area (Lombardy region, Italy). Geoderma 2024, 448, 13. [Google Scholar] [CrossRef]
- Geng, J.; Tan, Q.Y.; Lv, J.W.; Fang, H.J. Assessing spatial variations in soil organic carbon and C:N ratio in Northeast China’s black soil region: Insights from Landsat-9 satellite and crop growth information. Soil Tillage Res. 2024, 235, 14. [Google Scholar] [CrossRef]
- Yepmo, V.; Smits, G.; Lesot, M.J.; Pivert, O. Leveraging an Isolation Forest to Anomaly Detection and Data Clustering. Data Knowl. Eng. 2024, 151, 16. [Google Scholar] [CrossRef]
- Dhuliawala, S.; Kulikov, I.; Yu, P.; Celikyilmaz, A.; Weston, J.; Sukhbaatar, S.; Lanchantin, J. Adaptive Decoding via Latent Preference Optimization. arXiv 2024, arXiv:2411.09661. [Google Scholar] [CrossRef]
- Wang, Z.Q.; Zhang, D.Y.; Xu, X.B.; Lu, T.Y.; Yang, G.H. Collaborative Utilization of Sentinel-1/2 and DEM Data for Mapping the Soil Organic Carbon in Forested Areas Based on the Random Forest. Forests 2024, 15, 16. [Google Scholar] [CrossRef]
- Chandra, J.; Hidayaturrahman; Tjoaquinn, C. Predicting Stroke Diagnosis Using Hyperparameter Tuning. In Proceedings of the 2024 7th International Conference of Computer and Informatics Engineering (IC2IE), Bali, Indonesia, 12–13 September 2024; IEEE: New York, NY, USA, 2024; pp. 1–7. [Google Scholar] [CrossRef]
- Kakhani, N.; Taghizadeh-Mehrjardi, R.; Omarzadeh, D.; Ryo, M.; Heiden, U.; Scholten, T. Towards Explainable AI: Interpreting Soil Organic Carbon Prediction Models Using a Learning-Based Explanation Method. Eur. J. Soil Sci. 2025, 76, 18. [Google Scholar] [CrossRef]
- Song, J.R.; Gao, J.H.; Zhang, Y.B.; Li, F.P.; Man, W.D.; Liu, M.Y.; Wang, J.H.; Li, M.Q.; Zheng, H.; Yang, X.W.; et al. Estimation of Soil Organic Carbon Content in Coastal Wetlands with Measured VIS-NIR Spectroscopy Using Optimized Support Vector Machines and Random Forests. Remote Sens. 2022, 14, 21. [Google Scholar] [CrossRef]
- Bergstra, J.; Bengio, Y. Random Search for Hyper-Parameter Optimization. J. Mach. Learn. Res. 2012, 13, 281–305. [Google Scholar]
- Evstafev, E. Optimizing Humor Generation in Large Language Models: Temperature Configurations and Architectural Trade-offs. arXiv 2025, arXiv:2504.02858. [Google Scholar] [CrossRef]
- Wang, Y.; Chen, S.C.; Hong, Y.S.; Hu, B.F.; Peng, J.; Shi, Z. A comparison of multiple deep learning methods for predicting soil organic carbon in Southern Xinjiang, China. Comput. Electron. Agric. 2023, 212, 12. [Google Scholar] [CrossRef]
- Meng, X.T.; Bao, Y.L.; Wang, Y.; Zhang, X.L.; Liu, H.J. An advanced soil organic carbon content prediction model via fused temporal-spatial-spectral (TSS) information based on machine learning and deep learning algorithms. Remote Sens. Environ. 2022, 280, 21. [Google Scholar] [CrossRef]
- Chen, X.T.; Xu, T.L.; Li, X.J.; Zhao, A.H.; Feng, H.Y.; Chen, B.D. Soil organic carbon concentrations and the influencing factors in natural ecosystems of northern China. Chin. J. Ecol. 2019, 38, 1133–1140. [Google Scholar] [CrossRef]
- Türker, Y.S.; Kilincarslan, S.; Ince, E.Y. Performance of ANN, Random Forest and XGBoost methods in predicting the flexural properties of wood beams reinforced with carbon-FRP. Wood Mater. Sci. Eng. 2025, 20, 657–668. [Google Scholar] [CrossRef]
- Khaldi, Z.; Weng, J.N.; Lopez, F.P.A.; Zhou, G.H.; Ghedjatti, I.; Ali, A. PyGEE-ST-MEDALUS: AI Spatiotemporal Framework Integrating MODIS and Sentinel-1/-2 Data for Desertification Risk Assessment in Northeastern Algeria. Remote Sens. 2025, 17, 33. [Google Scholar] [CrossRef]
- Li, S.B.; He, S.Y.; Xu, Z.; Liu, Y.; von Bloh, W. Desertification process and its effects on vegetation carbon sources and sinks vary under different aridity stress in Central Asia during 1990–2020. Catena 2023, 221, 15. [Google Scholar] [CrossRef]
- Wang, C.Y.; Gao, B.B.; Yang, K.; Wang, Y.X.; Sukhbaatar, C.; Yin, Y.; Feng, Q.L.; Yao, X.C.; Zhang, Z.H.; Yang, J.Y. Inversion of soil organic carbon content based on the two-point machine learning method. Sci. Total Environ. 2024, 943, 13. [Google Scholar] [CrossRef]










| Variable Category | Variable Name | Definition/Role | Variable Type |
|---|---|---|---|
| Core variables—feature variables | Sand | Sand/gravel content; soil texture indicator | Numeric (%) |
| Silt | Silt content; soil texture indicator | Numeric (%) | |
| Clay | Clay content; soil texture indicator | Numeric (%) | |
| NDVI | Normalized Difference Vegetation Index; indicates vegetation cover | Numeric (unitless) | |
| MAT | Mean annual temperature; climatic factor | Numeric (°C) | |
| MAP | Mean annual precipitation; climatic factor | Numeric (mm) | |
| Core variables—target variable | SOC (g/kg) | Soil organic carbon content; model prediction target | Numeric (g/kg) |
| Auxiliary variables | latitude | Latitude; used to delineate the black soil region and windblown sandy soil region | Numeric (°N) |
| longitude | Longitude; used to delineate the black soil region and windblown sandy soil region | Numeric (°E) |
| Method | Original Sample Size | Sample Size After Cleaning | Missing-Value Imputation Ratio |
|---|---|---|---|
| Traditional hard coding | 797 | 448 | 100 |
| Isolation Forest | 797 | 757 | 100 |
| LLM | 797 | 441 | 100 |
| Method | Original Sample Size | Sample Size After Cleaning | Missing-Value Imputation Ratio |
|---|---|---|---|
| Traditional hard coding | 609 | 361 | 100 |
| Isolation Forest | 609 | 578 | 100 |
| LLM | 609 | 377 | 100 |
| Method | n_estimators | max_depth | max_features | Number of Evaluations | Time (seconds) |
|---|---|---|---|---|---|
| Grid search | 200 | 12 | 0.6 | 64 | 21.03 |
| Random search | 200 | 12 | 0.6 | 20 | 4.87 |
| LLM | 250 | 12 | 0.7 | 1 | 1.71 |
| Method | n_estimators | max_depth | max_features | Number of Evaluations | Time (seconds) |
|---|---|---|---|---|---|
| Grid search | 400 | 12 | 0.6 | 64 | 19.31 |
| Random search | 200 | 10 | 0.6 | 20 | 4.28 |
| LLM | 300 | 12 | 0.7 | 1 | 1.74 |
| Rank | Black Soil Region | Importance | Wind-Blown Sandy Region | Importance |
|---|---|---|---|---|
| 1 | MAT | 0.358 | Clay | 0.320 |
| 2 | Clay | 0.188 | MAT | 0.314 |
| 3 | Sand | 0.132 | MAP | 0.141 |
| 4 | MAP | 0.116 | Silt | 0.091 |
| 5 | Silt | 0.107 | Sand | 0.070 |
| 6 | NDVI | 0.098 | NDVI | 0.065 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license.
Share and Cite
Cui, H.; Chang, X.; Gang, S. Optimizing Data Preprocessing and Hyperparameter Tuning for Soil Organic Carbon Content Prediction Using Large Language Models: A Case Study of the Black Soil and Windblown Sandy Soil Regions in Northeast China. Appl. Sci. 2026, 16, 3349. https://doi.org/10.3390/app16073349
Cui H, Chang X, Gang S. Optimizing Data Preprocessing and Hyperparameter Tuning for Soil Organic Carbon Content Prediction Using Large Language Models: A Case Study of the Black Soil and Windblown Sandy Soil Regions in Northeast China. Applied Sciences. 2026; 16(7):3349. https://doi.org/10.3390/app16073349
Chicago/Turabian StyleCui, Hao, Xianmin Chang, and Shuang Gang. 2026. "Optimizing Data Preprocessing and Hyperparameter Tuning for Soil Organic Carbon Content Prediction Using Large Language Models: A Case Study of the Black Soil and Windblown Sandy Soil Regions in Northeast China" Applied Sciences 16, no. 7: 3349. https://doi.org/10.3390/app16073349
APA StyleCui, H., Chang, X., & Gang, S. (2026). Optimizing Data Preprocessing and Hyperparameter Tuning for Soil Organic Carbon Content Prediction Using Large Language Models: A Case Study of the Black Soil and Windblown Sandy Soil Regions in Northeast China. Applied Sciences, 16(7), 3349. https://doi.org/10.3390/app16073349

