Most of the current image edge detection methods rely on manually features to extract the edge, there are often false and missed detections when the image has adverse interference. The surface of mechanical parts is smooth, when taking photos in the industrial field, it is easy to have specular reflection and shadow at the same time, which will affect the edge detection results. In order to achieve excellent edge detection performance, we propose a semantic segmentation model based on encoder-decoder structure. It adopts joint learning strategy, using two decoders to process image decomposition task and segmentation task respectively, and sharing their parameters to eliminate the influence of illumination, so as to improve segmentation performance. In the training phase, the asymmetric convolution and BN fusion are combined to improve the detection efficiency. In addition, we built a gear part dataset for experimentation. The result shows that in the task of edge detection of mechanical parts affected by illumination, our method has better performance than classical method.