With the improvement in the quality of university education in China, the behavior of college students and school teachers to borrow and return books in the library is becoming more and more frequent. In peak periods of returning books, managers cannot even assist in returning books in time. Therefore, this research uses kernel function, multi-dimensional principal component analysis method, and multi-dimensional linear discriminant analysis method to construct a new face recognition algorithm for the automatic return of books in the university library. The test results show that the XT_2D_PL algorithm designed in this study has a face recognition rate of 96.8%. When the number of face samples of each type in the test sample set is 11, and when the number of feature dimensions is 14, the recognition rate of 96.3% reaches the highest level. However, if the sample to be processed is 500 pictures, the calculation speed is 1.072ms/per photo, higher than most comparison algorithms. The proposed face recognition algorithm has high recognition accuracy on the library face data; the calculation speed meets the needs of practical applications, and has certain practical promotion potential.