multi-proc train knn for img