Most granular flow in nature and industrial processing has the property of polydispersity, whereas we are always restricted to using the monodisperse drag force model in simulations since the drag force model with polydispersity is difficult to establish. Ignoring polydispersity often results in obvious deviations between simulation and experimental outcomes. Generally, it is very hard for us to describe the characteristics of polydispersity in drag force by using a function with analytic expression. Recently, the artificial neural network (ANN) model provides us the advantages of estimating these kinds of outcomes with better accuracy. In this work, the ANN is adopted to model the drag force in polydisperse granular flows. In order to construct a reasonable ANN algorithm for modeling the polydisperse drag force, the structures of ANN are elaborately designed. As training for the ANN drag model, a direct numerical simulation method is proposed, based on the lattice Boltzmann method (LBM), to generate the training data, and an adaptive data filtering algorithm, termed as the optimal contribution rate algorithm (OCRA), is introduced to effectively improve the training efficiency and avoid the over-fitting problems. The results support that the polydispersity of the system can be well scaled by the ANN drag model in a relatively wide range of particle concentrations, and the predicted results coincide well with the experimental ones. Moreover, the ANN drag model is not only effective for polydisperse systems, but compatible with monodisperse systems, which is impossible using traditional drag models.