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.