This study employs advanced ultrasonic tomography and Grasshopper software to investigate the internal anomalies within stone materials. We aim to enhance the non-destructive testing (NDT) methods with potential applications extending to modern architecture and stone engineering. Cavity damage and internal defects threaten the structural stability of stone cultural relics. Traditional non-destructive testing methods, while practical, have limitations in assessing these relics comprehensively. This paper proposes an enhanced ultrasonic testing method based on mathematical analysis to accurately detect cavity damage in stone cultural relics. We also investigate imaging techniques for internal defects, combining ultrasonic testing with Grasshopper software for efficient and accurate defect characterization. Additionally, we introduce an acoustic tapping method for detecting internal defects in ancient building stones. Verified through field tests and data analysis, this method is non-invasive, accurate, and fast. The process of detecting stone defects using this technology, along with data analysis methods, experimental results, and application effects, are detailed. This research contributes to the improved preservation and restoration of ancient buildings and extends to other fields, such as modern architecture and stone engineering, highlighting its significance in cultural heritage conservation.