Abstract:
To address the influence of regional heterogeneity on model performance in county-level apple yield prediction across different production areas, this study developed a region-adaptive Residual Network-Vision Transformer (ResNet-ViT) model for predicting apple yield per unit area at the county level. The study covered 22 counties in three major apple-producing cities of Gansu Province, China, namely Tianshui, Pingliang, and Qingyang, and comprised 154 county-year samples from 2018 to 2024. Multi-source inputs were organized according to the apple growing season from April to October. For each month, seven remote-sensing indices and four meteorological variables were assembled into an 11-dimensional dynamic feature vector, forming a seven-month time series. Orchard area, elevation, slope, and aspect were used as static auxiliary features, while a learnable county embedding was introduced to represent relatively stable regional attributes. In the dual-branch architecture, the ResNet branch extracted local temporal variations among adjacent months, whereas the ViT branch modeled long-range dependencies over the entire growing season. Bidirectional feature interaction was used to exchange local and global temporal information between the two branches. An Adaptive Temporal Context Module (ATCM) was introduced to aggregate temporal information at multiple receptive-field scales, and a Dual-Gated Feature Decoder (DGFD) was employed to decode and fuse hierarchical features through gated weighting before regression. Data from 2018-2022 were used for training, data from 2023 for validation, and data from 2024 for independent testing, thereby maintaining a strict temporal extrapolation setting. To evaluate the influence of regional heterogeneity, a unified model trained using samples from all three cities was compared with city-specific models trained separately for Tianshui, Pingliang, and Qingyang. The unified and city-specific models used the same feature construction, temporal split, training configuration, and five fixed random seeds to ensure direct comparability. Model performance was evaluated using the root mean square error (RMSE), mean absolute error (MAE), coefficient of determination (
R2), normalized root mean square error (nRMSE), and mean absolute percentage error (MAPE). The pooled
R2 of the unified three-city model was 0.66±0.04. After city-specific modeling, the
R2 values for Tianshui, Pingliang, and Qingyang reached 0.85±0.07, 0.94±0.03, and 0.81±0.04, respectively. When the 22 independent test counties were pooled, the city-specific models achieved an RMSE of 2,498.25±311.70 kg/hm
2, an MAE of 1,983.75±316.80 kg/hm
2, and an
R2 of 0.90±0.02. Averaging predictions from the five fixed random seeds further yielded a pooled RMSE of 2,283.30 kg/hm
2, an MAE of 1,776.00 kg/hm
2, and an
R2 of 0.92. Among the baseline models, bidirectional long short-term memory (BiLSTM) achieved the highest pooled
R2 of 0.81±0.03, whereas the ResNet-ViT model reached 0.90±0.02 under the same evaluation setting. Ablation experiments showed that bidirectional interaction produced higher prediction accuracy than configurations without intermediate cross-branch interaction or with only one-way interaction. Removing ATCM or DGFD from the bidirectional configuration reduced
R2 and increased prediction errors, indicating that multi-scale temporal context modeling and hierarchical gated feature decoding contributed to model performance. In the multi-source feature comparison, the full feature configuration achieved a pooled
R2 of 0.90±0.02, compared with 0.88±0.03 when only remote-sensing time-series features were used, whereas the historical-mean-yield baseline produced an
R2 of -0.09. Rolling temporal extrapolation yielded pooled
R2 values of 0.63±0.06, 0.78±0.03, and 0.90±0.02 when 2022, 2023, and 2024 were used as test years, respectively. County-held-out spatial validation yielded a pooled coefficient of determination of −0.12±0.30. All annual samples from each held-out county were excluded from training and validation. This result indicated limited generalization to unseen counties despite the improved temporal prediction obtained through city-specific modeling. The approach was therefore more suitable for apple-producing areas with continuous remote-sensing and meteorological records and historical yield samples. Application to new counties would require representative local samples for calibration. Further independent validation across additional regions and years, and under extreme climatic conditions, would be needed to assess broader applicability beyond the three cities examined in this study.