Abstract:In the booming autonomous driving technology, the results of pedestrian trajectory prediction often affect autonomous driving safety. Pedestrian trajectory prediction technology currently faces the problem of interaction with others when applied to practical scenarios, requiring consideration of social interaction and logical consistency during predicting trajectories. Therefore, this study proposes a pedestrian trajectory prediction method based on spatio-temporal graphs. This method employs graph attention networks to model pedestrian interactions in the scenarios and adopts a method of automatically generating positive and negative samples to reduce the collision rate of the output trajectory through contrastive learning, thus improving the safety and logical consistency of the output trajectory. Model training and testing are conducted on ETH and UCY datasets, and the results show that the proposed method reduces the collision rate and has better prediction accuracy than mainstream algorithms.