This study investigates the damage evolution of sandstone under loading stresses, which can lead to irreversible plastic deformation and reduced project stability service life. To achieve this objective, we identify and quantify the emergence and expansion process of sandstone cracks using deep learning methods. Specifically, our approach employs a crack segmentation model enhanced by an attention mechanism, achieving a remarkable effective crack detection MIoU of 93.38. Through the application of connectivity domain analysis, skeleton extraction, and orthogonal projection techniques, we extract crucial crack parameters, which are subsequently formulated into equations to determine their actual dimensions. These evolving parameter variations serve as the foundation for predicting the sandstone's entire damage progression, encompassing both microscopic crack growth and eventual catastrophic failure preceding macroscopic manifestation of damage. Validation of our method through uniaxial compression tests on sandstone specimens confirm its efficacy and practical applicability. In conclusion, this study presents a novel framework for quantifying sandstone crack evolution, providing invaluable insights into the intricate mechanisms governing damage fracture progression in rocks.