Highlights What are the main findings? The bagging prediction model demonstrated approximately 20% higher accuracy compared to the single ANN model. Accurate prediction of bearing layer depth is critical for improving urban resilience and infrastructure planning in smart cities. What are the implications of the main finding? The improved accuracy of the bagging model supports more reliable geotechnical investigations, which can lead to safer urban development in earthquake-prone areas. Improved prediction models for bearing layer depth can reduce the need for extensive in situ testing, lowering costs and increasing the efficiency of construction projects.Highlights What are the main findings? The bagging prediction model demonstrated approximately 20% higher accuracy compared to the single ANN model. Accurate prediction of bearing layer depth is critical for improving urban resilience and infrastructure planning in smart cities. What are the implications of the main finding? The improved accuracy of the bagging model supports more reliable geotechnical investigations, which can lead to safer urban development in earthquake-prone areas. Improved prediction models for bearing layer depth can reduce the need for extensive in situ testing, lowering costs and increasing the efficiency of construction projects.Abstract This paper examines how smart cities can address land subsidence and liquefaction in the context of rapid urbanization in Japan. Since the 1960s, liquefaction has been an important topic in geotechnical engineering, and extensive efforts have been made to evaluate soil resistance to liquefaction. Currently, there is a lack of machine learning applications in smart cities that specifically target geological hazards. This study aims to develop a high-performance prediction model for estimating the depth of the bearing layer, thereby improving the accuracy of geotechnical investigations. The model was developed using actual survey data from 433 points in Setagaya-ku, Tokyo, by applying two machine learning techniques: artificial neural networks (ANNs) and bagging. The results indicate that machine learning offers significant advantages in predicting the depth of the bearing layer. Furthermore, the prediction performance of ensemble learning improved by about 20% compared to ANNs. Both interdisciplinary approaches contribute to risk prediction and mitigation, thereby promoting sustainable urban development and underscoring the potential of future smart cities.