Adjoint method is widely used in aerodynamic design because only once solution of flow field is required for adjoint method to obtain the gradients of all design variables. However, the calculation cost of adjoint vector is approximately equal to that of flow computation. In order to accelerate the solution of adjoint vector and improve the adjoint-based optimization efficiency, machine learning for adjoint vector modeling is presented. Deep neural network (DNN) is employed to construct the mapping between the adjoint vector and the local flow variables. DNN can efficiently predict adjoint vector and its generalization is examined by a transonic drag reduction about NACA0012 airfoil. The results indicate that with negligible calculation cost of the adjoint vector, the proposed DNN-based adjoint method can achieve the same optimization results as the traditional adjoint method.