## 5 Conclusions  
This study established a comprehensive feature database incorporating multiple data sources, including POIs, Luojia 1 (LJ-01) nighttime light data, land use data, and DEM, to develop an XGBoost model for estimating the 2018 population spatial distribution across different grid scales in Shanghai. We validated the model's accuracy using both official statistical data and the WorldPop dataset, while employing the SHAP method to identify key influencing variables and analyze their spatial distribution characteristics. Additionally, we evaluated the suitability of various grid scales for population spatialization in Shanghai, with the principal findings summarized as follows:  
1. Through five-fold cross-validation, we identified optimal parameters to construct an XGBoost model for population spatialization, which estimated the population density distribution at 100 m, 200 m, 300 m, and 500 m grid scales. The population spatialization models achieved a determination coefficient (R\({}^{2}\)) exceeding 0.83 across all scales. The accuracy validation demonstrated that the XGBoost-based population spatialization results outperformed the WorldPop dataset, which may be attributed to the integration of finer-grained data features such as Shanghai's POI data. These results demonstrate strong correlation between the model's estimates and official statistics, indicating that the model constructed for Shanghai's population spatialization based on multi-dimensional datasets is highly reliable;
2. The ranking of feature variables influencing population estimation results was determined based on SHAP values. The SHAP values for address information, access facilities, and dwellings consistently rank among the top three across all districts, demonstrating stronger overall impacts on population spatialization in suburban areas than in urban centers. These features exhibit non-monotonic influences on the population estimation, revealing distinct regional variations in their effects. In urban centers, individual features show significant positive effects on the population spatial distribution. This positive influence progressively diminishes toward the suburbs, where the negative influence becomes more pronounced. The XGBoost-SHAP method effectively explains the key influencing features of population spatialization and their spatial distribution characteristics. Demonstrating strong generalizability, this approach provides a robust methodological framework for population estimation and analysis of distribution heterogeneity across cities with different typologies and varying levels of data availability;
3. The estimated population density of Shanghai across different grid scales demonstrates consistent spatial characteristics, exhibiting a gradient decrease from the urban centers to the surrounding suburbs. Notably, as the grid scale increases, the distribution of local population density tends to become more dispersed. The comprehensive accuracy evaluation metrics and landscape ecology indices indicate that the population estimation results at the 100 m grid scale have the highest accuracy and effectively reflect the population spatial distribution heterogeneity. These findings strongly support the recommendation of 100 m as the most appropriate grid scale for population spatialization estimation in Shanghai. The high-accuracy population estimation outcomes in Shanghai facilitate the detection of latent urban development imbalances, thereby offering empirical foundations for enhancing functional district planning and the judicious allocation of spatial resources. Conceptualization, Y.C. and H.W. ; methodology, Y.C. and L.G. ; software, X.W. ; validation, Y.C., L.G. and X.W. ; formal analysis, A.Z. ; investigation, X.W. ; data curation, L.G. ; writing--original draft preparation, Y.C. ; writing--review and editing, H.W. and A.Z. ; visualization, L.G. ; supervision, A.Z. ; funding acquisition, H.W. All authors have read and agreed to the published version of the manuscript.