In this paper, machine vision technology is used to recognize the coal flow on a conveyor belt and control the running speed of a motor according to the coal flow on the conveyor belt to achieve an energy-saving effect and provide technical support for the sustainable development of energy. In order to improve the accuracy of coal flow recognition, this paper proposes the color gain-enhanced multi-scale retina algorithm (AMSRCR) for image preprocessing. Based on the YOLOv8s-cls improved deep learning algorithm YOLO-CFS, the C2f-FasterNet module is designed to realize a lightweight network structure, and the three-dimensional weighted attention module, SimAm, is added to further improve the accuracy of the network without introducing additional parameters. The experimental results show that the recognition accuracy of the improved algorithm YOLO-CFS reaches 93.1%, which is 4.8% higher, and the detection frame rate reaches 32.68 frame/s, which is 5.9% higher. The number of parameters is reduced by 28.4%, and the number of floating-point operations is reduced by 33.3%. These data show that the YOLO-CFS algorithm has significantly improved the accuracy, lightness, and reasoning speed in the coal mine environment. Furthermore, it can satisfy the requirements of coal flow recognition, realize the energy-saving control of coal mine conveyor belts, and achieve the purpose of sustainable development of the coal mining industry.