The unmanned underwater vehicle (UUV) group composed of UUVs carrying different kinds of detection equipment is powerful for underwater target searching and detection. In this paper, a formation transformation method, used while the mission of the UUV group transformed from searching to detecting, is proposed. Firstly, a new formation transformation strategy, in which the UUVs converged to their detection points followed by the aggregation points achieved, is proposed to improve the safety of UUVs during transformation. Following the proposed strategy, particle swarm optimization is employed to find the optimal aggregation points. Finally, possible collisions between UUVs and collisions between UUVs and targets are avoided by adding a collision avoidance algorithm based on a virtual torque field. The model prediction is used to solve the delay problem of underwater communication, and the communication results are used to correct the model prediction results. The test shows that the method is effective. The effectiveness of the proposed method is demonstrated using two simulation examples.