With China’s fast expansion of urban traffic and railway engineering, a great number of subway and railway lines have been erected in subterranean tunnels in recent years. When the tunnel is in the process of construction, it will encounter the weak fracture zone, and the surrounding rock of this part of the tunnel is often poor stability and deformation is difficult to control, which will lead to the smooth progress of the project, delay and other problems. Therefore, to facilitate the timely treatment of tunnel soft surrounding rock, the study of image recognition of its stability is particularly important. Based on this, an improved local binary mode algorithm (ILBP) is proposed in this paper. By adjusting the weight of binary polynomial in local binary mode (LBP) operator, the target of ILBP is to extract the characteristics of weak surrounding rock of tunnel at a specific location, hoping to provide reference for the follow-up study of tunnel engineering.