During the flyby mission of small celestial bodies in deep space, it is hard for spacecraft to take photos at proper positions only rely on ground-based scheduling, due to the long communication delay and environment uncertainties. Aimed at imaging properly, an autonomous imaging policy generated by the scheduling networks that based on deep reinforcement learning is proposed in this paper. A novel reward function with relative distance variation in consideration is designed to guide the scheduling networks to obtain higher reward. A new part is introduced to the reward function to improve the performance of the networks. The robustness and adaptability of the proposed networks are verified in simulation with different imaging missions. Compared with the results of genetic algorithm (GA), Deep Q-network (DQN) and proximal policy optimization (PPO), the reward obtained by the trained scheduling networks is higher than DQN and PPO in most imaging missions and is equivalent to that of GA but, the decision time of the proposed networks after training is about six orders of magnitude less than that of GA, with less than 1e−4 s. The simulation and analysis results indicate that the proposed scheduling networks have great potential in further onboard application.