A gated linear network is able to mimic the functionality of a pre-trained neural network with a compound activation function R(x) = x ∗ S(x). An SVM can then be formulated to further implicitly optimize the gated linear network, in which a quasi-linear kernel is composed by using the gate signal S(x) generated from the pre-trained neural network. In this way, we realize a neural network based kernel learning. In this paper, a distance metric learning is applied to improving the kernel learning. In the pre-training of neural network, the loss function of distance metric learning is used as a regularization term. With the loss function of distance metric learning, the samples from within-class become closer and that from between-class become farther, which can improve the quasi-linear kernel. Accordingly, the classifier optimized by SVM with quasi-linear kernel will have better performance. The proposed classification method is applied to different real-world datasets and simulation results confirm the effectiveness of the proposed method.