Friend recommendation is a critical task in social networks. In this paper, we propose a Bayesian Personalized Ranking Deep Neural Network (BayDNN) model for friend recommendation in social networks. BayDNN rst extracts latent structural pa erns from the input network data and then use the Bayesian ranking to make friend recommendations. With BayDNN we achieve signi cant performance improvement on two public datasets: Epinions and Slashdot. For example, on Epinions dataset, BayDNN signi cantly outperforms the state-of-the-art algorithms, with a 5% improvement on NDCG over the best baseline. e advantages of the proposed BayDNN mainly come from a novel Bayesian personalized ranking (BPR) idea, which precisely captures the users' personal bias based on the extracted deep features, and its underlying convolutional neural network (CNN), which o ers a mechanism to extract latent deep structural feature representations of the complicated network data. To get good parameter estimation for the neural network, we present a netuned pre-training strategy for the proposed BayDNN model based on Poisson and Bernoulli probabilistic models.