In order to study the detection method of oil spill detection in underwater oil pipeline, the robot fish with autonomous decision making is designed based on the underwater robot platform, and the intelligent detection rule is used. The feasibility of the method is verified by experiments. The experimental results show that the robot can make the decision and carry out the task of underwater detection.