In order to establish the QSAR model to predict activities of imidazole ALK5 inhibitors, the relationship between molecular structures and the activities (pIC50) of 61 kinds of imidazole ALK5 inhibitors was analyzed. Moreover, the molecule shape indices, electrical topological state indices and electric distance vectors of these compounds were calculated. The molecule shape indices K1 and K3, the electrical topological state indices E19, E21 and E24, as well as electric distance vectors M26, M30 and M56, were optimized and screened. The eight parameters were used as input layer neuron variables of neural network and the activity data pIC50 was used as output layer neuron variable, the 8:4:1 neural network structure was adopted and the artificial neural network method was used to establish a more satisfying QSAR prediction model. The total correlation coefficient r is 0.956. The predicted values of pIC50 and experimental values are very close, and the mean relative error is 0.85%. The results showed that the neural network model has strong stability and good predictive ability. It can provide guidance for the synthesis of new anticancer drugs with high activity.