Apple quality multi-index prediction model construction and total acid specificity optimization method based on climate soil synergistic effect
By constructing an apple quality prediction model based on the synergistic effect of climate and soil, the problem of low accuracy in quality prediction in existing technologies has been solved. This model achieves accurate prediction of multiple indicators and optimization of total acidity, thereby improving the prediction accuracy and depth of understanding of apple quality.
Patent Information
- Application Number
- CN202610107624.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-27
- Publication Date
- 2026-05-19
AI Technical Summary
Existing technologies are insufficient to fully explore the interaction effects between climate and soil factors, resulting in inconsistent accuracy in predicting multiple indicators of apple quality. In particular, the targeted optimization of key quality indicators is inadequate, failing to meet the actual needs of precision apple cultivation.
A multi-indicator prediction model for apple quality based on the synergistic effect of climate and soil was constructed. Through data collection and preprocessing, feature engineering, construction and screening of general models for multiple quality indicators, and combined with specialized feature engineering and ensemble learning, the total acid prediction model was optimized.
The model achieved general prediction of seven apple quality indicators and targeted optimization of the total acid indicator, significantly improving prediction accuracy and robustness. The R² of the total acid prediction model on the test set reached 0.8734, with an average relative error of only 9.56%. It clarified the key driving factors for total acid formation and provided a theoretical basis for precise improvement of apple quality.
Smart Images

Figure CN122067651A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information-based agricultural technology, specifically to the construction of a multi-indicator prediction model for apple quality based on the synergistic effect of climate and soil, and a method for specific optimization of total acidity. Background Technology
[0002] The intrinsic qualities of apples (such as sugar and acid content) directly determine their market value and consumer preferences. The formation of these traits is comprehensively regulated by the dynamic changes in climate during the growing season and the soil environment in the rhizosphere. Traditional studies often focus on the linear effects of single environmental factors, making it difficult to reveal the nonlinear nature of the synergistic effects of multiple factors. This results in a lack of in-depth understanding of the mechanisms of apple quality formation and insufficient accuracy and practicality of predictive models.
[0003] Machine learning provides an effective tool for handling complex, high-dimensional, nonlinear problems; however, model performance and interpretability heavily depend on the quality of input features. Current technologies lack a systematic research framework integrating basic statistical analysis, feature engineering, and differential modeling, making it difficult to fully explore the interaction effects between climate and soil factors. This results in inconsistent prediction accuracy for multiple quality indicators, particularly insufficient targeted optimization of key quality indicators, failing to meet the practical needs of precision apple cultivation. Therefore, there is an urgent need to develop a technical method that can fully capture the synergistic effects of climate and soil, balancing general prediction of multiple quality indicators with precise optimization of key indicators. Summary of the Invention
[0004] The purpose of this invention is to provide a method for constructing a multi-index prediction model for apple quality based on the synergistic effect of climate and soil, and a method for optimizing total acidity specifically, so as to solve the problems mentioned in the background art.
[0005] To achieve the above objectives, the present invention provides the following technical solution: a method for constructing a multi-indicator prediction model for apple quality based on the synergistic effect of climate and soil, comprising the following steps: Data collection and preprocessing: Collect climate indicators, soil chemical indicators and quality indicators corresponding to apple samples, standardize all continuous variables, and divide the training set and test set according to a preset ratio. Feature engineering: Based on agronomic knowledge, high-order features are constructed to form an engineered feature pool. The high-order features include interactive features, seasonal aggregation features, soil-climate balance features, and ratio features. Construction and selection of general models for multiple quality indicators: Using an engineered feature pool, various machine learning algorithms are applied to model each quality indicator. By comparing the R² of the test set and the stability of cross-validation, the optimal basic model for each quality indicator is determined.
[0006] Preferably, in step a, the climate indicators include 71 monthly scale temperature, precipitation, and sunshine-related indicators; the soil chemical indicators include 9 exchangeable calcium and magnesium, available trace elements, organic matter, and pH-related indicators; and the quality indicators include 7 indicators such as soluble solids, total acid, sorbitol, glucose, fructose, sucrose, and total sugar.
[0007] Preferably, in step a, the preset ratio is training set:test set = 8:2, and the standardization process uses the Z-score standardization method.
[0008] Preferably, in step b, the interaction features are combinations of interaction between climate factors and soil factors, including annual average rainfall-soil pH interaction and organic matter-exchangeable calcium interaction; the seasonal aggregation features include average temperature during the growing season and average temperature in autumn; the soil-climate balance features include soil pH-temperature balance and organic matter-rainfall balance; and the ratio features include calcium-magnesium ratio and the ratio of available iron to average temperature during the growing season.
[0009] Preferably, in step c, the machine learning algorithm includes linear regression, ridge regression, Lasso, support vector machine, random forest, gradient boosting, XGBoost, LightGBM, and neural networks.
[0010] Preferably, the apple quality prediction method according to any one of claims 1-5 further includes the following steps: Specialized feature engineering: For the total acid index, temperature transformation items and refined interaction items are created on the basis of the engineered feature pool to expand the feature dimensions; Core feature selection: A hybrid strategy combining random forest importance assessment and correlation analysis is used to select core features from the expanded feature set; Ensemble model construction and optimization: The model is constructed using LightGBM, XGBoost, random forest algorithms and voting ensemble method, and the hyperparameters are optimized through grid search to obtain the optimized model for total acid prediction.
[0011] Preferably, in step b, the number of core features selected includes the ratio of effective iron to average temperature during the growing season, the square term of diurnal temperature range, and the ratio of pH to total rainfall during the growing season.
[0012] Preferably, in step c, the test set R² of the total acid prediction optimization model is ≥0.87, and the average relative error is ≤9.6%.
[0013] Preferably, in the total acid prediction optimization model, the importance of the core driving factors is ranked as follows: ratio of available iron to average temperature during the growing season > square term of diurnal temperature difference > ratio of pH to total rainfall during the growing season.
[0014] Compared with the prior art, the beneficial effects of the present invention are: This invention constructs a systematic basic statistical analysis-high-order feature engineering-two-stage modeling research framework, which breaks through the limitations of traditional single-factor linear analysis, effectively captures the nonlinear synergistic effect of climate-soil factors, and provides high-quality feature inputs and scientific modeling ideas for apple quality prediction.
[0015] Through a two-stage modeling strategy, we achieved general prediction of seven apple quality indicators and targeted optimization of the total acid indicator. The test set R² of the total acid prediction model reached 0.8734, with an average relative error of only 9.56%, and the prediction accuracy and robustness were significantly better than existing technologies.
[0016] The key driving factors for total acid formation were identified, including the ratio of available iron to average temperature during the growing season and the square term of diurnal temperature variation. This deepened the understanding of the environmental physiological mechanism of total acid formation in apples and provided a clear theoretical basis for achieving precise improvement in apple quality by regulating environmental factors.
[0017] The method of this invention has strong versatility and practicality, and can be extended to quality prediction and precision cultivation guidance in different apple growing areas, which is of great significance to improving the scientific and intelligent level of the apple industry. Attached Figure Description
[0018] Figure 1 This is a flowchart of the present invention. Detailed Implementation
[0019] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0020] In the description of this invention, it should be understood that the terms "upper", "lower", "front", "rear", "left", "right", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.
[0021] Example: Please see Figure 1 The present invention provides the following technical solution: The apple quality prediction method based on climate-soil synergy includes three core steps: data collection and preprocessing, feature engineering, and construction and screening of a general model for multiple quality indicators.
[0022] During the data collection phase, data on 71 climate indicators, 9 soil chemical indicators, and 7 quality indicators were collected from over 198 apple samples to ensure the comprehensiveness and representativeness of the data. In the preprocessing stage, Z-score standardization was used to process continuous variables, eliminating the influence of dimensions, and the training and test sets were divided in an 8:2 ratio to ensure the reliability of model training and validation.
[0023] In the feature engineering stage, four types of high-order features are constructed based on agronomic expertise, including interaction features between climate and soil factors, seasonal aggregation features, soil-climate balance features, and ratio features, which effectively capture the nonlinear synergistic effects between climate and soil factors.
[0024] In the stage of building a general model for multiple quality indicators, nine machine learning algorithms are applied to model the seven quality indicators respectively. By comparing the R² of the test set and the stability of cross-validation, the optimal basic model is selected for each indicator, so as to realize the differentiated general prediction of multiple quality indicators.
[0025] Building upon this, the present invention further provides an optimization method for predicting total acidity in apples. Based on the aforementioned general prediction method, it adds specific feature engineering, core feature selection, and integrated model construction and optimization steps. A temperature transformation term and a refined interaction term are created for the total acidity index. A hybrid strategy is used to select approximately 20 core features. Multiple integrated algorithms are used to construct the model and optimize hyperparameters, ultimately obtaining a high-precision optimized model for predicting total acidity.
[0026] I. Data Collection, Preprocessing, and Model Building: Data Sources and Collection Standards Climate index data: Meteorological observation data from apple-growing areas for 3-5 consecutive years will be collected, covering 71 monthly scale indicators, including: monthly average temperature, average monthly maximum temperature, average monthly minimum temperature, monthly extreme maximum temperature, monthly extreme minimum temperature, monthly average diurnal temperature range, monthly precipitation, monthly number of days with precipitation, monthly sunshine hours, and monthly sunshine percentage. The data accuracy must reach ±0.1℃ (temperature), ±0.1mm (precipitation), and ±0.1h (sunshine). The data sources include observation data from national meteorological stations, monitoring data from regional automatic weather stations, and calibrated satellite inversion data. Soil chemical index data: During the apple harvest season, soil samples from the 0-40cm soil layer of the orchard were collected using the "five-point sampling method". After natural air drying and grinding through a 2mm sieve, nine core indicators were tested: exchangeable calcium (cmol / kg), exchangeable magnesium (cmol / kg), available iron (mg / kg), available zinc (mg / kg), available manganese (mg / kg), available copper (mg / kg), organic matter (g / kg), soil pH (water-soil ratio 2.5:1), and cation exchange capacity (cmol / kg). The testing methods conformed to the standard of "Soil Agricultural Chemical Analysis Methods" (NY / T1121-2021). Quality index data: Apple fruit samples corresponding to soil samples were collected. For each sample, 30 undamaged and uniformly sized fruits were selected. Seven indicators were tested using national standard methods: soluble solids (handheld refractometer method, %), total acid (acid-base titration method, calculated as malic acid, g / 100g), sorbitol (high performance liquid chromatography, mg / g), glucose (high performance liquid chromatography, mg / g), fructose (high performance liquid chromatography, mg / g), sucrose (high performance liquid chromatography, mg / g), and total sugar (summation method, mg / g). Each indicator was measured in triplicate, and the average value was taken as the final data. Data preprocessing workflow Outlier handling: Box plot method (IQR=1.5) is used to identify outlier data, and the decision on whether to retain the data is based on the field survey. For missing values in climate data, if the missing values are ≤3 consecutive days, linear interpolation is used to fill them in. If the missing values are more than 3 days, spatiotemporal fusion of data from neighboring stations is used to fill them in. Missing values in soil and quality data need to be handled by supplementing sampling or deleting the corresponding samples to ensure sample integrity.
[0027] Standardization: Z-score standardization is applied to all continuous variables. The formula is: z=(x−μ) / σ, where x is the original data, μ is the sample mean, and σ is the sample standard deviation. After standardization, the mean of the data is 0 and the variance is 1, which eliminates the influence of dimensional differences on model training. Dataset partitioning: The dataset is randomly partitioned according to a ratio of 8:2 (training set:test set). Stratified sampling is used during the partitioning process to ensure that the distribution characteristics of each quality indicator in the training set and the test set are consistent, thus avoiding data bias that could lead to a decrease in the model's generalization ability. Feature engineering: Feature construction basis Based on the agronomic mechanisms of apple growth and development, this study focuses on the synergistic effects, seasonal dynamic changes, and balance relationships of climate and soil factors, and constructs a high-order feature pool to compensate for the shortcomings of the original features in explaining complex physiological processes. Specific types of higher-order features Interaction characteristics: Reflecting the synergistic effects of climate factors and soil factors, including annual average rainfall-soil pH interaction (product term), organic matter-exchangeable calcium interaction (product term), monthly average temperature-available iron interaction (product term), number of precipitation days-cation exchange capacity interaction (product term), etc., totaling 15 core interaction characteristics. Seasonal aggregated characteristics: Aggregated characteristics were constructed for key growth periods of apples, such as budding, flowering, fruit expansion and ripening. These included 22 seasonal characteristics, such as average temperature during the growing season (April-October), average temperature during autumn (September-October), cumulative precipitation during the fruit expansion period (June-August), average sunshine hours during the flowering period (April), and average diurnal temperature range during the ripening period (October). Soil-climate balance characteristics: Characterize the compatibility of soil physicochemical properties with climatic conditions, including soil pH-temperature balance (pH value / average temperature during the growing season), organic matter-rainfall balance (organic matter content / cumulative rainfall during the growing season × 100), total exchangeable calcium and magnesium-diurnal temperature range balance ((Ca+Mg) / average diurnal temperature range during the growing season), etc., a total of 8 balance characteristics. Ratio characteristics: Highlighting the relative content or intensity of key factors, including the calcium-magnesium ratio (exchangeable calcium / exchangeable magnesium), the ratio of available iron to average temperature during the growing season (available iron / average temperature during the growing season), the ratio of available zinc to sunshine during flowering (available zinc / cumulative sunshine during flowering), and the ratio of organic matter to annual precipitation (organic matter / cumulative annual precipitation × 10), totaling 12 ratio characteristics. Feature pool integration: The original features (71+9=80 items) and the higher-order features (15+22+8+12=57 items) are merged to form an engineered feature pool containing 137 features. Model selection criteria and process Evaluation metrics: The coefficient of determination (R²), mean absolute error (MAE), root mean square error (RMSE), and cross-validation stability (R² standard deviation of 5-fold cross-validation ≤ 0.05) are used as screening criteria, and models with high R², small error, and strong stability are given priority. Screening process: Nine candidate algorithms were trained using feature pool data for each of the seven quality indicators, and the initial parameters were optimized using 5-fold cross-validation. Verify the performance of each model using the test set and record the evaluation metrics. Exclude models that fail to meet the stability criteria for cross-validation, and sort the remaining models in descending order of R². Determine the optimal basic model for each quality indicator. For example, the optimal model for soluble solids is XGBoost, and the optimal model for total sugar is Random Forest. II. Optimization Method for Predicting Total Acid in Malic Acid Total acid content directly affects the flavor balance and storage characteristics of apples. Its formation process is comprehensively regulated by dynamic temperature changes, soil trace element availability, and water-salt balance. A single model is difficult to capture complex nonlinear relationships, so it is necessary to improve accuracy through specialized feature engineering and ensemble learning. Specialized Feature Engineering: Based on the engineered feature pool, two additional features are added to target the key physiological stages of total acid formation: Temperature variation terms include six features: the square of diurnal temperature range ((daily maximum temperature - daily minimum temperature)²), the logarithm of accumulated temperature during the growing season (ln(accumulated temperature ≥10℃)), the number of days with low temperature during the maturity period (cumulative number of days ≤15℃), and the frequency of extreme low temperature during the flowering period (number of days ≤5℃). These features highlight the impact of temperature fluctuations on the synthesis and degradation of organic acids. Refined interaction terms: including pH to total rainfall during the growing season (pH / cumulative rainfall during the growing season × 1000), available iron-diurnal temperature range interaction term (available iron × diurnal temperature range), organic matter-average temperature at maturity interaction term (organic matter × average temperature at maturity), etc., a total of 8 features, to enhance the characterization of the synergistic effect of key factors. Extended feature set: 137 original features + 14 special supplementary features = 151 features. Core Feature Filtering A hybrid screening strategy combining random forest importance assessment and Pearson correlation analysis was adopted, and the process is as follows: Step 1: Use the Random Forest algorithm to rank the 151 features by importance, calculate the feature importance score (Gini coefficient), and select the top 30% of features (45 items). Step 2: Calculate the Pearson correlation coefficient between the screened features and the total acid content, retain the features with |r|≥0.3 (12 items), and exclude features with multicollinearity (VIF≥10); Step 3: Finally, three core characteristics were determined: the ratio of available iron to average temperature during the growing season, the square term of diurnal temperature range, and the ratio of pH to total rainfall during the growing season. Their correlation coefficients with total acid content were 0.68, 0.63, and 0.59, respectively, and VIF was ≤5 for all of them, with no obvious multicollinearity.
[0028] Integration Model Construction and Optimization Integrated model architecture A two-layer architecture is adopted, consisting of base model training and voting ensemble. Base models: LightGBM, XGBoost, and Random Forest were selected as base models, all of which were trained based on three core features; Integration strategy: A weighted voting method is adopted, and weights are assigned according to the 5-fold cross-validation R² of the base models. The weight calculation formula is wi=Ri2 / j=1∑3Rj2, where wi is the weight of the i-th base model and Ri2 is the cross-validation R² of the i-th base model. Hyperparameter optimization The hyperparameters of each base model were optimized using grid search combined with 5-fold cross-validation, with the following optimization range: LightGBM: num_leaves∈[31,63], learning_rate∈[0.03,0.05,0.07], n_estimators∈[300,500], reg_alpha∈[0.1,0.5]; XGBoost: max_depth∈[3,5,7], learning_rate∈[0.03,0.05,0.07], n_estimators∈[300,500], subsample∈[0.7,0.8]; Random forest: n_estimators∈[300,500,700], max_depth∈[10,15,20], min_samples_split∈[2,4].
[0029] Model performance metrics Test set R² ≥ 0.87, cross-validation R² ≥ 0.85; Mean relative error (MRE) ≤ 9.6%, mean absolute error (MAE) ≤ 0.12g / 100g; The importance ranking of core driving factors is as follows: ratio of available iron to average temperature during the growing season (38.2%) > square term of diurnal temperature range (32.7%) > ratio of pH to total rainfall during the growing season (29.1%). This ranking is consistent with the physiological mechanism of organic acid synthesis in apples (iron participates in the regulation of respiratory chain enzyme activity, temperature affects the activity of organic acid metabolic enzymes, and soil pH and moisture jointly affect nutrient absorption efficiency). III. Implementation Safeguards Data quality control: Establish a three-level quality control system of data collection, detection, and preprocessing. Climate data must undergo site consistency verification, and soil and quality data must have parallel samples of standard materials to ensure data accuracy ≥ 98%. Model portability: During model training, feature importance and parameter configuration are recorded. For different apple varieties, such as Fuji and Gala, model transfer can be achieved by fine-tuning feature weights. Real-time update mechanism: New climate-soil-quality data are added every year to incrementally train the model, update hyperparameters and feature importance rankings, and maintain the model's prediction accuracy.
[0030] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or basic characteristics. Therefore, the embodiments should be considered exemplary and non-limiting in all respects. The scope of the invention is defined by the appended claims rather than the foregoing description. Therefore, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the present invention, and no reference numerals in the claims should be construed as limiting the scope of the claims.
[0031] Example 1: Implementation of Multi-Indicator Prediction and Total Acid Optimization in Large-Scale Fuji Apple Planting Areas I. Implementation Background Luochuan County in Shaanxi Province is a major production area for Fuji apples in my country, with an average annual temperature of 9.2℃ and annual rainfall of 620mm. The soil is mainly loess with an organic matter content of 10-15g / kg. This project covers 10 core orchards, totaling 500 mu (approximately 33 hectares), and aims to construct a predictive model for seven quality indicators of Fuji apples in the region, and optimize the accuracy of total acid prediction, providing a basis for planting zoning and water and fertilizer management in the production area. II. Implementation Steps 1. Data Collection and Preprocessing 1.1 Data Acquisition Climate indicators: Monthly scale data from the Luochuan County meteorological station for 2018-2022 (5 years) were collected, covering 71 indicators. For example, the average temperature during the growing season (April-October) in 2022 was 16.8℃, the average temperature during autumn (September-October) was 13.5℃, and the cumulative precipitation during the fruit expansion period (June-August) was 280mm. The data accuracy met the requirements of ±0.1℃, ±0.1mm, and ±0.1h. Soil indicators: During the harvest season of 2022 (mid-October), soil samples from 0-40cm depth were collected in 10 orchards using a five-point sampling method. Nine indicators were tested, and the results showed that the average exchangeable calcium was 8.2 cmol / kg, the average exchangeable magnesium was 1.3 cmol / kg, the average available iron was 6.8 mg / kg, the average organic matter was 12.5 g / kg, and the average pH was 7.8. The testing methods complied with the NY / T1121-2021 standard. Quality indicators: Collect corresponding fruit samples, 30 fruits per orchard, and test 7 indicators, including an average total acid content of 0.38g / 100g, an average soluble solids content of 14.2%, and an average total sugar content of 12.5mg / g. The tests were performed in parallel 3 times, and the relative standard deviation (RSD) was ≤3% for each test. 1.2 Data Preprocessing Outlier handling: Two soil samples were identified as having abnormally high effective zinc levels using box plots. Based on field investigations, these samples were found to be contaminated and were removed. Climate data did not have any consecutive missing days exceeding 3 days, and sporadic missing values were filled using linear interpolation. Standardization: The Z-score formula is used to process all continuous variables. For example, the original soil organic matter data is 12.5 g / kg. After calculation, μ = 11.8 g / kg and σ = 1.2 g / kg, the standardized value is z = (12.5 - 11.8) / 1.2 ≈ 0.58. Dataset partitioning: A total of 450 valid samples were obtained (10 orchards × 45 samples / orchard). Stratified sampling was performed at an 8:2 ratio, with 360 samples in the training set and 90 samples in the test set to ensure that the seven quality indicators were distributed consistently in the two sets. 2. Feature Engineering Based on the scheme, an engineered feature pool of 137 features was constructed, including the following high-order features: Interaction characteristics: Annual average rainfall (620 mm) - soil pH (7.8) interaction term = 620 × 7.8 = 4836, organic matter (12.5 g / kg) - exchangeable calcium (8.2 cmol / kg) interaction term = 12.5 × 8.2 = 102.5, etc., 15 items. Seasonal aggregation characteristics: 22 items including average temperature during the growing season of 16.8℃ and average diurnal temperature range during the maturity period (October) of 10.2℃. Soil-climate balance characteristics: pH-temperature balance = 7.8 / 16.8≈0.46, organic matter-rainfall balance = 12.5 / 280×100≈4.46, etc., totaling 8 items. Ratio characteristics: calcium-magnesium ratio = 8.2 / 1.3≈6.31, available iron to average temperature during the growing season ratio = 6.8 / 16.8≈0.40, etc., 12 items. 3. Construction and Screening of a Universal Model for Multiple Quality Indicators Nine algorithms were trained for each of the seven quality indicators. After 5-fold cross-validation and validation on the test set, the selection results are as follows: 4. Optimization of total acid prediction 4.1 Specialized Feature Engineering Fourteen additional features were added, including the diurnal temperature range squared (10.2²=104.04) and the ratio of pH to total rainfall during the growing season (7.8 / 280×1000≈27.86), expanding the feature set to 151 features. 4.2 Core Feature Filtering After random forest importance assessment (screening the top 45 items), Pearson correlation analysis (retaining 12 items with |r|≥0.3), and multicollinearity test (excluding features with VIF≥10), three core features were finally determined: Available iron to average temperature during the growing season (r=0.69, VIF=3.2) The square term of diurnal temperature range (r=0.64, VIF=2.8) pH to total rainfall during the growing season (r=0.60, VIF=3.5) 4.3 Integration Model Construction and Optimization Base model training: LightGBM, XGBoost, and Random Forest are trained based on three core features, and their 5-fold cross-validation R² values are 0.84, 0.83, and 0.82, respectively. Weighting: LightGBM weight = 0.84² / (0.84²+0.83²+0.82²)≈0.34, XGBoost weight≈0.33, Random Forest weight≈0.33. Hyperparameter optimization: Determine the optimal parameters through grid search, for example, LightGBM's num_leaves=63, learning_rate=0.05, n_estimators=400, reg_alpha=0.3.
[0032] Model performance: R²=0.88, MRE=8.9%, MAE=0.034g / 100g on the test set, and the importance ranking of the core driving factors is consistent with the scheme. III. Implementation Results The constructed multi-index prediction model can accurately predict seven quality indicators of Luochuan Red Fuji apples. The total acid optimization model has an R² of 0.88, which is better than the required 0.87. This provides data support for the production area to formulate management measures such as increasing the application of organic fertilizer to improve organic matter, adjusting soil pH to 7.0-7.5, and controlling the diurnal temperature difference during the growing season. Example 2: Implementation of Multi-Indicator Prediction and Total Acidity Optimization in Gala Apple Specialty Planting Area I. Implementation Background Yantai, Shandong Province, is a distinctive Gala apple producing area with an average annual temperature of 12.6℃ and annual rainfall of 720mm. The soil is mainly brown loam with an organic matter content of 15-20g / kg. This project covers 8 premium orchards, totaling 200 mu (approximately 33 acres), aiming to adapt to the characteristics of early-maturing Gala apple varieties, construct a quality prediction model, and optimize total acidity prediction to support precise quality control of early-maturing apples. II. Implementation Steps 1. Data Collection and Preprocessing 1.1 Data Acquisition Climate indicators: Monthly data from the Yantai Muping District meteorological station for 2019-2023 (5 years) were collected. Among the 71 indicators, the average temperature during the growing season (April-September, Gala apples mature in early September) in 2023 was 18.5℃, the cumulative precipitation during the fruit expansion period (June-August) was 320mm, and the average sunshine duration during the flowering period (April) was 6.8h / d. Soil indicators: During the harvest season at the end of August 2023, soil samples were collected from 8 orchards using the five-point sampling method, and 9 indicators were tested: exchangeable calcium average 9.5 cmol / kg, exchangeable magnesium average 1.5 cmol / kg, available iron average 8.2 mg / kg, organic matter average 17.8 g / kg, and pH average 6.9. Quality indicators: 30 fruit samples were taken from each orchard, and 7 indicators were tested. The average total acid content was 0.42g / 100g, the average soluble solids content was 13.8%, the average total sugar content was 11.8mg / g, and the RSD of parallel determinations was ≤3%. 1.2 Data Preprocessing Outlier handling: There were no outliers. Missing values in the climate data were filled using linear interpolation. There were no missing values in the soil and quality data. Standardization: Processed according to the Z-score formula. For example, if the original effective iron data is 8.2 mg / kg, μ=7.9 mg / kg, σ=1.5 mg / kg, after standardization z=(8.2-7.9) / 1.5=0.2. Dataset split: 320 valid samples, 256 in the training set and 64 in the test set. Stratified sampling ensures consistent distribution of indicators. 2. Feature Engineering Construct a feature pool of 137 items; example of high-order features: Interaction characteristics: Annual average rainfall 720mm - soil pH 6.9 interaction term = 720 × 6.9 = 4968, organic matter 17.8g / kg - exchangeable calcium 9.5cmol / kg interaction term = 17.8 × 9.5 = 169.1. Seasonal aggregation characteristics: average temperature during the growing season is 18.5℃, and average temperature in autumn (August-September) is 20.1℃.
[0033] Soil-climate balance characteristics: pH-temperature balance = 6.9 / 18.5≈0.37, organic matter-rainfall balance = 17.8 / 320×100≈5.56. Ratio characteristics: calcium-magnesium ratio = 9.5 / 1.5 ≈ 6.33, available iron to average temperature during the growing season ratio = 8.2 / 18.5 ≈ 0.44. 3. Construction and Screening of a Universal Model for Multiple Quality Indicators Optimal model and performance for 7 quality indicators: 4. Optimization of total acid prediction 4.1 Specialized Feature Engineering Fourteen additional characteristics were added, including the logarithmic term of accumulated temperature during the growing season (ln(≥10℃ accumulated temperature 3200℃) = 8.07) and the interaction term of effective iron-diurnal temperature difference (8.2 × 11.5 = 94.3, the average diurnal temperature difference during the Gala maturity period is 11.5℃). 4.2 Core Feature Filtering Three core characteristics were ultimately identified: the ratio of available iron to average temperature during the growing season (r=0.71, VIF=2.9), the square term of diurnal temperature range (r=0.66, VIF=3.1), and the ratio of pH to total rainfall during the growing season (r=0.62, VIF=3.3). 4.3 Integration Model Construction and Optimization The base model cross-validation R² was: LightGBM (0.86), XGBoost (0.85), and Random Forest (0.84), with weights of 0.35, 0.33, and 0.32, respectively. Hyperparameter optimization: For example, XGBoost's max_depth=5, learning_rate=0.05, n_estimators=450, subsample=0.75. Model performance: R²=0.89, MRE=8.3%, MAE=0.032g / 100g on the test set, and the importance ranking of the core driving factors is consistent with the scheme. III. Implementation Results The model adapted to the early-maturing characteristics of Gala apples performed excellently, with an R² of 0.89 for the total acid optimization model and a MRE of only 8.3%, lower than the required 9.6%. Based on the model results, targeted measures were proposed, including supplementing foliar iron fertilizer during flowering to increase available iron content, using shading nets to regulate diurnal temperature differences during ripening, and timely drainage during the rainy season to regulate soil moisture and pH balance. These measures effectively improved the flavor consistency of Yantai Gala apples.
[0034] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method for constructing a multi-indicator prediction model for apple quality based on the synergistic effect of climate and soil, characterized in that, Includes the following steps: Data collection and preprocessing: Collect climate indicators, soil chemical indicators and quality indicators corresponding to apple samples, standardize all continuous variables, and divide the training set and test set according to a preset ratio. Feature engineering: Based on agronomic knowledge, high-order features are constructed to form an engineered feature pool. The high-order features include interactive features, seasonal aggregation features, soil-climate balance features, and ratio features. Construction and selection of general models for multiple quality indicators: Using an engineered feature pool, various machine learning algorithms are applied to model each quality indicator. By comparing the R² of the test set and the stability of cross-validation, the optimal basic model for each quality indicator is determined.
2. The method for constructing a multi-indicator prediction model for apple quality based on climate-soil synergy according to claim 1, characterized in that, In step a, the climate indicators include 71 monthly scale temperature, precipitation, and sunshine-related indicators; the soil chemical indicators include 9 exchangeable calcium and magnesium, available trace elements, organic matter, and pH-related indicators; and the quality indicators include 7 indicators such as soluble solids, total acid, sorbitol, glucose, fructose, sucrose, and total sugar.
3. The method for constructing a multi-indicator prediction model for apple quality based on climate-soil synergy according to claim 1, characterized in that, In step a, the preset ratio is training set:test set = 8:2, and the standardization process uses the Z-score standardization method.
4. The method for constructing a multi-indicator prediction model for apple quality based on climate-soil synergy according to claim 1, characterized in that, In step b, the interaction features are the interaction combination of climate factors and soil factors, including annual average rainfall-soil pH interaction and organic matter-exchangeable calcium interaction; the seasonal aggregation features include average temperature during the growing season and average temperature in autumn; the soil-climate balance features include soil pH-temperature balance and organic matter-rainfall balance; the ratio features include calcium-magnesium ratio and the ratio of available iron to average temperature during the growing season.
5. The method for constructing a multi-indicator prediction model for apple quality based on climate-soil synergy according to claim 1, characterized in that, In step c, the machine learning algorithms include linear regression, ridge regression, Lasso, support vector machine, random forest, gradient boosting, XGBoost, LightGBM, and neural networks.
6. An optimization method for predicting total acidity in maize based on climate-soil synergy, characterized in that, Based on the apple quality prediction method according to any one of claims 1-5, also Includes the following steps: Specialized feature engineering: For the total acid index, temperature transformation items and refined interaction items are created on the basis of the engineered feature pool to expand the feature dimensions; Core feature selection: A hybrid strategy combining random forest importance assessment and correlation analysis is used to select core features from the expanded feature set; Ensemble model construction and optimization: The model is constructed using LightGBM, XGBoost, random forest algorithms and voting ensemble method, and the hyperparameters are optimized through grid search to obtain the optimized model for total acid prediction.
7. The method for predicting and optimizing total acidity in apples according to claim 6, characterized in that, In step b, the number of core features selected includes the ratio of available iron to average temperature during the growing season, the square term of diurnal temperature range, and the ratio of pH to total rainfall during the growing season.
8. The method for predicting and optimizing total acidity in apples according to claim 6, characterized in that, In step c, the test set R² of the total acid prediction optimization model is ≥0.87, and the average relative error is ≤9.6%.
9. The method for predicting and optimizing total malic acid according to claim 6, characterized in that, In the total acid prediction optimization model, the importance of the core driving factors is ranked as follows: ratio of available iron to average temperature during the growing season > square term of diurnal temperature range > ratio of pH to total rainfall during the growing season.
