A slag-image acquisition system of tunnel boring machines(TBMs)is developed herein to predict the surrounding rock conditions at the excavation face in advance based on the characteristics of rock slag without halting the TBM.Slag images are captured under various surrounding rock conditions and processed using binarization and watershed segmentation methods.The curvature coefficient,nonuniformity coefficient,maximum particle size,and roughness index are used as slag grading characteristic indices.Eight models,namely linear,logarithmic,inverse,quadratic,power,compound,S-curve,and growth,are employed to establish relationships among rock-slag grading parameters and the types,uniaxial compressive strengths,and integrity coefficients of surrounding rocks.The results indicate the following:(1)The curvature coefficient of slag decreases while the nonuniformity coefficient,maximum particle size,and roughness index increase as surrounding rock conditions deteriorate.(2)The curvature coefficient of rock slag increases while the nonuniformity coefficient,maximum particle size,and roughness index decrease with increasing uniaxial compressive strength of rock.(3)The curvature coefficient of rock slag increases while the nonuniformity coefficient,maximum particle size,and roughness index decrease with increasing rock integrity coefficient.