The result of the dynamic time warping(DTW) depends much on the accuracy of endpoint detection.The recognition time is too long and less efficient in the voice recognition.An ant colony optimization(ACO) algorithm is presented to solve the dynamic time warping problem.The core of this algorithm is using adaptive evaporation coefficient,dynamic pheromone update strategy,a new state transition rule and the ants with the optimal parameter,and so on.The algorithm can find a better route in a short time,and improve the performance.The simulation compared the traditional DTW with the DTW based on the improved ant colony algorithm,the results show that the new algorithm has better global search ability and accuratenss than the traditional ant colony algorithm and the traditional DTW.It can provide a better performance in the speech recognition rate.