Maintaining the integrity of pipelines over long distances is an ongoing challenge for oil and gas companies. Among many factors, corrosion is one of the major causes of pipeline failure. Therefore, timely and accurate detection of corrosion is crucial. Along with the growing use of In-Pipe Inspection Robot (IPIR) technologies, a camera-based visual inspection has become a reliable technique for pipe defects detection. However, the conventional manual surveying process by the operators shows a lack of efficiency in this task. This paper studies the application of YOLO, an image-processing algorithm based on Convolutional Neural Network (CNN), for automating corrosion inspection. The results demonstrate that the proposed method is capable of performing detection with an accuracy rate of 64% under AP75 threshold. The system developed can be a promising tool in providing real-time autonomous defect detection to enhance IPIR devices.