In view of the inevitable error problems caused by peak extraction, calibration curve fitting and other essential operations in the traditional data processing of chromatic confocal microscopy (CCM), a regression model based on convolutional neural network (CNN) is proposed so that the above necessary operations are no longer required. This CNN-based regression model draws on the core concepts of the AlexNet model and has been moderately customized and optimized to make it more suitable for CCM application scenarios. The proposed method has been validated using a completely homemade CCM apparatus The experimental results showed that the CNN-based method is feasible for the CCM measurement and exhibits better stability and higher axial resolution than traditional methods, indicating that deep learning has good application value in the data processing of CCM.