add KNN algorithm and complete the recognition process