Urban canopy height is an essential indicator for characterizing vegetation structure and carbon sequestration, yet satellite LiDAR often lacks sufficient spatial resolution, airborne LiDAR is costly, and SAR has limited sensitivity to vegetation structure. This study proposes a canopy height inversion framework using high-resolution stereo pairs from the Gaofen-7 (GF-7) satellite. A 0.65 m Digital Surface Model (DSM) was generated from GF-7 data, and a relative surface height was derived by differencing the GF-7 DSM from a coarse 30 m DSM reference. Key features were selected via Boruta and Random Forest Recursive Feature Elimination (RF-RFE), and six models—linear, polynomial, support vector machine, backpropagation neural network, XGBoost, and RF—were compared. The results showed that the Boruta feature set improved average R2 by 8.2%. Among all models, RF performed best (test set R2 = 0.71, RMSE = 1.70 m) and exhibited the strongest resistance to overfitting. Canopy heights within Beijing’s Fifth Ring Road showed an “outer-high, inner-low” pattern: large parks exceeded 30 m, while the Central Business District remained below 3 m. GF-7 stereo pairs enable efficient and cost-effective retrieval of canopy height in fragmented urban green spaces, supporting ecological parameter quantification and urban green-space management.
Urban green spaces critically govern urban carbon cycling, though fragmentation and vegetation differences hinder precise carbon stock calculation. Targeting Beijing’s Fifth Ring Road area (666.5 km2), this study combined GF-7 sub-meter remote sensing imagery and field data from 750 sampling plots to build four machine learning models (RF, XGBoost, GBDT, BP neural network), adopting SHAP analysis to interpret feature importance and formulate carbon improvement schemes. XGBoost with the Boruta-selected feature set achieved robust performance (R2 = 0.83, RMSE = 1.79 kg/m2, MAE = 1.13 kg/m2), with its R2 elevated by 6.4%--38.7% compared to other algorithms. Canopy height dominated carbon storage variation (SHAP contribution: 0.321, 31.7% explanatory rate), and removing it cut model R2 by 47.98%. The region’s total above-ground vegetation carbon stock reached 9.04 × 105 Mg at a mean above-ground carbon density of 4.80 kg/m2; deciduous trees contributed the largest share (80.61%) of total above-ground carbon stock) and presented a low-inner, high-outer ring spatial distribution. Raising canopy height by 1 m could increase above-ground carbon storage by 21.38% within tree-covered areas, equivalent to a 4.10% increase in the total study-area carbon stock. The combined implementation of canopy height enhancement, a 10% replacement of shrub/grassland areas, and low-carbon sink area renovation could increase the total carbon storage by 8.82 × 104 Mg (with the low-carbon zone renovation alone contributing 1.76 × 104 Mg), representing a 9.76% enhancement potential over the current above-ground baseline.