The classification and analysis of coal are crucial for energy production and resource management. Shadowgraphy, leveraging variations in air refractive index and transmittance caused by shockwaves, presents a simple and accessible approach for the classification and component analysis of energetic materials. In this study, we developed an automated laser excitation and image acquisition system utilizing optical fibers of varying lengths. This method enables high-resolution imaging of the laser-induced shock wave propagation process within a range from hundreds of nanoseconds to several microseconds, without reducing imaging resolution as traditional high-speed cameras do when increasing frame rates. A convolutional neural network (CNN) was employed to analyze these shadowgrams, achieving a classification accuracy of 98.38% across 29 types of coal. Furthermore, we successfully predicted key content of coal such as ash content, volatile matter, and fixed carbon. The results showed that ash content yielded root mean square error of prediction (RMSEP) of 1.75%, while volatile matter and fixed carbon were RMSEP of 1.04% and 2.74%, respectively. In a laboratory setting, this powerful classification and content prediction method offers promising applications in material screening and identification.