Pipeline safety inspections are particularly important because they are the most common means of energy transportation. Eddy current internal testing is a widely used technique for detecting pipe defects. However, in practice, the detection task cannot be completed owing to the problems of noise and interference, the small number of labeled pipeline defect samples, and unbalanced sample distribution. To address the above problems, this study proposes an unbalanced weighted KNN based on SVM defect detection algorithm. First, a multi-segment hybrid adaptive filtering algorithm is adopted to solve the problem of eddy current signal identification with strong interference and high noise, while retaining useful information such as defects. Then, the unbalanced weighted KNN based on SVM defect detection algorithm was used to solve the problems of low accuracy and large limitations. The experimental results show that, compared with the KNN and SVM algorithms, the detection rate, false detection rate, and missed detection rate of defects are significantly improved.