Current edge detection algorithms based on convolutional neural network usually give the probability that each pixel in the image is an edge, namely the edge probability map. To address the problems of edge loss and discontinuity after edge probability map thinning, an edge thinning algorithm based on a gradient mask filter is proposed. To obtain the high-gradient and low-gradient masks, a dual threshold method based on the Canny edge detection algorithm is introduced. Then, an edge probability map filtered using the high gradient mask is enhanced, and that filtered by the low gradient mask is weakened. Finally, we performed non-maximum suppression on an edge probability map to obtain a binary edge map. The experimental results indicate that the proposed edge thinning algorithm provides more continuous edges and conforms to the single-edge response criterion.