In the process of coal mining, one of the main reasons for the high labor intensity of workers and the frequent occurrence of casualties is the low level of intelligence of coal mining equipment. As the core equipment in the process of coal mining, the intelligence level of shearers directly affects the safety production and mining efficiency of coal mines. Coal and rock recognition technology is the core technology used to realize the intelligentization of shearers, which is an urgent technical problem to be solved in the field of coal mining. In this paper, coal seam images, rock stratum images, and coal–rock mixed-layer images of a coal mining area are taken as the research object, and key technologies such as the construction of a sample image library, classification and recognition, and semantic segmentation are studied by using the relevant theoretical knowledge of artificial neural network models. Firstly, the BP neural network is used to classify and identify coal seam images, rock stratum images, and coal–rock mixed-layer images, so as to distinguish which of the current mining targets of a shearer is the coal seam, rock stratum, or coal–rock mixed layer. Because different mining objectives will lead to different working modes of a shearer, it is necessary to maintain normal power to cut coal when encountering a coal seam, to stop working when encountering rock stratum, and to cut coal along the boundary between a coal seam and rock stratum when encountering a coal–rock mixed stratum. Secondly, the DeepLabv3+ model is used to perform semantic segmentation experiments on the coal–rock mixed-layer images. The purpose is to find out the distribution of coal and rocks in the coal–rock mixed layer in the coal mining area, so as to provide technical support for the automatic adjustment height of the shearer. Finally, the research in this paper achieved a 97.16% recognition rate in the classification and recognition experiment of the coal seam images, rock stratum images, and coal–rock mixed-layer images and a 91.2% accuracy in the semantic segmentation experiment of the coal–rock mixed-layer images. The research results of the two experiments provide key technical support for improving the intelligence level of shearers.