In the cophasing of the segmented optical mirrors, the Shack-Hartmann wavefront sensor is not sensitive to the submirror piston error and the large range piston errors beyond the cophasing detection range of phase diversity algorithm. It is necessary to introduce specific sensors (e.g., microlenses or prisms), but they greatly increase the complexity and manufacturing cost of the optical system. In this Letter, we introduce the convolutional neural network (CNN) to distinguish the piston error range of each submirror. To get rid of the dependence of the CNN dataset on the imaging target, we construct the feature vector by the in-focal and defocused images. The method surpasses the fundamental limit of the detection range by using different wavelengths. Finally, the results of the simulation experiment indicate that the method is effective.