Aiming at problems of high difficulty in parameter adjustment, low prediction accuracy and easy over-fitting in present coal-gangue image recognition methods in fully-mechanized caving face, a coal-gangue image recognition method in fully mechanized caving face based on random forest (RF) algorithm is proposed. Taking 6203 fully-mechanized caving face of Danshuigou Coal Mine as project background, coal-gangue image of caving mouth are collected and pre-processed by clipping, gray conversion, contrast enhancement and image filtering. Fifteen texture features of coal-gangue image are extracted by gray-gradient co-occurrence matrix. RF algorithm is used to rank the importance of the fifteen coal-gangue texture features, and the first five features are selected for dimension reduction. Recognition effect of RF algorithm on coal-gangue images before and after dimension reduction is analyzed. The results show that when the number of decision tree is 150 and the number of features in each split is calculated by logM2+1 method, accuracy rate of coal-gangue classification of RF model after dimension reduction is 97%, which is 4% higher than that before dimension reduction, accuracy rate coal-gangue classification is 0.98, recall rate is 0.96, and out-of-bag error rate reaches 9% after 50 iterations with stronger generalization.