With the rapid development of Chinese cities, the spatial pattern in historical districts has deteriorated due to a lack of protection measures. Indigenous communities have taken it upon themselves to expand certain spaces around the original residential buildings in order to meet the demands of modern life. However, this expansion has had a negative impact on the stylistic integrity of historical districts, leading to a conflict between cultural heritage and district protection. This study focuses on Tanhualin, a representative historical district in Wuhan. The study divides the district into 10 sub-areas, extracting a total of 4850 street views and selecting 6752 spontaneous spatial samples from them. Utilizing the Mask R-CNN model, the study uses computer-based deep learning to identify, summarize, and categorize the various forms and functions of these spontaneous spaces. The study also analyzes the negative impact of these spaces on the unity of the historical blocks’ interfaces, as well as their positive impact on cultural heritage and the creation of a distinctive atmosphere. Finally, the study proposes reconstruction and renewal strategies from both urban design and architectural design perspectives. These strategies aim to improve the quality of life for indigenous communities, establish a sustainable system for preserving historical imprints, protect the cultural atmosphere of historical blocks, and enhance the adaptability of these blocks in modern cities.