Infrared detection is a common means of inspecting current electrical equipment. It has the advantages of not requiring power outage, non-contact, non-disassembly, long-distance, large-area rapid scanning imaging, safety, reliability, accuracy, and efficiency. However, infrared images of electrical equipment often suffer from low image resolution and high background noise, which poses a certain challenge to the detection of electrical equipment. Therefore, this paper proposes an edge detection technique based on convolutional neural networks. Firstly, the NL-means algorithm is used to denoise the obtained infrared images of electrical equipment. Then, grayscale histogram equalization is applied to enhance the images. The preprocessed images are input into the convolutional neural network to obtain the final edge detection image. Experiments show that the algorithm proposed in this paper can effectively segment electrical equipment from the infrared detection images.